if ($_SERVER["HTTP_HOST"]=="blogs.ntugo.com") { ?> } ?>
Just enter your NTugo ID and the email address we have on file. If they match, we will email a new temporary password to you.
} ?> if ($do=="yes") { $noads="1"; //Collect form data $ntugoid = $_POST['ntugoid']; $email = $_POST['email']; //Do the fields match? $hostname_logon = "localhost"; $database_logon = "ntugo"; $username_logon = "merlin"; $password_logon = "VitaMerlini"; $logon = mysql_pconnect($hostname_logon, $username_logon, $password_logon) or trigger_error(mysql_error(),E_USER_ERROR); mysql_select_db($database_logon) or die ( "Unable to select database!" ); $query = "SELECT * FROM logon WHERE username = '$ntugoid' AND email = '$email'" ; $result = mysql_query($query) or die ( "Error in query: $query. " . mysql_error() ); $rows = mysql_num_rows($result); $row=mysql_fetch_assoc($result); if (mysql_num_rows($result) < 1) { echo "We could not find a record for the data you entered."; $rpwerror=="1"; exit(); } //Generate temp password if ($rpwerror!=1) { settype($template, "string"); $template = "1234567890abcdefghijklmnopqrstuvwxyz"; function GetRandomString($length) { global $template; settype($length, "integer"); settype($rndstring, "string"); settype($a, "integer"); settype($b, "integer"); for ($a = 0; $a <= $length; $a++) { $b = rand(0, strlen($template) - 1); $rndstring .= $template[$b]; } return $rndstring; } $temppass = GetRandomString(8); } //Reset password if ($rpwerror!=1) { $md5temppass = md5($temppass); $query = "UPDATE logon SET password='$md5temppass' WHERE username='$ntugoid'" ; $result = mysql_query($query) or die ( "Error in query: $query. " . mysql_error() ); $query = "UPDATE logon SET plainpass='$temppass' WHERE username='$ntugoid'" ; $result = mysql_query($query) or die ( "Error in query: $query. " . mysql_error() ); } //Email the password if ($rpwerror!=1) { $to = $email; $subject = "NTugo: Temporary Password"; $msg = "The password for your NTugo account (".$ntugoid.") has been reset to '".$temppass."'. You may change the password to something more memorable once you log in. Have a nice day!"; mail($to, $subject, $msg, "Message From: NTugo.com\nReply-To: Do not reply to this message\n"); echo "A temporary password has been emailed to you."; } } ?>