$action=$_REQUEST['action'];
if ($action=="")    /* display the contact form */
    {
    ?>
   

   
    Your name:

   

    Your email:

   

    Your message:

   

   
   

        }
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 the form again.";
        }
    else{       
        $from="From: $name<$email>\r\nReturn-path: $email";
        $subject="Message sent using your contact form";
        mail("gabylo4u@gmail.com", $subject, $message, $from);
        echo "Email sent!";
        }
    } 
?>

Post a Comment

 
Top