0
我是一個業餘的PHP和我做了這個簡單的提交表單(見下文)。現在,當我點擊提交時,它的行爲就好像它已經通過它顯示收到的消息,但我沒有在我的實際電子郵件中得到任何味精。 3個表單輸入名稱是:姓名,電子郵件,信息。難道我做錯了什麼?提交表單實際上並沒有收到消息
<?php
$message="$msg";
$mail_from="$email";
$header="from: $name <$mail_from>";
$to ='[email protected]';
$send_contact=mail($to,$message,$header);
if($send_contact){
echo "I've received your message and I will get back to you shortly! You will be redirected in less than 5 seconds!";
header("refresh:5;url=http://google.com");
}
else {
echo "ERROR";
}
?>
因此,$ message = $ _ POST ['msg'] ;; $ mail_from = $ _ POST ['email']等等? – user1830833
沒問題。另外,如果您想在實時網頁上使用此功能,請注意[this](http://www.thesitewizard.com/php/protect-script-from-email-injection.shtml)。 – mrks
我做了一點挖掘,我重新做了我的表格(我把它放在第一篇文章中的編輯)。仍然沒有收到它的電子郵件。另外,我稍後會看一下這個注入的東西。 – user1830833