validation process works well but it won't redirect to the new "profile.php " page. Pls let me know where I am going wrong.
Here is the html form.
<form name = "fomu_kuingia" action = "<?php echo htmlspecialchars($_SERVER["PHP_SELF"]); ?>" method = "POST">
<br><br> Barua pepe: <input type="text" name="baruapepe" />
<span class = "error" style = "color: #DC143C;"> <?php echo $tatizo; ?></span>
<br><br> Neno la siri: <input type="password" name="nenosiri" />
<span class = "error" style = "color: #DC143C;"> <?php echo $tatizo1; ?></span>
<br><br><input type="button" value="Nimesahau" name="nimesahau" /><input type="submit" value="Ingia " name="ingia " />
<span class = "error" style = "color: #DC143C;"> <?php //echo $jinaErr; ?></span>
</form>
here is the php function to take data (email/ passed)
<?php
//$pepe = " ";
// $siri = " ";
function take_data()
{ $pepe = "";
$siri = "";
if ($_SERVER["REQUEST_METHOD"] == "POST")
{
if (empty ($_POST["baruapepe"])||empty ($_POST["nenosiri"]))
{ echo "<font color = '#DC143C' > TATIZO: Tafadhali ingiza barua pepe au neno siri </font>" ; }
else { $pepe = verify($_POST["baruapepe"]);
$siri = verify($_POST["nenosiri"]);
kuingia ($pepe, $siri); }
}
}
?>
here if the function to verify data ;php function;
<?php
//$pepe = " ";
// $siri = " ";
function verify ($data)
{
$data = trim ($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
?>
and fınally ıs the functıon to check logın (email,paswd) detaıls and redırect to new page .
<?php
//$pepe = " ";
// $siri = " ";
function kuingia ($pp, $sr)
{
$con = mysql_connect('localhost', 'root', 'root');
if (!$con)
{ echo "Connection was not possible ";}
else
{
mysql_select_db('DalaliOnline', mysql_connect('localhost', 'root', 'root'));
$result = mysql_query("select jina1, jina2 from watumiaji where barua_pepe = '$pp' and neno_siri = '$sr' ");
if (!$result)
{ echo "Tatizo la mysql"; }
else if (mysql_num_rows($result)== 0)
{ echo "<font color = '#DC143C' > TATIZO: Barua pepe au neno siri vimekosewa </font>" ; }
else
{ header ("Location:profile.php");
echo "umefanikiwa kuingia"; }
}
}
?>