PDA

View Full Version : I need help with a simple php function


Selena
February 3rd, 2007, 06:24 PM
I'm trying to display a graphics page. But i want to have a title for each graphic. The graphics are coded using php functions, and I was thinking if I named the files like Darth_Vader (if the graphic invloved Darth Vader), then i could have the title be Darth Vader...

I was trying to use something like $filename but it didn't seem to work, any chance anyone could help me. PM me i you'd like to see the actual site in action and what I'm talking about. But basically what i'd had was <div class="head"><?php echo $filename;?>Myspace Graphic</div>
And it didn't show the name, only the myspace graphic. I figured i'd have to define $filename but i'm not sure how.

rob
February 3rd, 2007, 06:58 PM
shoot me a PM with the URL to the page and i'll see if i can help. it would also help if you tell me how you're retrieving each graphic file (i.e: is all information related to each graphic stored in a database, such as the locaiton of the graphic, or are the graphics just in a directory and your PHP script just scans the directory for image files and displays them in a <img> tag?).

Jordan
February 3rd, 2007, 11:51 PM
Selena I finished editing the file for you, I've added the title tag and alt tag options, so where you can put the site name, theres another option below it (ie. $titletag) where you can put whatever and that will be put in the code of every graphic on that page. For example, you had 'baby girl' glitters, you could put $titletag = 'Baby Girl Glitters at Myspace-Lyts.Com'; and those words would be in the title tag of every 'baby girl' glitter code and the preview image.