我的问题不是电子邮件发送成功,而是我网站上的确认页面。电子邮件已经发送给用户,但是当他们单击链接以激活他们的密码时,它会将他们带到一个确认页面,它应该确认激活并注册他们,但它根本没有做任何事情。它只是显示一个空白页面,我什至检查了数据库,没有任何改变。我需要任何帮助,我也有下面的代码。任何帮助都会很棒。
<?php
include('sqlconfig.php');
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
/* Confirmation Code */
$passkey=$_GET['passkey'];
$tbl_name1="temp_users";
/*retrieve data */
$sql1="SELECT * FROM temp_users WHERE confirm='$passkey'";
$result1=mysql_query($sql1);
if($result1){
$count=mysql_num_rows($result1);
/*Fetch The data From the table */
if($count==1){
$rows=mysql_fetch_array($result1);
$Email=$rows['email'];
$First_Name=$rows['FirstN'];
$Last_name=$rows['LastN'];
$password=$rows['password'];
$phone=$rows['phone'];
$tbl_name2="users";
/*Insert data into new users table */
$sql2="INSERT INTO $tbl_name2(First Name, Last Name, Email, Password, phone)VALUES('$First_Name', '$Last_name', '$Email', '$password', '$phone')";
$result2=mysql_query($sql2);
}
/*If passkey is not found*/
else {
echo "Wrong Confirmation code";
}
/*If activation successful, show, and delete old data from temp table*/
if($result2){
echo "Your account has been activated";
// Delete information of this user from table "temp_members_db" that has this passkey
$sql3="DELETE FROM $tbl_name1 WHERE confirm_code = '$passkey'";
$result3=mysql_query($sql3);
}
}
?>