Hello-
I have a script that will display a specific image image based on what the directory name is.
What I need is to have the image display in directories contained in the root directory such as "Perkins", that all pages in all folders under Perkins will display that image.Here is what I have so far:
<?php
function this_folder_name($path){
if (!$path){$path=$_SERVER['PHP_SELF'];}
$current_directory = dirname($path);
$current_directory = str_replace('\','/',$current_directory);
$current_directory = explode('/',$current_directory);
$current_directory = end($current_directory);
return $current_directory;
}
#print this_folder_name();
if (this_folder_name() =='perkins')
{
$display = "<img src=\"../images/cte_header12.jpg\" alt=\"Perkins Header\">";
}
elseif (this_folder_name() =='aboutus')
{
$display = "<img src=\"../images/cte_header20.jpg\" alt=\"About Us Header\" >";
}
elseif (empty($current_directory))
{
$display = "<img src=\"../images/cte_header10.jpg\" alt=\"CTE Header Image\" >";
}
echo $display;
?>
Any help would be awesome.
Thanks-
Cletus