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? Quote Link to comment Share on other sites More sharing options...
JonnoTheDev Posted September 25, 2008 Share Posted September 25, 2008 print $_SERVER['SCRIPT_FILENAME']; Quote Link to comment 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"; Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted September 25, 2008 Author Share Posted September 25, 2008 Sweet it worked! Thanks! Quote Link to comment 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.