我正在使用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