Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Image Paths

Status
Not open for further replies.

tleish

Programmer
Jan 17, 2001
619
US
I have a global variable set on a PHP site that establishes a path to the image directory.

<?
// Global Image Directory Path
$img_root = &quot;/test/images&quot;;
?>

Why is it when I reference this image path to display my images...

<IMG SRC=&quot;<? echo &quot;$img_root/myimage.jpg&quot; ?>&quot; ALT=&quot;My Image&quot; BORDER=&quot;0&quot;>

...that often 1 or 2 of them appear to be broken. And they randomly change if you refresh the page. If they are broken, in IE you can right click on them and choose &quot;Show Image&quot; and the image will then appear. So the path is correct, but somehow it's not showing it.

Is there a trick to avoid this or is there something I'm doing wrong? I don't have this same problem when I use dynamic image paths in ColdFusion or ASP, so I know it has something to do with PHP and not the browser or server.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top