View Full Version : Formmail Help!

01-14-2004, 05:38 PM
Hi can anyone tell me why the data sent fromthe html does not appear in the email received please? I need the value Q1 (radio button response) to be sent in th email!!!!!


<input type="hidden" name="board2" value="BB Comp January">
<input type=hidden name="subject" value="BB January Comp">
<input type=hidden name="recipient" value="paul@uknetweb.com">
<tr valign="top">
<td width="280" height="74">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>Q1</b>
In the &quot;Board room&quot; section, which is Beachbeats
sister site called for classic longboards?</font></p>
<td width="270" height="74"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2">
<input type="radio" name="Q1" value="Cord">
<input type="radio" name="Q1" value="Cape">
<input type="radio" name="Q1" value="Core">


The PHP page that this sends to...

$subject = ("$subject");
$Q1 = stripslashes ("$Q1");
$from = "From:\"$realname\" <$from>\nX-Mailer: uknetweb_PHP";
$comment = stripslashes($comment);
if (mail($email,$subject,$comment,$from,$Q1))
echo "Email sent correctly. We will be in touch with you shortly";
} else {
echo "Email failed to send. Please check their email address.";

01-14-2004, 05:48 PM
Perhaps you have register_globals disabled? Use


in an otherwise blank PHP file and check the PHP settings. If register_globals is disabled, that's basically a Good Thing(TM), and the only thing you need to do is to adjust the variables used in your script.

Everything coming from a POST form appears in the superglobal $_POST array. You write

$comment = stripslashes($_POST['comment']);

instead. See also

01-14-2004, 05:53 PM
If you are using the popular formmail.php then you should consider using something else. There are security holes in it and people are exploiting it all over the place sending spam mail from other peoples accounts. At the very least change the name of the file because people are scanning servers looking for it.

01-15-2004, 12:06 AM
first of all you have all your radio inputs named the same, first rename them such as Q1, Q2, Q3. Then if that email is being sent to anyname@yourdomain.com then you need to send an email to that address first to make sure its enabled correctly on your server. And it seems like you forgot the beginning for the form unless you just forgot to paste it ?....looks like you forgot <form method="post" action="processor.php" />.....and dont forgot </form> at the end.

01-15-2004, 04:17 AM
Originally posted by DsgnrsTLZAdmin
first of all you have all your radio inputs named the same, first rename them such as Q1, Q2, Q3.

Umm that's how radio buttons work. They have to be named the same so they work as a group otherwise you would be able to select all of them.