Create(INTERN_DB_NAME); $error=0; if($_POST['i_str_login']!="" && $_POST['i_str_email']!="") { $strRequete="select id_employer, str_first_name, str_last_name, str_login, str_title from employer left join title using(id_title) where str_email='".$_POST['i_str_email']."' and str_login='".$_POST['i_str_login']."' and id_status=1"; $strConnection->Query($strRequete); if ($strConnection ->rows != 0) { $strConnection ->Fetch(0); $Db_id_employer = $strConnection ->data['id_employer']; $Db_str_title = $strConnection ->data['str_title']; $Db_str_first_name = $strConnection ->data['str_first_name']; $Db_str_last_name = $strConnection ->data['str_last_name']; $Db_str_login = $strConnection ->data['str_login']; $char = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; $password = ''; for( $i=1; $i<=6; $i++) { $password .= $char[ rand(1, strlen($char))-1 ]; } $strRequete="UPDATE employer SET str_pass='".md5($password)."' WHERE id_employer='".$Db_id_employer."'"; $strConnection->Update($strRequete); $headers .= "From: TPD Interns \n"; $headers .= "X-Sender: \n"; $headers .= "X-Mailer: PHP\n"; $headers .= "Return-Path: \n"; $headers .= "Content-Type: text/html; charset=iso-8859-1\n"; $texte .= "Dear ".$Db_str_title." ".$Db_str_first_name." ".$Db_str_last_name.",

\n\n"; $texte .= "Your password has been reset. Please see below for your new login information.

\n\n"; $texte .= "User Name: ".$Db_str_login."
\n"; $texte .= "Password: ".$password."

\n"; $texte .= "Go to Interns-Canada.com to login

\n\n"; $texte .= "Should you require any further assistance, please contact us at support@interns-canada.com\n"; mail($_POST['i_str_email'], "Interns-Canada - Password Notification", "$texte", $headers); $mess_ok="A new password has been sent to ".$_POST['i_str_email']."

Go back to the home page."; $error=1; } else $mess_ok="The information you provided cannot be found from our system. Please try again!"; } else $mess_ok="Please enter your username and email below to search for your account information. A new password will be generated and sent to your email account."; // ========================================================================= // H T M L // ========================================================================= validateUser(); showHeading(); ?>

Forgot Password?