hello, i was wondering if someone could help me out with this error im getting.
I am new to php, i have been studying it and watching videos on it from lynda.com
im totally self teaching and im trying to get this down but its still pretty confusing to me.
Notice: Undefined index: email in */*/public_html/forgot_pass.php on line 26
any help would be much apprciated i have been racking my brain on this one for hours now and i just dont know what im not getting right! Thank you so much!!
im also concerned about line 30 eregi_replace eeek pls help
$outputForUser = "";
if ($_POST['email'] != "") {
$email = $_POST['email'];
$email = strip_tags($email);
$email= eregi_replace("`", "", $email);
$email = mysql_real_escape_string($email);
$sql = mysql_query("SELECT * FROM myMembers WHERE email='$email' AND email_activated='1'");
$emailcheck = mysql_num_rows($sql);
if ($emailcheck == 0){
$outputForUser = '<font color="#FF0000">There is no account with that info<br />
in our records, please try again.';
} else {
$emailcut = substr($email, 0, 4); // Takes first four characters from the user email address
$randNum = rand();
$tempPass = "$emailcut$randNum";
$hashTempPass = md5($tempPass);
@mysql_query("UPDATE myMembers SET password='$hashTempPass' where email='$email'") or die("cannot set your new password");
$headers ="From: $adminEmail\n"; // $adminEmail is established in [ scripts/connect_to_mysql.php ]
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";
$subject ="Login Password Generated";
$body="<div align=center><br>----------------------------- New Login Password --------------------------------<br><br><br>
Your New Password for our site is: <font color=\"#006600\"><u>$tempPass</u></font><br><br />
</div>";
if(mail($email,$subject,$body,$headers)) {
$outputForUser = "<font color=\"#006600\"><strong>Your New Login password has been emailed to you.</strong></font>";
} else {
$outputForUser = '<font color="#FF0000">Password Not Sent.<br /><br />
Please Contact Us...</font>';
}
}
} else {
$outputForUser = 'Enter your email address into the field below.';
}
I am new to php, i have been studying it and watching videos on it from lynda.com
im totally self teaching and im trying to get this down but its still pretty confusing to me.
Notice: Undefined index: email in */*/public_html/forgot_pass.php on line 26
any help would be much apprciated i have been racking my brain on this one for hours now and i just dont know what im not getting right! Thank you so much!!
im also concerned about line 30 eregi_replace eeek pls help
$outputForUser = "";
if ($_POST['email'] != "") {
$email = $_POST['email'];
$email = strip_tags($email);
$email= eregi_replace("`", "", $email);
$email = mysql_real_escape_string($email);
$sql = mysql_query("SELECT * FROM myMembers WHERE email='$email' AND email_activated='1'");
$emailcheck = mysql_num_rows($sql);
if ($emailcheck == 0){
$outputForUser = '<font color="#FF0000">There is no account with that info<br />
in our records, please try again.';
} else {
$emailcut = substr($email, 0, 4); // Takes first four characters from the user email address
$randNum = rand();
$tempPass = "$emailcut$randNum";
$hashTempPass = md5($tempPass);
@mysql_query("UPDATE myMembers SET password='$hashTempPass' where email='$email'") or die("cannot set your new password");
$headers ="From: $adminEmail\n"; // $adminEmail is established in [ scripts/connect_to_mysql.php ]
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \n";
$subject ="Login Password Generated";
$body="<div align=center><br>----------------------------- New Login Password --------------------------------<br><br><br>
Your New Password for our site is: <font color=\"#006600\"><u>$tempPass</u></font><br><br />
</div>";
if(mail($email,$subject,$body,$headers)) {
$outputForUser = "<font color=\"#006600\"><strong>Your New Login password has been emailed to you.</strong></font>";
} else {
$outputForUser = '<font color="#FF0000">Password Not Sent.<br /><br />
Please Contact Us...</font>';
}
}
} else {
$outputForUser = 'Enter your email address into the field below.';
}
Last edited: