Jump to content

[SOLVED] Analyze current URL for a directory?


tmallen

Recommended Posts

you can find the current page like this

<?php
## this line will return the current page ::
$pageName=basename($_SERVER['PHP_SELF'] );

## this will search filename in current directory 
$filename = $pageName;

if (file_exists($filename)) 
{
   	echo "The file $filename exists";
} 
else 
{
    echo "The file $filename does not exist";
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.