Minimeallolla Posted November 12, 2010 Share Posted November 12, 2010 what would be the $_POST variable name for a radio button option? Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/ Share on other sites More sharing options...
Rifts Posted November 12, 2010 Share Posted November 12, 2010 it would be whatever you set it as... <form> <input type="radio" name="sex" value="male" /> Male<br /> <input type="radio" name="sex" value="female" /> Female </form> $_POST['sex'] Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133282 Share on other sites More sharing options...
Minimeallolla Posted November 12, 2010 Author Share Posted November 12, 2010 ops i meant a drop down menu* Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133283 Share on other sites More sharing options...
Dragosvr92 Posted November 12, 2010 Share Posted November 12, 2010 Any..... the Variables are what you want them to be you can name the Variable Radio,R,Rad ........dosnt matter Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133284 Share on other sites More sharing options...
Minimeallolla Posted November 12, 2010 Author Share Posted November 12, 2010 well i did Bithrdate Day:<name="day" value="day"/> and tried to call on that varaible with $day and it doesnt work Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133286 Share on other sites More sharing options...
Rifts Posted November 12, 2010 Share Posted November 12, 2010 its the same <form action=""> <select name="CARS"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="fiat">Fiat</option> <option value="audi">Audi</option> </select> </form> $_POST['CARS'] Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133287 Share on other sites More sharing options...
Rifts Posted November 12, 2010 Share Posted November 12, 2010 this might help you also http://www.w3schools.com/html/html_forms.asp Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133288 Share on other sites More sharing options...
Minimeallolla Posted November 12, 2010 Author Share Posted November 12, 2010 I did <select> instead of <select name>. Thanks for the help. (: Can you help me with another thread? http://www.phpfreaks.com/forums/php-coding-help/need-help-with-syntax-php-username-need-help/ Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133293 Share on other sites More sharing options...
Dragosvr92 Posted November 12, 2010 Share Posted November 12, 2010 if you want to use the $day variable you have to enable register_globals on PHP but i'd recommend you to use $_GET[''day] or $_POST['day'] in case your server dosnt have that function enabled Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133323 Share on other sites More sharing options...
Pikachu2000 Posted November 12, 2010 Share Posted November 12, 2010 Don't turn on register_globals. Link to comment https://forums.phpfreaks.com/topic/218453-what-would-be-the-_post-variable-name-for-a-radio-button-option/#findComment-1133334 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.