Error in PHP code. Still showing me this error "Undefined index: action" in php function $action = $_REQUEST['action']; Could you please help me to find out the solution.
thank you
full code here :
<?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ý!";
}
}
?>