But, for some reason I have a header error that states:
Warning: Cannot modify header information - headers already sent by (output started at G:\xampp\htdocs\bethel\1purpose_bethel\forgotPass.php:5) in G:\xampp\htdocs\bethel\1purpose_bethel\forgotPass.php on line 16
line 16 is the line that shows header('location: ...');
Here is a code fragment. I don't think you need to see the whole page, but if you do let me know?
Thank You
Kevin
Code: Select all
<?php if (isset($_POST['Submit'])){
//Place quotes around the email address so that when you compare it, it will match.
//note the special handling of the variable in the sql query string
$myEmail = quote($_POST['email']);
$check = mysql_query("SELECT * FROM user WHERE email = \"$myEmail\"")or die(mysql_error());
//Gives error if user dosen't exist
$check2 = mysql_num_rows($check);
if (empty($check2)) {
$_SESSION['SES_loginErr'] = "Your email address was not found in the database, please try again!";
header('Location: forgotPass.php');
exit;
} else {
while($info = mysql_fetch_array( $check )) {
$fName = $info['fName'];
}