Advertisement
newbiegalau

Simple PHP Contact From Website

Jun 2nd, 2017
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement