PHP代碼錯誤。仍然顯示我這個錯誤「未定義的索引:操作」 在PHP函數中$ action = $ _REQUEST ['action'];你能幫我找出解決方案嗎?HTML/PHP表單,錯誤 - 未定義索引:PHP代碼中的操作
謝謝
完整的代碼在這裏:
<?php
$action = $_REQUEST['action'];
if ($action== "") {
?>
<form action="" method="POST" >
Meno*:<br>
<input name="name" type="text" value="" size="30"/><br>
Email*:<br>
<input name="email" type="text" value="" size="30"/><br>
Vaša otázka*:<br>
<textarea name="message" rows="11" cols="80"></textarea><br>
<input type="submit" value="Poslať email"/>
</form>
<?php
}
else /* send the submitted data */
{
$name = $_REQUEST['name'];
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];
if (($name=="") || ($email=="") || ($message=="")) {
echo "Všetky políčka je potrebné vyplniť. Napíšte <a href=\"\"> otázku </a> ešte raz.";
} else {
$from = "From: $name<$email>\r\nReturn-path: $email";
$subject = "Message sent using your contact form";
mail("[email protected]", $subject, $message, $from);
echo "Mail poslaný!";
}
}
?>
我認爲,這意味着,有沒有$ _REQUEST [「行動」]正在取得或receive..what應是你行動的價值,它來自哪裏? – Vainglory07