Advertisement
Guest User

Untitled

a guest
Mar 27th, 2015
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 KB | None | 0 0
  1. <form name="contact" method="POST" action="enquiryForm.php">
  2. <p><b>Name</b><br>
  3. </tr>
  4. <tr>
  5. <input type="text" name="Name" size=40>
  6. </tr>
  7. <tr>
  8. <p><b>Your Email</b><br>
  9. </tr>
  10. <tr>
  11. <input type="text" name="email" size=40>
  12. </tr>
  13. <tr>
  14. <p><b>Company</b><br>
  15. </tr>
  16. <tr>
  17. <input type="text" name="Company" size=40>
  18. </tr>
  19. <tr>
  20. <p><b>Subject</b><br>
  21. </tr>
  22. <tr>
  23. <input type="text" name="subject" size=40>
  24. </tr>
  25. <tr>
  26. <p><b>Message</b><br>
  27. </tr>
  28. <tr>
  29. <textarea cols=40 rows=10 name="message"></textarea>
  30. </tr>
  31. <tr>
  32. <p><input type="submit" value=" Send ">
  33. </tr>
  34. </form>
  35. </div>
  36.  
  37. <?php
  38.  
  39. $to="info@projectrefresh.net"; // what email address do you wish the email to be sent to?
  40.  
  41. $subject="Enquiry from website"; // what subject do you want the email to have
  42.  
  43. $sendto="thankyou.html"; // where do you want the visitor to be sent to afterwards?
  44.  
  45. //
  46.  
  47. // This is an UNSUPPORTED web form to email PHP script for usage by DiYhost.co.uk customers
  48.  
  49. //
  50.  
  51. $message = "This message has been sent from ".$_SERVER['HTTP_HOST']."nnn";
  52.  
  53. while(list($var, $val)=each($HTTP_POST_VARS)){ // Get all variables
  54.  
  55. $message .= "[".$var."]: ".$val."nn"; // build the message body
  56.  
  57. }
  58.  
  59. $message .= "nnThe person's IP address who sent this email is: ".$_SERVER['REMOTE_ADDR'];
  60.  
  61. // see http://www.php.net/manual/en/function.mail.php
  62.  
  63. mail($to, $subject, $message,
  64.  
  65. "From: webmaster@".$_SERVER['SERVER_NAME']."rn"
  66.  
  67. ."Reply-To: webmaster@".$_SERVER['SERVER_NAME']."rn"
  68.  
  69. ."X-Mailer: PHP/" . phpversion());
  70.  
  71. // see http://www.php.net/manual/en/function.header.php
  72.  
  73. header("Location: http://".$_SERVER['HTTP_HOST']
  74.  
  75. .dirname($_SERVER['PHP_SELF'])
  76.  
  77. ."/".$sendto);
  78.  
  79. ?>
  80.  
  81. <a href="index.html">Home</a>
  82.  
  83. <a href="/index.html">Home</a>
  84.  
  85. header("Location: $sendto");
  86.  
  87. echo $_SERVER['HTTP_HOST'];
  88. echo $_SERVER['PHP_SELF'];
  89. echo dirname($_SERVER['PHP_SELF']);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement