Ju5 Posted May 26, 2011 Share Posted May 26, 2011 if ($cartype = 1 ) { echo "Compact <br/>"; } elseif ($cartype == 2 ) { echo "Saloon <br/>"; } else if ($cartype == 3 ) { echo "SUV <br/>"; } This code will only display the first radio button atm. How do I fix this? Quote Link to comment https://forums.phpfreaks.com/topic/237563-php-radio-buttons/ Share on other sites More sharing options...
Maq Posted May 26, 2011 Share Posted May 26, 2011 You're assigning here NOT comparing: if ($cartype = 1 ) Besides, you have elseif statements, only one block will get executed. Quote Link to comment https://forums.phpfreaks.com/topic/237563-php-radio-buttons/#findComment-1220750 Share on other sites More sharing options...
fugix Posted May 26, 2011 Share Posted May 26, 2011 also, change the elseif's to simply if statements Quote Link to comment https://forums.phpfreaks.com/topic/237563-php-radio-buttons/#findComment-1220752 Share on other sites More sharing options...
Ju5 Posted May 26, 2011 Author Share Posted May 26, 2011 Oops Thanks guys, all fixed now! Quote Link to comment https://forums.phpfreaks.com/topic/237563-php-radio-buttons/#findComment-1220753 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.