jamosdeyamos Posted October 7, 2008 Share Posted October 7, 2008 I thought I was doing this correctly. I'm actually starting to get what all the script is saying, but this PHP form isn't sending all the fields to my email, only "shows" and "email". I have no idea what's happening. here's the form in my page... <form method="post" action="maillist.php"><font bgcolor="C1C1C1" size="1" color="#ffffff" face="helvetica">Email: <input name="email" type="text"><br> <br>What information would you like to recieve?<br> Shows? <input value="yes" name="shows" type="checkbox"> Contests? <input value="yes" name="contests" type="checkbox"><br> <br><input value="Join Now!" type="submit"></form> and here's maillist.php... <?php $to = "everett.james@gmail.com"; $subject = "Add to mailing list..."; $email = $_REQUEST['email'] ; $shows = $_REQUEST['shows'] ; $contests = $_REQUEST['contests'] ; $sent = mail("$to", "$subject", "Add: $email","Info on Shows?: $shows", "Info $contests") ; if($sent) {print "Thanks for joining! You'll be sent a message soon about upcoming shows!"; } else {print "We encountered an error submitting your request"; } ?> Can anyone help? At one point I tried to add more form elements and have them submit but I got a line in my error page saying the mail () function could only contain 5 different things in it. Wassa happenin??? Thanks! James Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted October 7, 2008 Share Posted October 7, 2008 use $_POST Instead of $_REQUEST Quote Link to comment Share on other sites More sharing options...
jamosdeyamos Posted October 7, 2008 Author Share Posted October 7, 2008 no dice, still doing the same thing. Thanks though! Quote Link to comment Share on other sites More sharing options...
Brandon Jaeger Posted October 7, 2008 Share Posted October 7, 2008 Try this: $message = "Add: $email\nInfo on shows?: $shows\nInfo: $contests"; $sent = mail("$to", "$subject", "$message"); Quote Link to comment Share on other sites More sharing options...
jamosdeyamos Posted October 7, 2008 Author Share Posted October 7, 2008 That makes sense with something else I had read, so thanks! You're probably right but not it seems something else went wrong... I got this message when hitting submit: Parse error: syntax error, unexpected T_VARIABLE in /home/jeca/public_html/maillist.php on line 5 This is what my maillist.php looks like now: <?php $to = "everett.james@gmail.com"; $subject = "Add to mailing list..."; $message = "Add: $email\nInfo on shows?: $shows\nInfo on contests?: $contests" $email = $_REQUEST['email'] ; $shows = $_REQUEST['shows'] ; $contests = $_REQUEST['contests'] ; $sent = mail("$to", "$subject", "$message"); if($sent) {print "Thanks for joining! You'll be sent a message soon about upcoming shows!"; } else {print "We encountered an error submitting your request"; } ?> what did I mess up now? Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted October 7, 2008 Share Posted October 7, 2008 you're missing a semi colon after the $message var Quote Link to comment Share on other sites More sharing options...
jamosdeyamos Posted October 7, 2008 Author Share Posted October 7, 2008 Ho shiza! it worked! thanks everyone! This forum is awesome. Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted October 7, 2008 Share Posted October 7, 2008 Yeah I absolutely love this forum... its absolutely amazing! It has saved my butt quite a few times LOL! 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.