Jump to content

foreach() help


calvin182

Recommended Posts

I have an array called $db, the keys are filled with date/times and the values are filled with an image name (in this case: header_720x95_01.png). I have the path of the images set as $images.My problem is when I use foreach(), it is adding an additional path of

http://www.domain.com/folder/gallery/admin/

infront of the $images.$value2 causing my image source to look like

http://www.domain.com/folder/gallery/admin/www.domain.com/folder/gallery/images/main/header_720x95_01.png

. I am thoroughly frustrated with this, can anybody help? Here is the code:

foreach ($db as $key2 => $value2) {     echo "<img src=\"".$images.$value2."\"/><br/>image: $value2<br/>uploaded: $key2<br/><a href=\"remove.php?key=$key2&value=$value2\" title=\"remove this image\">remove this image</a><br/><br/>";}

Any help would greatly be appreciated! Thank you :) Ps. sorry about the urls in the code boxes, the long one was getting truncated.

Link to comment
Share on other sites

i have a title tag in my a tag because it will pop up a little tool-tip type thing about the text on mouseover. I also do this with images, because useing just the alt tag does not popup text in firefox, but it does in ie, so i use both. Or, if i dont want my image to show the tooltip in ie, i add a blank title tag so nothing pops up.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...