silverglade Posted March 7, 2010 Share Posted March 7, 2010 hi. i want the user to choose one of the radio button selections, and mail me the results, its not working, i get back "blarg". here is the html <div align="center"> <form id="form1" name="form1" method="post" action="userform1.php"> <p> <input type="radio" name="RadioGroup1" value="five" id="five" /> 5 <input type="radio" name="RadioGroup1" value="ten" id="ten" /> 10 <input type="radio" name="RadioGroup1" value="fifteen" id="fifteen" /> 15 <input type="radio" name="RadioGroup1" value="twenty" id="twenty" /> 20 <input type="radio" name="RadioGroup1" value="twenty_five" id="twenty_five" /> 25 <input type="radio" name="RadioGroup1" value="thirty" id="thirty" /> 30 </p> <input type="submit" name="submit " id="submit " value="submit" /> </form> </div> and here is the php <?php if(isset($_POST['submit'])) { $to = "[email protected]"; $subject = "How many attributes to use on bossgrade.com"; foreach($_POST as $key => $value) { /*loops through the POST array and uses the form values*/ $$key = $value; } $body = "Feedback from user: \n Number of attributes should be : $five \n Number of attributes should be : $ten \n Number of attributes should be : $fifteen \n Number of attributes should be : $twenty \n Number of attributes should be : $twenty_five \n Number of attributes should be : $thirty \n "; echo "Thank you for filling out my feedback form!"; mail($to, $subject, $body); } else { echo "blarg!"; } ?> <!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=utf-8" /> <title>Feedback form</title> </head> <body> </body> </html> Link to comment https://forums.phpfreaks.com/topic/194413-cant-get-form-mail-to-work/ Share on other sites More sharing options...
silverglade Posted March 7, 2010 Author Share Posted March 7, 2010 the problem was a space in my submit attribute. i wanted to be able to tell which radio button they pressed. but as it is coded now, all i get in my email is this Feedback from user: Number of attributes should be : Number of attributes should be : Number of attributes should be : Number of attributes should be : Number of attributes should be : Number of attributes should be Link to comment https://forums.phpfreaks.com/topic/194413-cant-get-form-mail-to-work/#findComment-1022763 Share on other sites More sharing options...
silverglade Posted March 7, 2010 Author Share Posted March 7, 2010 nevermind i fixed it by using POST [radiogroup1] thanks. derek Link to comment https://forums.phpfreaks.com/topic/194413-cant-get-form-mail-to-work/#findComment-1022780 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.