Location: PHPKode > projects > Lead Follow-Up Database > web/codelib/slib/CPath.inc.php
<?php
//=================================================================
// Lead Follow-Up Database
// Copyright (c) phpkobo.com ( http://www.phpkobo.com/ )
// Email : hide@address.com
// ID : LF201_107
//
// This software is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; version 2 of the
// License.
//
// [Installation Guide]
// http://www.phpkobo.com/doc.php?d=install&p=LF201_107
//
//=================================================================

//----------------------------------------------------------------
// CPath
//----------------------------------------------------------------
class CPath
{
	function ThisFileUrl()
	{
		return $_SERVER['PHP_SELF'];
	}

	function ThisFileName()
	{
		$path = CPath::ThisFileUrl();
		$pos = strrpos( $path, '/' );
		return substr( $path, $pos+1 );
	}

	function ThisFolderUrl()
	{
		$path = CPath::ThisFileUrl();
		$pos = strrpos( $path, '/' );
		return substr( $path, 0, $pos+1 );
	}

	function ThisFilePath()
	{
		if ( isset( $_SERVER['SCRIPT_FILENAME'] ) )
			$path = $_SERVER['SCRIPT_FILENAME'];
		else
			$path = $_SERVER["PATH_TRANSLATED"];

		return str_replace( "\\", '/', $path );
	}

	function ThisFolderPath()
	{
		$path = CPath::ThisFilePath();
		if (( $pos = strrpos( $path, '/' ) ) !== false )
			return substr( $path, 0, $pos+1 );
		else if (( $pos = strrpos( $path, "\\" ) ) !== false )
			return substr( $path, 0, $pos+1 );
		else
			return $path;
	}
}

?>
Return current item: Lead Follow-Up Database