rodn29 Posted July 19, 2007 Share Posted July 19, 2007 Hi, I am having trouble with a form. I would like someone to enter their name and email (that info is then sent to my e-mail address). Also, after entering their information the user should be taken to a new page (test.html). My ISP wrote a quick PHP script but when run it generates hundreds of blank e-mails and the page does not forward to test.html. This is the script: <?php $headers = 'From: webmaster@mg-interactive.com'; $recipient = 'rodn29@gmail.com'; $name = $_POST['required-Name']; $email = stripslashes($_POST['required-e-mail']); mail($recipient, $name, $email, $headers, '-fwebmaster@mg-interactive.com'); ?> <h1> <meta http-equiv="Refresh" content="1; http://www.mg-interactive.com/test.html"> </h1> Any ideas? Thanks in advance Quote Link to comment Share on other sites More sharing options...
thedarkwinter Posted July 19, 2007 Share Posted July 19, 2007 maybe you can try: <?php $headers = 'From: webmaster@mg-interactive.com'; $recipient = 'rodn29@gmail.com'; $name = $_POST['required-Name']; $email = stripslashes($_POST['required-e-mail']); mail($recipient, $name, $email, $headers, '-fwebmaster@mg-interactive.com'); header("location: test.html"); ?> and drop the html at the end. im assuming this isn't test.html? Quote Link to comment Share on other sites More sharing options...
predator12341 Posted July 19, 2007 Share Posted July 19, 2007 here you go <? $to = "";//your email add $sub = "Message from you website"; $msg = "The users name ".$_POST['required-Name']." <br />The users email ".$_POST['required-e-mail'].""; mail($to, $subject, $msg,"Content-Type: text/html\r\nFrom: webform@yourdomain.com"); header("Location: ENTER HERE");//REPLACE ENTER HERE WITH THE PAGE YOU WANT THE USER TO BE REDIRECTED TO ?> regards Mark Quote Link to comment Share on other sites More sharing options...
dbo Posted July 19, 2007 Share Posted July 19, 2007 Hah, if it is test.html that would explain all the emails. Quote Link to comment Share on other sites More sharing options...
rodn29 Posted July 19, 2007 Author Share Posted July 19, 2007 Yup, that did it. Thanks soooo much! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.