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 = "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

Link to comment
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 = "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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.