Jump to content

PHP Noob needs form help


jamosdeyamos

Recommended Posts

Hey all, I'm trying to make a form on my website so I can let people join a mailing list.  I wanted the results emailed to me so it was suggested I use PHP.  I tried inputting this PHP off of http://php.about.com/od/phpapplications/ss/form_mail.htm but they didnt explain it as though I was didn't understand PHP, so I'm pretty sure I messed it up.  Here's the form I have on my webpage:

 

<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 heres the maillist.php file...

 

<?php

$to = "[email protected]";

$subject = "Add to mailing list...";

$email = $_REQUEST['email'] ;

$shows = $_REQUEST['shows'] ;

$contests = $_REQUEST['contests'] ;

$headers = "From: [email protected]";

$sent = mail($to, $subject, $message, $headers) ;

if($sent)

{print "Your mail was sent successfully"; }

else

{print "We encountered an error sending your mail"; }

?>

 

 

The weirdest part is that the form connects, and sends the email address an email with the subject right and everything.  But then the email is entirely blank.  So I presumed there was something wrong with my $_REQUEST tag, but I'll be damned if I can figure out what it is.

 

If anyone can help me, that would be awesome.  I'm fairly interested in learning PHP and becoming part of the fold, but this is something I can't really afford to wait for. 

 

Thanks!

 

James

 

PS, the website its trying to go on is www.metheusbound.ca

Link to comment
https://forums.phpfreaks.com/topic/126786-php-noob-needs-form-help/
Share on other sites

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.