login  Naam:   Wachtwoord: 
Registreer je!
 Forum

contact

Offline Ultimatum - 07/11/2005 12:12
Avatar van UltimatumPHP expert heb het contact form van tuinstoel aangepast, maar krijg error op regel 44

  1. <?
  2.  
  3. $Admin = 'Ultimatum';
  4. $Email = 'ultimatum22@hotmail.com';
  5. $Subject = 'Request';
  6. $Spam = 10;
  7. ?>
  8. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  9. <html>
  10. <head>
  11. <title>Mail Formulier</title>
  12. </head>
  13. <body>
  14. <?
  15. if(!empty($_POST['submit']))
  16. {
  17. $error = '';
  18. $I = 0;
  19.  
  20. if(empty($_POST['name'])) {
  21. $error .= '-You have to fill in a name<br />'; $I++;
  22. }elseif(empty($_POST['mail'])) {
  23. $error .= '-You have to fill in an email address<br />'; $I++;
  24. }elseif(empty($_POST['cmail'])) {
  25. $error .= '-You have to confirm your email address<br />'; $I++;
  26. }elseif(!preg_match("/^[A-Za-z0-9._\-]+\@[A-Za-z0-9._\-]+\.[A-Za-z]{2,4}$/", "$mail")) {
  27. $error .= '-You have to fill in a valid email address<br />'; $I++;
  28. }elseif($mail != $cmail) {
  29. $error .= '-The email addresses you enterd are not the same<br />'; $I++;
  30. }
  31. if(!empty($error))
  32. {
  33. echo ($I == 1) ? 'The following error has occured:<br />' : 'The following errors has occured:<br />';
  34. echo $error;
  35. }
  36. else
  37. {
  38.  
  39. $Header = "MIME-Version: 1.0\r\n";
  40. $Header .= "Content-type: text/html; charset=iso-8859-1\r\n";
  41. $Header .= "To: ".$Admin." <".$Email.">\r\n";
  42. $Header .= "From: ".$_POST['name']." <".$_POST['mail'].">\r\n";
  43. $Message = 'Het volgende bericht is gestuurd via het contact formulier:<br /><hr><br />'$_POST['name'], $_POST['mail'], $_POST['colors'], $_POST['hexcolor'], $_POST['images'], $_POST['comment'];
  44. mail($Email,$subject.,$Message,$Header);
  45.  
  46. echo 'De e-mail is succesvol verzonden!';
  47. setcookie('mailform',1,time()+($spam*60));
  48.  
  49. $show = true;
  50. }
  51. }
  52.  
  53. $name = (isset($_POST['name'])) ? $_POST['name'] : '';
  54. $mail = (isset($_POST['mail'])) ? $_POST['mail'] : '';
  55. $color = (isset($_POST['color'])) ? $_POST['color'] : '';
  56. $hexcolor = (isset($_POST['hexcolor'])) ? $_POST['hexcolor'] : '';
  57. $images = (isset($_POST['images'])) ? $_POST['images'] : '';
  58. $comment = (isset($_POST['comment'])) ? $_POST['comment'] : '';
  59.  
  60. if(isset($_COOKIE['mailform']))
  61. { $show = true; echo 'Je kunt maar eens in de '.$spam.' minuten een e-mail versturen!'; }
  62.  
  63. if(!isset($show))
  64. {
  65. ?>
  66. <br />
  67. <form method="post">
  68. Name:<br />
  69. <input type="text" name="name" maxlength="250"><br />
  70. Email:<br/>
  71. <input type="text" name="mail" maxlength="350"><br />
  72. Email [confirm]:<br />
  73. <input type="text" name="cmail" maxlength="350"><br />
  74. <br />
  75. Color:<br />
  76. <select name="color">
  77. <option value="Choose Color" selected>Choose Color</option>
  78. <option value="Black">Black</option>
  79. <option value="White">White</option>
  80. <option value="Green">Green</option>
  81. <option value="Blue">Blue</option>
  82. <option value="Purple">Purple</option>
  83. <option value="Yellow">Yellow</option>
  84. </select><br />
  85. Hexcode:<br />
  86. <input type="text" name="hexcode" maxlength="6"><br />
  87. Images:<br />
  88. <textarea name="images" cols="40" rows="5"></textarea><br />
  89. Comments:<br />
  90. <textarea name="comments" cols="40" rows="5"></textarea><br />
  91. <input type="submit" value="submit" name="submit">
  92. </form>
  93. <br />
  94. <?
  95. }
  96. ?>
  97. </body>
  98. </html>

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.221s