Darkwoods Posted October 9, 2008 Share Posted October 9, 2008 how do you write this type of code echo only in id[3] echo 'this'; if on different id do not echo for example if i am on myfile.php?id=3 Quote Link to comment https://forums.phpfreaks.com/topic/127777-solved-echo-only-if-id-page-is-open/ Share on other sites More sharing options...
F1Fan Posted October 9, 2008 Share Posted October 9, 2008 Like you said, just use an if statement. Quote Link to comment https://forums.phpfreaks.com/topic/127777-solved-echo-only-if-id-page-is-open/#findComment-661418 Share on other sites More sharing options...
R0bb0b Posted October 9, 2008 Share Posted October 9, 2008 or <?php echo !empty($_GET['3'])?"this":""; ?> Quote Link to comment https://forums.phpfreaks.com/topic/127777-solved-echo-only-if-id-page-is-open/#findComment-661419 Share on other sites More sharing options...
redarrow Posted October 9, 2008 Share Posted October 9, 2008 <?php if($_GET['id']=="3"){ // code }else{ // error code } ?> Quote Link to comment https://forums.phpfreaks.com/topic/127777-solved-echo-only-if-id-page-is-open/#findComment-661420 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.