我正在使用PHP在用户创建帐户时向我发送电子邮件。它包含用户名,密码和电子邮件:
<?php
$code = isset($_GET['code']) ? $_GET['code'] : 0;
if ($code == 1) {
echo "Your account has been created.";
$master_to = "[email protected]";
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$master_user = $_POST["username"];
$master_password = $_POST["password"];
$master_ema = $_POST["mail"];
$info = "Username:" . $user . " Password: " . $password . " Email: " . $ema;
mail($master_to, "User Request", $info, $headers);
$a_to = $_POST["mail"];
$a_message = '<h3 style="font-size:30pt; font-family:impact, fantasy; border:5px solid gray; color:green; border-radius:3px; background: linear-gradient(blue, gray); padding:15px;">SarkellianCreed.com</h3><br><br><br><p style="font-family:calibri, sans-serif; padding:20px;">Welcome to SarkellianCreed.com! Click <a href="http://www.sarkelliancreed.comule.com/accountfinalstep">here</a> to confirm your account.</p><p style="font-family:calibri, sans-serif; padding:20px;">If the link doesn't open, paste this address into your browser bar: <input type="text" value="http://www.sarkelliancreed.comule.com/accountfinalstep"></p>';
mail($a_to,"Account Confirmation | SarkellianCreed.com", $a_message, $headers);
} else if ($code == 2) {
echo "Thank you for your feedback, " . $_POST["name"] . ".";
if (isset($_POST["sent"])) {
echo "You will receive an email at " . $_POST["youremail"] . ".";
}
}
?>
页也可用于其他用途,这是什么else if($code == 2){}
在做什么。该页面是here 当用户创建一个帐户时,用户名,密码和电子邮件应该显示在文本框中,但没有任何显示。我曾经使用this来完成这项工作。它也没有工作。
*“它包含用户名,密码”* <=这根本不安全。 –
您正在将您的用户密码发送至*您的*电子邮件地址?哇。 – jeroen
我不喜欢收到我的密码的欢迎注册电子邮件。 – harrrrrrry