frank_solo Posted July 9, 2011 Share Posted July 9, 2011 I have a survey form and I want to post the results and send them by email through php. I have two scripts the form and the php script that sends it. I assuming I'm doing something wrong because the form does get sent but there are is info on the email. How do I post the values on the email. <form method="post" action="survey.php"> <table width="412" border="0" cellpadding="0"> <tr> <td colspan="5"><p><strong>1. Service Experience</strong></p></td> </tr> <tr> <td width="181"><p> </p></td> <td width="75"><p align="center">Excellent</p></td> <td width="51"><p align="center">Good</p></td> <td width="60"><p align="center">Fair</p></td> <td width="36"><p align="center">Poor</p></td> </tr> <tr> <td width="181"><p>Reservations</p></td> <td width="75"><p align="center"> <input type="radio" name="reservations_01" value="Excellent" /> </p></td> <td width="51"><p align="center"> <input type="radio" name="reservations_01" value="Good" /> </p></td> <td width="60"><p align="center"> <input type="radio" name="reservations_01" value="Fair" /> </p></td> <td width="36"><p align="center"> <input type="radio" name="reservations_01" value="Poor" /> </p></td> </tr> <tr> <td width="181"><p>Confirmation</p></td> <td width="75"><p align="center"> <input type="radio" name="confirmation_02" value="Excellent" /> </p></td> <td width="51"><p align="center"> <input type="radio" name="confirmation_02" value="Good" /> </p></td> <td width="60"><p align="center"> <input type="radio" name="confirmation_02" value="Fair" /> </p></td> <td width="36"><p align="center"> <input type="radio" name="confirmation_02" value="Poor" /> </p></td> </tr> <tr> <td width="181"><p>Airport Greeter<br /> (if applicable)</p></td> <td width="75"><p align="center"> <input type="radio" name="airport_greeter_03" value="Excellent" /> </p></td> <td width="51"><p align="center"> <input type="radio" name="airport_greeter_03" value="Good" /> </p></td> <td width="60"><p align="center"> <input type="radio" name="airport_greeter_03" value="Fair" /> </p></td> <td width="36"><p align="center"> <input type="radio" name="airport_greeter_03" value="Poor" /> </p></td> </tr> <tr> <td width="181"><p>Chauffeur</p></td> <td width="75"><p align="center"> <input type="radio" name="chauffeur_04" value="Excellent" /> </p></td> <td width="51"><p align="center"> <input type="radio" name="chauffeur_04" value="Good" /> </p></td> <td width="60"><p align="center"> <input type="radio" name="chauffeur_04" value="Fair" /> </p></td> <td width="36"><p align="center"> <input type="radio" name="chauffeur_04" value="Poor" /> </p></td> </tr> <tr> <td width="181"><p>Vehicle</p></td> <td width="75"><p align="center"> <input type="radio" name="vehicle_05" value="Excellent" /> </p></td> <td width="51"><p align="center"> <input type="radio" name="vehicle_05" value="Good" /> </p></td> <td width="60"><p align="center"> <input type="radio" name="vehicle_05" value="Fair" /> </p></td> <td width="36"><p align="center"> <input type="radio" name="vehicle_05" value="Poor" /> </p></td> </tr> <tr> <td width="181"><p>Billing</p></td> <td width="75"><p align="center"> <input type="radio" name="billing_06" value="Excellent" /> </p></td> <td width="51"><p align="center"> <input type="radio" name="billing_06" value="Good" /> </p></td> <td width="60"><p align="center"> <input type="radio" name="billing_06" value="Fair" /> </p></td> <td width="36"><p align="center"> <input type="radio" name="billing_06" value="Poor" /> </p></td> </tr> <tr> <td width="181"><p>Overall</p></td> <td width="75"><p align="center"> <input type="radio" name="overall_07" value="Excellent" /> </p></td> <td width="51"><p align="center"> <input type="radio" name="overall_07" value="Good" /> </p></td> <td width="60"><p align="center"> <input type="radio" name="overall_07" value="Fair" /> </p></td> <td width="36"><p align="center"> <input type="radio" name="overall_07" value="Poor" /> </p></td> </tr> <tr> <td width="181"></td> <td colspan="4"></td> </tr> <tr> <td width="181"><p>Comments</p></td> <td colspan="4"><p align="center"> <textarea name="comments_08"></textarea> </p></td> </tr> <tr> <td> </td> <td colspan="4"><input type="submit" value="Send" /> <input type="reset" value="Reset" /></td> </tr> </table> </form> Php Script <?php $to = "info@xxxxxx.com"; // change to your email address $reservations_01 = $_POST["reservations_01"]; $confirmation_02 = $_POST["confirmation_02"]; $airport_greeter_03 = $_POST["airport_greeter_03"]; $chauffeur_04 = $_POST["chauffeur_04"]; $vehicle_05 = $_POST["vehicle_05"]; $billing_06 = $_POST["billing_06"]; $overall_07 = $_POST["overall_07"]; $comments_08 = $_POST["comments_08"]; $d = date('l dS \of F Y h:i:s A'); $sub = "Survey Form"; $headers = "From: $name <$email>\n"; $headers .= "Content-Type: text/plain; charset=iso-8859-1\n"; $mes .= 'Date & Time: '.$d; { mail($to, $sub, $mes, $headers); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/241467-how-do-i-pass-radio-button-values-to-a-php-email/ Share on other sites More sharing options...
sKunKbad Posted July 9, 2011 Share Posted July 9, 2011 The first radio button value is available as $_POST['reservations_01'] Quote Link to comment https://forums.phpfreaks.com/topic/241467-how-do-i-pass-radio-button-values-to-a-php-email/#findComment-1240424 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.