Page 1 of 1

display diff img per page using templete

Posted: Sat Jan 31, 2004 5:13 pm
by seeker2921
I have my index.php setup as a templete for the rest of the site using isset example of the coded below.. and I want to display an image in the templete but have the image change for each page so how would I go about doing that? (not radom images either preset ones for each page)

Index.php - isset example

Code: Select all

<?
if(!isset($id)){
include('/home/oblivion/public_html/site/home/index.php');
} 
else 
{ 
    for($i=0; i<count($links); $i++) 
    { 
        if($id==$links[$i]) 
        { 
            include($url[$i]); 
            break; 
        } 
    } 
} 

?>

Posted: Sat Jan 31, 2004 7:22 pm
by d3ad1ysp0rk
imgs:
links_main.jpg
links_contact.jpg
links_links.jpg
contact_main.jpg
contact_contact.jpg
contact_links.jpg
main_links.jpg
main_main.jpg
main_contact.jpg

then

Code: Select all

echo "<img src="imgs/main_" . $page . ".jpg">";
echo "<img src="imgs/contact_" . $page . ".jpg">";
echo "<img src="imgs/links_" . $page . ".jpg">";
not sure if thats what you wanted..

Posted: Sat Jan 31, 2004 10:00 pm
by seeker2921
No, That wasn't it.. I got it figuared out.. After re reading my post on here and seeing that what I said doesn't explain what I was looking for I realized what I needed to do in order to get what I wanted so I did it and it works now.. (atleast what little i've tested it works) Thanks for trying to help me though.. It was rather simple to get done.. Thanks again..