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 = "[email protected]"; $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 Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/ Share on other sites More sharing options...
dennismonsewicz Posted October 7, 2008 Share Posted October 7, 2008 use $_POST Instead of $_REQUEST Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/#findComment-659103 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! Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/#findComment-659115 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"); Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/#findComment-659126 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 = "[email protected]"; $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? Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/#findComment-659128 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 Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/#findComment-659135 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. Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/#findComment-659142 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! Link to comment https://forums.phpfreaks.com/topic/127418-php-form-is-not-sending-all-fields/#findComment-659144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.