jjmusicpro Posted January 23, 2008 Share Posted January 23, 2008 i am passing a varaiable in the url groupid= i only wanted to display a picture when a certain groupid was passed, and not display when a different id for some reason it always shows... <?php $groupid_sent = $_GET['groupid']; if($groupid_sent = '10') { echo '<img src="bestOfSeattle2007.jpg">'; } else { // echo nothing Nothing } ?> Quote Link to comment https://forums.phpfreaks.com/topic/87424-if-else-statement/ Share on other sites More sharing options...
revraz Posted January 23, 2008 Share Posted January 23, 2008 Use == not = if($groupid_sent == '10') Quote Link to comment https://forums.phpfreaks.com/topic/87424-if-else-statement/#findComment-447135 Share on other sites More sharing options...
jjmusicpro Posted January 23, 2008 Author Share Posted January 23, 2008 Use == not = if($groupid_sent == '10') perfect! worked thanks! Quote Link to comment https://forums.phpfreaks.com/topic/87424-if-else-statement/#findComment-447138 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.