hi I have this project that requires taking data from a html form that has different inputs such as pulldown menu with options and radio menu, each option for the pulldown menu has a value but also has text. my php script takes the option from the html using a name but then when i echo that variable it displays the value, i want to display the text.
heres the code
// compact if-else statement
$os = (isset($_POST[‘os’])) ? $_POST[‘os’] : “”;
echo “Your operating system is “.$os.”
this code displays the value. an example would be from above if you select windows7(below-html) from the menu the echo display would be w7, i want it to say the Text that follows the value, so in this instance Windows 7.
<tr> <td class='c1'> Operating System</td> <td> <select name="os" id="os"> <option value="0">--select operating system--</option> <option value="w7">Windows 7</option> <option value="w7p">Windows 7 Pro</option> <option value="w8">Windows 8</option> </select> </td>
i apologize if this is confusing i dont know how else to explain it. Basically when the script is ran i want the display to say Your operating system is Windows 7 not the value=“w7”.