Advertisement
azad_rpi

Contact Form For HTML Site

Jul 26th, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. index.html
  2. ==================================
  3. <!doctype html>
  4. <html>
  5.   <head>
  6. <title>This is title</title>   
  7. </head>
  8.  
  9. <body>
  10.     <h2>Contact with us!</h2>
  11.  
  12.     <form name="form1" action="form_process.php" method="post" />
  13.         Name: <input type="text" name="name" /></br>
  14.         Email: <input type="text" name="email" /></br>
  15.         Message:<textarea name="textarea"></textarea></br>
  16.         <input type="submit" value="SUBMIT" name="submit" />
  17.     </form>
  18. </body>
  19. </html>
  20.  
  21. form_process.php
  22. =========================================
  23.  
  24. <?php
  25. $name=$_POST['name'];
  26. $email=$_POST['email'];
  27. $textarea=$_POST['textarea'];
  28. $to="md.azad1216@gmail.com";
  29. $message="Name: $name \n\n Email: $email \n\n Message: $textarea";
  30.  
  31. if(mail($to,"Contact From my techtutorial site", $message, "FROM: $email")){
  32.     echo "Thank you $name your messaage has been sent";
  33. }
  34. else{
  35.     echo "Sorry, your messege hasnt been sent";
  36. }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement