Help with a PHP Email Form...
Moderator: General Moderators
Help with a PHP Email Form...
Need help making radio buttons post to my email form... Can anyone help???
Here is the code...
removed by moderator
K... i am not the developer of this form. is there any way we could take this off of here? i could explain better in an email and send you the code again.
there are a few radio buttons on this form. they are to indicate whether or not the user is a new member or involved in 8-ball or 9-ball (this is a pool league site). All i am looking for is how does that work... the way i have there now doesn't work properly and post it to an email.
there are a few radio buttons on this form. they are to indicate whether or not the user is a new member or involved in 8-ball or 9-ball (this is a pool league site). All i am looking for is how does that work... the way i have there now doesn't work properly and post it to an email.
Here is one:
in the top of my document:
$8ball = $_POST['8ball'];
$9ball = $_POST['9ball'];
Now for the corresponding radio buttons:
<tr>
<td width="43" valign="top" class="bodyCopy4">8-ball</td>
<td width="20"><input name="8ball" type="checkbox" id="8ball" value="<?php echo $_POST['8ball'];?>"></td>
<td width="36" valign="top" class="bodyCopy4">9-ball</td>
<td width="455"><input name="9ball" type="checkbox" id="9ball" value="<?php echo $_POST['9ball'];?>"></td>
</tr>
What goes to the email:
?
} else { /////// if no errors are found mail message
$_SESSION[date] = date("D F dS, Y g:ia");
$msg = "You have received an email from APA Registration.\n\n";
$msg .= "New Players:\t".$newplayers."\n";
$msg .= "8-Ball:\t".$8ball."\n";
$msg .= "9-Ball:\t".$9ball."\n";
in the top of my document:
$8ball = $_POST['8ball'];
$9ball = $_POST['9ball'];
Now for the corresponding radio buttons:
<tr>
<td width="43" valign="top" class="bodyCopy4">8-ball</td>
<td width="20"><input name="8ball" type="checkbox" id="8ball" value="<?php echo $_POST['8ball'];?>"></td>
<td width="36" valign="top" class="bodyCopy4">9-ball</td>
<td width="455"><input name="9ball" type="checkbox" id="9ball" value="<?php echo $_POST['9ball'];?>"></td>
</tr>
What goes to the email:
?
} else { /////// if no errors are found mail message
$_SESSION[date] = date("D F dS, Y g:ia");
$msg = "You have received an email from APA Registration.\n\n";
$msg .= "New Players:\t".$newplayers."\n";
$msg .= "8-Ball:\t".$8ball."\n";
$msg .= "9-Ball:\t".$9ball."\n";
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
Last I checked $8Ball would be an illegal variable name. i.e. a variable must start with a letter or underscore.
You are setting the value of the 8ball/9ball checkboxes to the value posted to the page. Do you really want to do this? Or was it intended to automatically check the box?
If the latter, you'll need to check the value posted against the known "yes" type values and print "checked" into the tag's attributes, or not.. Note that if the posting page uses a checkbox for these, if not checked, the value will not be passed.
You are setting the value of the 8ball/9ball checkboxes to the value posted to the page. Do you really want to do this? Or was it intended to automatically check the box?
If the latter, you'll need to check the value posted against the known "yes" type values and print "checked" into the tag's attributes, or not.. Note that if the posting page uses a checkbox for these, if not checked, the value will not be passed.