Return to Snippet

Revision: 17323
at September 1, 2009 04:14 by scopefragger


Initial Code
//////////////////////////////////////////////
//	1. | Get Page user is currently on
//////////////////////////////////////////////
//	1.1 Code
//////////////////////////////////////////////
	function curPageName() {
	 return substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
	}	
	
//////////////////////////////////////////////
//	1.2 Set Value as varable
//////////////////////////////////////////////
	
	$Current_page=curPageName();

Initial URL
http://www.scopesden.co.uk/code_snipit.php?id=

Initial Description
Ever needed to get the page your user is currently viewing?  This can be done quickly in php all thanks to $_server.

Initial Title
Getusers current page

Initial Tags
page, user

Initial Language
PHP