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 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. 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":""; ?> 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 } ?> 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
Archived
This topic is now archived and is closed to further replies.