Need function help... I am stuck on printing an image
Posted: Sun Sep 07, 2003 3:53 pm
Ok, I am trying to write a function that will take the current page via a $PHP_SELF and then print a specific image that is unique for that page on that page. What this is being used for is to give the user some idea where they are on the site via a image between the top image and the content below. I have attmpted to write a function, but I must say I am not well versed in their doing. So, please offer any help to get me on the right path. What I have attempted so far is below.
There will be multiple pages that this is for, but I am just working on getting it to work for one at the moment. Also, I don't know an easy way to get just the index.php from a $PHP_SELF so, that is why I have the $rootpath."test.php" garbage.
Called by:
There will be multiple pages that this is for, but I am just working on getting it to work for one at the moment. Also, I don't know an easy way to get just the index.php from a $PHP_SELF so, that is why I have the $rootpath."test.php" garbage.
Code: Select all
<?php
function print_pagetitle($loaded_page){
$root_path = "/clanuw_v2/";
if($loaded_page == $rootpath."test.php"){
echo "<img src="images/news.gif" width="950" height="65" alt="Page Image">";
return;
}
}
?>Code: Select all
<?php print_pagetitle($PHP_SELF); ?>