ball420 Posted October 8, 2007 Share Posted October 8, 2007 i have a little form with some radio buttons rate 1 to 5 kinda thing. my script mails me when submitted but it is blank even though i selected the buttons. i have done this with regular text fields with no problem but i think the out of the radio buttons needs to be different thanks for the help. piece of my html form <input type="radio" name="song2" value="1" /> 1</label> <label> <input type="radio" name="song2" value="2" /> 2</label> <label> <input type="radio" name="song2" value="3" /> 3</label> <label> <input type="radio" name="song2" value="4" /> 4</label> <label> <input type="radio" name="song2" value="5" /> 5</label> <label> <br /> <br /> <input type="radio" name="song3" value="1" /> 1</label> <label> <input type="radio" name="song3" value="2" /> 2</label> <label> <input type="radio" name="song3" value="3" /> 3</label> <label> <input type="radio" name="song3" value="4" /> 4</label> <label> <input type="radio" name="song3" value="5" /> 5<br /> </label> my php mailer <?php if(isset($_POST['submit'])) { $errmsg = ''; // error message $nextstep = "nextstep.php"; $song1 = $_POST['song1']; $song2 = $_POST['song2']; $song3 = $_POST['song3']; $song4 = $_POST['song4']; $song5 = $_POST['song5']; $song6 = $_POST['song6']; $song7 = $_POST['song7']; $song8 = $_POST['song8']; $song9 = $_POST['song9']; $song10 = $_POST['song10']; $body = " $song1 /n $song2 /n $song3 /n $song4 /n $song5 /n $song6 /n $song7 /n $song8 /n $song9 /n $song10 /n " ; } $to = "tmat@molaedvv.com"; $subject = 'music poll' . $subject ; mail($to, $subject, $body); header('Location: nextstep.php'); exit; ?> thanks for all the help Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/ Share on other sites More sharing options...
The Little Guy Posted October 8, 2007 Share Posted October 8, 2007 in your form why do you only have name="song2", and name="song3"? Could this be the reason? Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364809 Share on other sites More sharing options...
ball420 Posted October 8, 2007 Author Share Posted October 8, 2007 those are the labels of each one 1 to 5 what should they be instead. ambey i have the wrong definition of what the name field is supposed to hold Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364814 Share on other sites More sharing options...
MmmVomit Posted October 8, 2007 Share Posted October 8, 2007 Can you post the whole form? Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364815 Share on other sites More sharing options...
The Little Guy Posted October 8, 2007 Share Posted October 8, 2007 oh never mind, I didn't read that those were radio buttons. can we see the whole form like MnnVomit asked. Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364818 Share on other sites More sharing options...
ball420 Posted October 8, 2007 Author Share Posted October 8, 2007 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <table width="600" border="0" cellpadding="0" cellspacing="0" > <!--DWLayoutTable--> <tr> <td width="15" height="16"></td> <td width="45"></td> <td width="234"></td> <td width="306"></td> </tr> <tr> <td height="143"></td> <td colspan="2" valign="top"><img src="mytime.jpg" width="308" height="154" /></td> <td> </td> </tr> <tr> <td height="58"></td> <td> </td> <td></td> <td></td> </tr> <tr> <td height="251"> </td> <td> </td> <td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0"><form id="poller" name="poller" method="post" action="mailer.php"> <!--DWLayoutTable--> <tr> <td height="19" colspan="2" valign="top">this is song number one </td> <td width="213" rowspan="20" valign="top"> <label> <input type="radio" name="song1" value="1" /> 1</label> <label> <input type="radio" name="song1" value="2" /> 2</label> <label> <input type="radio" name="song1" value="3" /> 3</label> <label> <input type="radio" name="song1" value="4" /> 4</label> <label> <input type="radio" name="song1" value="5" /> 5</label> <label> <br /> <br /> <input type="radio" name="song2" value="1" /> 1</label> <label> <input type="radio" name="song2" value="2" /> 2</label> <label> <input type="radio" name="song2" value="3" /> 3</label> <label> <input type="radio" name="song2" value="4" /> 4</label> <label> <input type="radio" name="song2" value="5" /> 5</label> <label> <br /> <br /> <input type="radio" name="song3" value="1" /> 1</label> <label> <input type="radio" name="song3" value="2" /> 2</label> <label> <input type="radio" name="song3" value="3" /> 3</label> <label> <input type="radio" name="song3" value="4" /> 4</label> <label> <input type="radio" name="song3" value="5" /> 5<br /> </label> <label> <br /> <input type="radio" name="song4" value="1" /> 1</label> <label> <input type="radio" name="song4" value="2" /> 2</label> <label> <input type="radio" name="song4" value="3" /> 3</label> <label> <input type="radio" name="song4" value="4" /> 4</label> <label> <input type="radio" name="song4" value="5" /> 5<br /> </label> <label> <br /> <input type="radio" name="song5" value="1" /> 1</label> <label> <input type="radio" name="song5" value="2" /> 2</label> <label> <input type="radio" name="song5" value="3" /> 3</label> <label> <input type="radio" name="song5" value="4" /> 4</label> <label> <input type="radio" name="song5" value="5" /> 5<br /> </label> <label> <br /> <input type="radio" name="song6" value="1" /> 1</label> <label> <input type="radio" name="song6" value="2" /> 2</label> <label> <input type="radio" name="song6" value="3" /> 3</label> <label> <input type="radio" name="song6" value="4" /> 4</label> <label> <input type="radio" name="song6" value="5" /> 5<br /> </label> <br /> <input type="radio" name="song7" value="1" /> 1 </label> <label> <input type="radio" name="song7" value="2" /> 2</label> <label> <input type="radio" name="song7" value="3" /> 3</label> <label> <input type="radio" name="song7" value="4" /> 4</label> <label> <input type="radio" name="song7" value="5" /> 5<br /> </label> <br /> <input type="radio" name="song8" value="1" /> 1 </label> <label> <input type="radio" name="song8" value="2" /> 2</label> <label> <input type="radio" name="song8" value="3" /> 3</label> <label> <input type="radio" name="song8" value="4" /> 4</label> <label> <input type="radio" name="song8" value="5" /> 5<br /> </label> <br /> <input type="radio" name="song9" value="1" /> 1 </label> <label> <input type="radio" name="song9" value="2" /> 2</label> <label> <input type="radio" name="song9" value="3" /> 3</label> <label> <input type="radio" name="song9" value="4" /> 4</label> <label> <input type="radio" name="song9" value="5" /> 5</label> <br /><br /> <input type="radio" name="song10" value="1" /> 1 </label> <label> <input type="radio" name="song10" value="2" /> 2</label> <label> <input type="radio" name="song10" value="3" /> 3</label> <label> <input type="radio" name="song10" value="4" /> 4</label> <label> <input type="radio" name="song10" value="5" /> 5</label> <br /> </td> <td width="61"></td> </tr> <tr> <td width="26" height="23"> </td> <td width="237"> </td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top">this is song 3 </td> <td></td> </tr> <tr> <td height="24"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top">this is song # 2 </td> <td></td> </tr> <tr> <td height="20"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top">this is song 3 </td> <td></td> </tr> <tr> <td height="22"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> <td></td> </tr> <tr> <td height="22"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> <td></td> </tr> <tr> <td height="22"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> <td></td> </tr> <tr> <td height="22"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> <td></td> </tr> <tr> <td height="23"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> <td></td> </tr> <tr> <td height="21"> </td> <td></td> <td></td> </tr> <tr> <td height="19" colspan="2" valign="top"><!--DWLayoutEmptyCell--> </td> <td></td> </tr> <tr> <td height="2"></td> <td></td> <td></td> </tr> <td height="24"> </td> <td colspan="2" valign="top"><div align="center"><input name="Vote" type="submit" value="submit" /></div></td> <td> </td> </tr> </form></table></td> </tr> <tr> <td height="15"></td> <td></td> <td></td> <td></td> </tr> </table> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364821 Share on other sites More sharing options...
The Little Guy Posted October 8, 2007 Share Posted October 8, 2007 Change This: if(isset($_POST['submit'])) { to this: if(isset($_POST['Vote'])) { Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364823 Share on other sites More sharing options...
ball420 Posted October 8, 2007 Author Share Posted October 8, 2007 that won't work becuse my name is vote the value is submit. that is working right Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364837 Share on other sites More sharing options...
The Little Guy Posted October 8, 2007 Share Posted October 8, 2007 your not checking for a value with isset, your checking to see if a name or variable has been created Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364844 Share on other sites More sharing options...
ball420 Posted October 8, 2007 Author Share Posted October 8, 2007 thanks man works great. learn somthing new everyday. i really appriciate it Quote Link to comment https://forums.phpfreaks.com/topic/72342-solved-trouble-with-radio-button-output/#findComment-364854 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.