0
<?php
$action=$_REQUEST['action'];
if ($action=="")    /* display the contact form */
{
?>
<form  action="" method="POST" enctype="multipart/form-data">
<input type="hidden" name="action" value="submit">
Nickname:*<br>
<input name="name" type="text" value="" size="30"/><br>
E-mail:*<br>
<input name="email" type="text" value="" size="30"/><br><br>
asdf:<br>
<input name="message" type="text" value="frozen text" size="30" disabled/><br>
<input type="submit" value="Proceed"/>
</form>
<?php
} 
else                /* send the submitted data */
{
$name=$_REQUEST['name'];
$email=$_REQUEST['email'];
$message=$_REQUEST['message'];
if (($name=="")||($email=="")||($message==""))
    {
    echo "All fields are required, please fill <a href=\"\">the form</a> again.";
    }
else{        
    $from="From: $name<$email>\r\nReturn-path: $email";
    $subject="blahblahblah";
    mail("test@gmail.com", $subject, $message, $from);
    echo "Sent";
    }
}  
?>

Can somebody please explain me what is wrong with this code? Notice: Undefined index: action in C:\Program Files\VertrigoServ\www\shop1.php on line 2

Call Stack
#   Time    Memory  Function    Location
1   0.0007  242024  {main}( )   ...\shop1.php:0
Tim
  • 1

0 Answers0