Jump to content
Sign in to follow this  
divinedesigns1

how to detect which page im on

Recommended Posts

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?

Share this post


Link to post
Share on other sites

thanks

Share this post


Link to post
Share on other sites

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/>";	
	?>

 

Share this post


Link to post
Share on other sites

That provides information about the current PHP file that's running, but says nothing about what URL the user is currently visiting.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...