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? 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. 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 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! Link to comment https://forums.phpfreaks.com/topic/237563-php-radio-buttons/#findComment-1220753 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.