display diff img per page using templete

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
seeker2921
Forum Contributor
Posts: 120
Joined: Sat Mar 22, 2003 7:10 pm
Location: Wiesbaden Germany
Contact:

display diff img per page using templete

Post 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; 
        } 
    } 
} 

?>
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post 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..
seeker2921
Forum Contributor
Posts: 120
Joined: Sat Mar 22, 2003 7:10 pm
Location: Wiesbaden Germany
Contact:

Post 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..
Post Reply