0)) { $row = pg_fetch_row($result,0); $password = $row[0]; $t = apache_lookup_uri ("changepassword.html"); $url = "http://$SERVER_NAME$t->uri?login=" . htmlentities($login) . "&email=" . htmlentities($email) . "&hash=$password"; //$url = "http://www.kidtest.com/changepassword.html?login=" . htmlentities($login) . "&email=" . htmlentities($email) . "&hash=$password"; $emailBody = "Change of Kidtest.com(SM) password instructions\n"; $emailBody .=""; $emailBody .= "To change you Kidtest.comSM password, please click \n"; $emailBody .=""; $emailBody .="here\n"; $emailBody .="

Or you may go to the following url: \n"; $emailBody .="$url\n"; $emailBody .="

You will be asked for a new password and reminder phrase.\n"; $emailBody .="\n"; $emailBOdy .="\n"; $emailHeaders = "From: Kidtest.com \n"; $emailHeaders .= "Return-Path: \n"; // Return path for errors // The following line is for sending HTML content $emailHeaders .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type mail($email,'A message from Kidtest.com(SM)',$emailBody,$emailHeaders); print <<< ENDTEXT

An email message has been sent to you with instructions on how to change your password. Your should receive it shortly. ENDTEXT; } } else if (($login == '') || ($email == '')) { displayInputForm("",""); } else { $q = "select password_reminder,emailaddress from login where lower(login)='".strtolower($login)."'"; $q .="\n and lower(emailaddress)='".strtolower($email)."'"; //print "

$q
\n"; $result = pg_exec($conn,$q); if (($result) && (pg_numrows($result) > 0)) { //Found a record $row = pg_fetch_row($result,0); $reminder = $row[0]; print "

Your password reminder is: " . stripslashes($reminder) . "\n"; // display login box here displayLoginInput($fromPage); print "If you still do not remember your password, or you would like to change it, click here, and an email will be sent to you with instructions on how to change it."; } else { print "

The login id and email address you entered was not found. Please make sure that you have typed them correctly."; displayInputForm($login,$email); } } function displayInputForm($login,$email) { print "\n

If you have forgotten your password, enter your login id and email address below then press the "; print "'I forgot my password' button. Your password reminder phrase will be displayed."; print "\n

"; print "\n

"; print "\n"; print "\n"; print "\n "; print "\n"; print "\n"; print "\n "; print "\n "; print "\n"; print "\n"; print "\n "; print "\n "; print "\n"; print "\n"; print "\n "; print "\n
Please enter your login and email address below.
Login:
Email Address:
"; print "\n
"; print "\n
\n"; } ?>