Leadwing Posted October 19, 2007 Share Posted October 19, 2007 Hi there, All I want is a very simple form with 2 radio buttons and a Next button. Whichever button they choose will determine which page will appear next. I've looked everywhere and tried several things but for some reason it just wont work! Can someone help? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/73938-solved-help-with-radio-buttons/ Share on other sites More sharing options...
steve448 Posted October 19, 2007 Share Posted October 19, 2007 You need to submit the form one place first then see which radio button was selected and redirect them accordingly Example: <?php if($_POST['radio_button'] == 'button1') { header("Location: button1_page.php"); } elseif($_POST['radio_button'] == 'button2') { header("Location: button2_page.php"); } ?> In this case its probably best to put this in the top of your page with the form and set the form action to: <form action="?" method="post"> Quote Link to comment https://forums.phpfreaks.com/topic/73938-solved-help-with-radio-buttons/#findComment-373090 Share on other sites More sharing options...
Leadwing Posted October 19, 2007 Author Share Posted October 19, 2007 Ah! Works a charm, thanks a lot Quote Link to comment https://forums.phpfreaks.com/topic/73938-solved-help-with-radio-buttons/#findComment-373093 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.