ChrisMartino Posted January 15, 2010 Share Posted January 15, 2010 Ok, So as part of my register script, I need to get them to select a account type, This involves selecting it from a radio box, But i need them to be redirected to a page like this If they select "Artist" they are redirected to the page "register.php?account=artist" If they select "Band" they are redirected to the page "register.php?account=band" And so on, Heres my html radio form: <div id="main"> <a name="TemplateInfo"></a> <h1>Create new Account</h1> <p> First off, Select what account type you wish to register: <FORM ACTION="register.php"> <INPUT TYPE=RADIO NAME="Account" VALUE="Artist">Artist<BR> <INPUT TYPE=RADIO NAME="Account" VALUE="Band">Band<BR> <INPUT TYPE=RADIO NAME="Account" VALUE="Record">Record Company<P> <br /> <INPUT TYPE=SUBMIT VALUE="Next"> </FORM> </p> </div> Link to comment https://forums.phpfreaks.com/topic/188630-help-with-radio-buttons/ Share on other sites More sharing options...
Felex Posted January 15, 2010 Share Posted January 15, 2010 set your form method to get Link to comment https://forums.phpfreaks.com/topic/188630-help-with-radio-buttons/#findComment-995851 Share on other sites More sharing options...
ChrisMartino Posted January 15, 2010 Author Share Posted January 15, 2010 How do i do that again? :S Link to comment https://forums.phpfreaks.com/topic/188630-help-with-radio-buttons/#findComment-995859 Share on other sites More sharing options...
piyush23424 Posted January 15, 2010 Share Posted January 15, 2010 you resgister.php will be like this if($_REQUEST['Account'] == 'Artist') { header("Location: register.php?account=artist"); exit; } elseif($_REQUEST['Account'] == 'Band') { header("Location: register.php?account=band"); exit; } else{ //for third option record } Link to comment https://forums.phpfreaks.com/topic/188630-help-with-radio-buttons/#findComment-995860 Share on other sites More sharing options...
Felex Posted January 15, 2010 Share Posted January 15, 2010 change <FORM ACTION="register.php"> to <FORM ACTION="register.php" method="get"> Link to comment https://forums.phpfreaks.com/topic/188630-help-with-radio-buttons/#findComment-995863 Share on other sites More sharing options...
piyush23424 Posted January 15, 2010 Share Posted January 15, 2010 replace the line <FORM ACTION="register.php"> with this <FORM ACTION="register.php" method="get"> to set form action as get Link to comment https://forums.phpfreaks.com/topic/188630-help-with-radio-buttons/#findComment-995864 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.