Forum Moderators: coopster

Message Too Old, No Replies

Show picture associated with query

         

skoff

12:23 am on Nov 17, 2008 (gmt 0)

10+ Year Member



Hi,
I want to know if it's to possible to show a picture on the same page as the information i want to show. For example if i click to my link test.php?categorie=boys when they show me the list of all the boys I have I want to have a picture on my page that represent all the boys. If i click to my link test.php?categorie=girls i want to have a picture on my page of that represent all the girls. I dont want to have a picture for each member. Just one picture for all the girls and one for the boys is it possible?

Anyango

4:19 am on Nov 17, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes it is,

lets say the picture for girls was named girls.jpg and for boys it was named boys.jpg and the pictures were in same folder as your test.php
Then you can use this code to put the picture anywhere you want it

$picture=$_GET['categorie'].".jpg";
echo "<img src='$picture'>";

Ofcourse we can add some if/else checks for the correct category names but this should basically get you going

[edited by: Anyango at 4:19 am (utc) on Nov. 17, 2008]

skoff

2:01 pm on Nov 17, 2008 (gmt 0)

10+ Year Member



i tried the code but i didnt see any change?

daveginorge

8:22 am on Nov 18, 2008 (gmt 0)

10+ Year Member



How about posting the code you are using...