Forum Moderators: coopster

Message Too Old, No Replies

Probably simple PHP print image

         

TymArtist

7:17 pm on Oct 13, 2005 (gmt 0)

10+ Year Member



So I've got my PHP working to pull records from a database based on what the user selects, and where I'm getting stuck is the image at the top of the page based and for each product based on what the user has selected

My code looks something like
if ($brand=='blah'){
$manulogo="blah.gif";
$path="images_products/blah/$tab_select"; }

and so forth..i named the function manu(); and then call it, where the $brand is from the users choice of type of product, $path is where the image is located on the local server, $manulogo is either supposed to be called inside the image in the HTML or printed in the function, and $tab_select sets what database the records are pulling from (which is also the same name of the image folders).

in the end, it ends up printing the alt text i defined for both the logo at the top of the page and the images on the side of the page. i'm hoping to just printf or echo something inside the function, but obviously it's not even picking up what i'm trying to tell it (a list of if functions...)

If you guys need more clarifcation I can provide it, and hopefully i'm communicating well enough for anyone besides me to understand lol.

whoisgregg

8:53 pm on Oct 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



For images, you should print/echo the path to the image inside of an <img /> tag, like so:

print '<img src="'. $path.'" />';