divinedesigns1 Posted October 22, 2017 Share Posted October 22, 2017 hey so i had this topic up here before but cant find it. does anyone know how i can go about detecting the webpage im on using php? Link to comment Share on other sites More sharing options...
Don E Posted October 22, 2017 Share Posted October 22, 2017 Check out some of the $_SERVER vars: http://php.net/manual/en/reserved.variables.server.php Link to comment Share on other sites More sharing options...
divinedesigns1 Posted October 22, 2017 Author Share Posted October 22, 2017 thanks Link to comment Share on other sites More sharing options...
johnniewalk Posted October 27, 2017 Share Posted October 27, 2017 Thanks for the link Link to comment Share on other sites More sharing options...
codeminer Posted November 6, 2017 Share Posted November 6, 2017 you can try this <html> <head></head> <title>File System Basics</title> <h1>File System Basic</h1></div> <?php /*this will echo out the fullpath and file name if it exsist*/ echo "<i><b>This Is The File Name And Locations 'AKA' fullpath.</b></i><br/>"; echo __FILE__."<br/><hr/>"; /*this echos out the directory name if it exsist*/ echo "<i><b>These Are The Directory Names Where The File Lives</b></i><br/>"; echo __DIR__."<br/><hr/>"; /*this will echo out the directory name and file name if it exsist*/ echo"<i><b>Does File Exsit?.</b></i><br/>"; echo file_exists(__FILE__)? 'yes':'no'; echo"<br/><hr/>"; echo"<i><b>does the directory include the file basic.html?.</b></i><br/>"; echo file_exists(dirname(__FILE__)."/basic.html")?'yes' : 'no'; echo"<br/><hr/>"; echo"<i><b>Does the file Exsist?.</b></i><br/>"; echo is_file(dirname(__FILE__)."/basic.html")? 'yes' : 'no'; echo"<br/><hr/>"; echo"<i><b>Is File A Directory Name ?.</b></i><br/>"; echo is_file(dirname(__FILE__))? 'yes' : 'no'; echo"<br/><hr/>"; echo"<i><b>is Directory A File Name ?.</b></i><br/><br/>"; echo is_dir(dirname(__FILE__). "/basic.html")? 'yes' : 'no'; echo"<br/><hr/>"; echo "<i><b>Is .. A directory</b></i><br/>"; echo is_dir('..')? 'yes' : 'no'; echo"<br/><hr/>"; /*this will echo out the number of lines being used*/ echo"<i><b>How Many Line Are In File Basic.php Right Now.</b></i><br/>"; echo __LINE__."<br/><hr/>"; ?> Link to comment Share on other sites More sharing options...
Ingolme Posted November 6, 2017 Share Posted November 6, 2017 That provides information about the current PHP file that's running, but says nothing about what URL the user is currently visiting. Link to comment Share on other sites More sharing options...
codeminer Posted November 6, 2017 Share Posted November 6, 2017 sorry misundestood Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now