session_start(); // send password.php // takes userid and get screenName, email address, and password. sends email with info. require_once 'DB.php'; include("mySQLpref.php"); include("functions.php"); // in case doesn't pass email address. if (!array_key_exists('email',$_GET)) { header('Location:http://'.$url_Prefix.'/postpersonalsLogin.php?ca='.$sessionID); exit; } $screenName=""; $password=""; $email=$_GET['email']; $db = DB::connect($dsn); chkSqlError($db); $info_sql="SELECT screenName, password from personals_user_tbl where email='".$email."'"; $row=$db->getRow($info_sql); chkSqlError($db); $screenName=$row[0]; $password=$row[1]; // in case fake / bogus email address if ($screenName="") { header('Location:http://'.$url_Prefix.'/postpersonalsLogin.php?ca='.$sessionID); exit; } else { $replyUid=""; if(array_key_exists('ruid',$_SESSION)){ $replyUid=$_SESSION['ruid']; } $to=$email; $subject = "Fourth Ring Personals "; //define variables for the template $template="sendPassword.template"; $bindings['email']=$email; $bindings['screenName']=$screenName; $bindings['password']=$password; $bindings['urlPrefix']=$url_Prefix; $bindings['ruid']=$replyUid; // call FillTemplate function to load reg html template and swap out appropriate variables. $body=FillTemplate($template,$bindings); $headers ="From: personals@fourthring.com\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; //no sendmail on windows test machine. if ($url_Prefix=="localhost:8080") { print $body; exit; } if (mail($to, $subject, $body,$headers)) { $message="Thanks, please check your email to confirm your registration!"; } else { $message="Sorry, we are experience unsually high traffic. Please try back in 15 mins."; } $db->disconnect(); //--------------------END MYSQL CODE------------------------------------- header('Location:http://'.$url_Prefix.'/errorPage.php?errorCode='.$message); } ?>