dennismonsewicz Posted September 25, 2008 Share Posted September 25, 2008 I am wanting to grab the name of the page that a user is on. I want to achieve this so I can write an if statement that says if you are on this page then run this particular code. Any ideas on how to do this? Link to comment https://forums.phpfreaks.com/topic/125810-solved-quick-question/ Share on other sites More sharing options...
JonnoTheDev Posted September 25, 2008 Share Posted September 25, 2008 print $_SERVER['SCRIPT_FILENAME']; Link to comment https://forums.phpfreaks.com/topic/125810-solved-quick-question/#findComment-650531 Share on other sites More sharing options...
nadeemshafi9 Posted September 25, 2008 Share Posted September 25, 2008 if(ereg("index.php", $_SERVER['PHP_SELF'])) echo "i am on index.php"; Link to comment https://forums.phpfreaks.com/topic/125810-solved-quick-question/#findComment-650532 Share on other sites More sharing options...
dennismonsewicz Posted September 25, 2008 Author Share Posted September 25, 2008 Sweet it worked! Thanks! Link to comment https://forums.phpfreaks.com/topic/125810-solved-quick-question/#findComment-650537 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.