Hi all,
I'm using the same (variation of) script for years to send out forms to an email address, and what strikes me is that one one site it works perfect the first time, while the other site needs countless adaptations, alltough they are hosted on the same servers.
For instance, here is my form code, saved as "main.php" and embedded in an index as such: http://www.site.com/contact/index.php?id=main
Code PHP:<?php if (!empty($_POST['Submit'])) { $to = "me@address.com"; mail("$to", "Email subject", "Check this message out.\n\nNaam: " . $_POST['name'] . "\nVoornaam: " . $_POST['firstname'] . "\nFirma: " . $_POST['company'] . "\n\nTelefoon: " . $_POST['phone'] . "\nEmail: " . $_POST['email'] . "\n\nMessage: " . $_POST['message'], "From: My website\r\n" ."Reply-To: $email\r\n" ."X-Mailer: PHP/" . phpversion()); header ("Location: http://www.site.com/contact/index.php?id=thanks"); exit; } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <div> <label><?php print($lan[162]);?></label> <input type="text" name="name" id="name" class="forms"> </div> <div> <label><?php print($lan[163]);?></label> <input type="text" name="firstname" id="firstname" class="forms"> </div> <div> <label><?php print($lan[164]);?></label> <input type="text" name="company" id="company" class="forms"> </div> <p> </p> <div> <label><?php print($lan[165]);?></label> <input type="text" name="email" id="email" class="forms"> </div> <div> <label><?php print($lan[166]);?></label> <input type="text" name="phone" id="phone" class="forms"> </div> <div> <label><?php print($lan[167]);?></label> <textarea name="message" id="message"></textarea> </div> <div><input type="submit" class="buttons" value=" <?php print($lan[168]);?> "></div> </form>
In this case, the form won't send or show me the thanks.php page, alltought I've copied it right from another (working!) project.
What am I doing wrong? Can anyone point out the mistake here so I can stop losing time every time it fails on me?
Thanks in advance.






Bookmarks