Ell20 Posted October 31, 2007 Share Posted October 31, 2007 Hey, Im attempting to create an OR statement so that only certain users will be able to see a certain option. Here is my code: if ($webtype == 'Cricket' || 'Football'){?> - Tennis users can still see the option - not working! I have also tried: if ($webtype == 'Cricket' | 'Football'){?> -Works as I want for Cricket (option visable) and Tennis (option not visable), however you cant see the option if Football Am I doing this wrong? Cheers Elliot Link to comment https://forums.phpfreaks.com/topic/75525-solved-php-or-statement/ Share on other sites More sharing options...
Orio Posted October 31, 2007 Share Posted October 31, 2007 You need to mention the variable twice: if ($webtype == 'Cricket' || $webtype == 'Football'){?> Orio. Link to comment https://forums.phpfreaks.com/topic/75525-solved-php-or-statement/#findComment-382077 Share on other sites More sharing options...
pocobueno1388 Posted October 31, 2007 Share Posted October 31, 2007 You need to mention the variable twice: if ($webtype == 'Cricket' || $webtype 'Football'){?> Orio. You forgot the '==' on the second one. if ($webtype == 'Cricket' || $webtype == 'Football'){?> Link to comment https://forums.phpfreaks.com/topic/75525-solved-php-or-statement/#findComment-382079 Share on other sites More sharing options...
Orio Posted October 31, 2007 Share Posted October 31, 2007 lol right, fixed thanks Orio. Link to comment https://forums.phpfreaks.com/topic/75525-solved-php-or-statement/#findComment-382081 Share on other sites More sharing options...
Ell20 Posted October 31, 2007 Author Share Posted October 31, 2007 Cheers guys, worked out needed the == when I got the parse error Link to comment https://forums.phpfreaks.com/topic/75525-solved-php-or-statement/#findComment-382084 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.