我在我的代碼的最後部分,電子郵件驗證。但是,電子郵件似乎沒有正確發送。爲了防止垃圾郵件,我將用_EMAIL_
替換我的電子郵件。PHP的email()函數沒有發送正確的消息?
$hash = genRandomString();
$link = 'http://www.website.com/verify.php?email=' . $email . '&hash=' . $hash;
$message = 'Please confirm your email address by click this following link, or copy and pasting it into your web browser.'
. $link;
mail($email, 'Account verification for website.com', $message);
所有數據被正確地進入數據庫(沒有不正確的變量),但電子郵件來,雖然是這樣的:
Please confirm your email address by click this following link, or copy and pasting it into your web browser.
_EMAIL_&hash=0uhcoawgi3qsek8l7rjoheo'>http://www.website.com/verify.php?email=_EMAIL_&hash=0uhcoawgi3qsek8l7rjoheo
我假設這是我做錯了,但經過各種故障排除後我無法發現它。
看看你正在顯示的輸出,它看起來像腳本不是整個腳本。鏈接創建應該與一些HTML一起? –