SHARE
TWEET

Simple PHP Contact From Website

newbiegalau Jun 2nd, 2017 (edited) 526 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*Sorce Code 02 June 2017
  2. Thanks To : www.newbieuser.org
  3. */
  4. <?php
  5. $action=$_REQUEST['action'];
  6. if ($action=="")    /* display the contact form */
  7.     {
  8.     ?>
  9.     <form  action="" method="POST" enctype="multipart/form-data">
  10.     <input type="hidden" name="action" value="submit">
  11.     Your name:<br>
  12.     <input name="name" type="text" value="" size="30"/><br>
  13.     Your email:<br>
  14.     <input name="email" type="text" value="" size="30"/><br>
  15.     Your message:<br>
  16.     <textarea name="message" rows="7" cols="30"></textarea><br>
  17.     <input type="submit" value="Send email"/>
  18.     </form>
  19.     <?php
  20.     }
  21. else                /* send the submitted data */
  22.     {
  23.     $name=$_REQUEST['name'];
  24.     $email=$_REQUEST['email'];
  25.     $message=$_REQUEST['message'];
  26.     if (($name=="")||($email=="")||($message==""))
  27.         {
  28.         echo "All fields are required, please fill <a href=\"\">the form</a> again.";
  29.         }
  30.     else{      
  31.         $from="From: $name<$email>\r\nReturn-path: $email";
  32.         $subject="Message sent using your contact form";
  33.         // mail("youremail@yoursite.com", $subject, $message, $from);
  34.         echo "Email sent!";
  35.         }
  36.     }  
  37. ?>
  38. <center> Powered by: <a href="http://www.newbieuser.org">www.newbieuser.org</a></center>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top