login  Naam:   Wachtwoord: 
Registreer je!
 Forum

simpel mailscript wilt niet werken

Offline Johaninho - 21/09/2004 16:25
Avatar van JohaninhoNieuw lid
  1. <body background="stripesbg.gif">
  2. <table width="98%" border="0" cellspacing="0" >
  3. <tr>
  4. <td width="18%" height="295" valign="top">
  5. <div align="center">
  6. <table width="152" border="0" align="center" cellspacing="0" class="tabel">
  7. <tr >
  8. <td width="151" height="26" align="center" background="images/tabletop.jpg" ><strong><font size="-1">::Q-Nav::</font></strong></td>
  9. </tr>
  10. <tr>
  11. <td height="28" align="center" background="images/sidesqlink.gif" bgcolor="#2E434C" class="qnav">
  12. <br>
  13. <table width="142" border="0" cellspacing="0" cellpadding="0" class="tabel">
  14. <tr>
  15. <td width="142"> <p><font size="-1">::Contact::<br>
  16. ::Information::<br>
  17. ::Offer::</font></p>
  18. </td>
  19. </tr>
  20. </table></td>
  21. </tr>
  22. <tr>
  23. <td height="20" align="center" background="images/tabelbottom.gif" bgcolor="#2E434C"><font size="-2">&nbsp;&nbsp;</font></td>
  24. </tr>
  25. </table>
  26. <br>
  27. </div></td>
  28. <td width="11%" align="center" valign="top">&nbsp;</td>
  29. <td width="71%" align="center" valign="top"> <table width="550" border="0" cellspacing="0" >
  30. <tr>
  31. <td width="548" height="27" background="images/contenttop.jpg">
  32. <div align="center"><strong><font size="-1">::About Me::</font></strong></div></td>
  33. </tr>
  34. <tr>
  35. <td height="319" background="images/sides.gif" bgcolor="#2E434C" class="tabel"><br>
  36. <br>
  37.  
  38. <?php
  39.  
  40. $emailad = "contact@j-design.be";
  41. $naam = $_POST['name'];
  42. $email = $_POST['email'];
  43. $subj = $_POST['subject'];
  44. $mess = $_POST['msg'];
  45. $btn = $_POST['send'];
  46.  
  47. $check_email = "/^([a-z0-9_-]+.)*?[a-z0-9_-]+@([a-z0-9-_]{2,}).[a-z0-9-_]*(.[a-z0-9- _]{2,})*$/i";
  48.  
  49. if($btn)
  50. {
  51. if(empty($naam) || empty($subj) || empty($mess))
  52. {
  53. echo "You must fill in ALL fields!!<br> you are being redirected to the mailform.";
  54. echo "<meta http-equiv=\"Refresh\" content=\"3;url=contact.php\">";
  55. }
  56. elseif(!preg_match($check_email,$email))
  57. {
  58. echo "Please enter a valid emailadress!<br> you are being redirected to the mailform.";
  59. echo "<meta http-equiv=\"Refresh\" content=\"3;url=contact.php\">";
  60. }
  61. else
  62. {
  63. mail($emailad,$subj,"Afzender: $name \n Email: $email \n Onderwerp: $subj \n IP:".$_SERVER['REMOTE_ADDR']. "\n $mess \n From: $naam \n");
  64. echo "Your email was send, please notice that only important subjects will get an answer, others will be ignored or even get banned.";
  65. }
  66. }
  67. else
  68. {
  69.  
  70. ?>
  71.  
  72. <form action="" method="post">
  73. Your name:<br>
  74. <input type="text" name="name" size="40">
  75. <br>
  76. Your email:<br>
  77. <input type="text" name="email" size="40">
  78. <br>
  79. Subject:<br>
  80. <input type="text" name"subject" size="40"><br>
  81. Message:<br>
  82. <textarea name="msg" cols="60" rows="5"></textarea>
  83. <br><br>
  84. <input type="submit" name="send" value="send">
  85. </form>
  86. <?php
  87. }
  88. ?>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td height="20" background="images/contentbottom.gif" bgcolor="#2E434C"><font size="-2">&nbsp;
  93. </font></td>
  94. </tr>
  95. </table>
  96. <div align="right"></div></td>
  97. </tr>
  98. </table>
  99. <div align="center"></div>
  100. </body>


nuja het lijkt me erop dat ik nergens een fout erin heb steken... maar toch krijg ik wanneer ik ook alle velden heb ingevuld mijn "foutmelding" (You must fill in ALL fields") te zien.
Iemand die ziet waar het eventueel fout gaat?

Greetz
J.

3 antwoorden

Gesponsorde links
Offline DRUNK - 21/09/2004 16:45 (laatste wijziging 21/09/2004 16:46)
Avatar van DRUNK PHP gevorderde in je form zit een fout, bij subject moet nog een '=' tussen 'name' en '"subject"', hier het goede form:

  1. <form action="" method="post">
  2. Your name:<br>
  3. <input type="text" name="name" size="40">
  4. <br>
  5. Your email:<br>
  6. <input type="text" name="email" size="40">
  7. <br>
  8. Subject:<br>
  9. <input type="text" name="subject" size="40"><br>
  10. Message:<br>
  11. <textarea name="msg" cols="60" rows="5"></textarea>
  12. <br><br>
  13. <input type="submit" name="send" value="send">
  14. </form>
Offline Johaninho - 21/09/2004 16:59
Avatar van Johaninho Nieuw lid Thnx DRUNK !!! pffft ken je toevallig geen training voor aandachtig te leren nalezen 
Offline DRUNK - 21/09/2004 17:10
Avatar van DRUNK PHP gevorderde gewoon dor blijven klooten tot het wel lukt, dorzettings vermogen dus 
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.23s