<?
$currentFile = $_SERVER["SCRIPT_NAME"];
$parts = Explode('/', $currentFile);
$currentFile = $parts[count($parts) - 1];
if($currentFile == 'admin.php') {
//put JS code here
}
?>
Instead we can use simply:
$currentFile=basename($_SERVER['PHP_SELF']);
Shanti C
Posting Virtuoso
1,642 posts since Jul 2008
Reputation Points: 137
Solved Threads: 162