Advertisement
hmbashar

HTML Contact Form Dynamic use php with video tutorial

Jun 13th, 2015
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. step one:
  2. /* input this code in index.php */
  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.  
  22.  
  23.  
  24.  
  25.  
  26. step two:
  27. create php file, file name: form_process
  28. /*input this code in form_process*/
  29. <?php
  30. $name=$_POST['name'];
  31. $email=$_POST['email'];
  32. $textarea=$_POST['textarea'];
  33. $to="admin@pchelpcenterbd.com";
  34. $message="Name: $name \n\n Email: $email \n\n Message: $textarea";
  35.  
  36. if(mail($to,"Contact From by pchelpcenterbd.com site", $message, "FROM: $email")){
  37.     echo "Thank you $name your messaage has been sent";
  38. }
  39. else{
  40.     echo "Sorry, your messege hasnt been sent";
  41. }
  42. ?>
  43.  
  44. Video Tutoria: https://www.youtube.com/watch?v=cXl930-36EQ
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement