Jump to content

PHP Form is not sending all fields


jamosdeyamos

Recommended Posts

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

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?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.