Connecting Tech Pros Worldwide Help | Site Map

Problems with images -- newbee

Newbee
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi !
Let's say that this is the folder on the server:
/web/firstDir/secondDir/images/image.gif
where i have stored my pictures. I have tryed with apsolute and relative
paths but i can't display images....

If i right click on the image the whole path is displayed on this way:
http://www.test.com/Dir1/Dir2/Dir3/w...ages/image.gif

Should i define global variables(?) or how to solve this....

thanx in advance



Andy Hassall
Guest
 
Posts: n/a
#2: Jul 17 '05

re: Problems with images -- newbee


On Sat, 12 Feb 2005 15:57:09 +0100, "Newbee" <phpAK@gtxmail.com> wrote:
[color=blue]
>Let's say that this is the folder on the server:
>/web/firstDir/secondDir/images/image.gif
>where i have stored my pictures. I have tryed with apsolute and relative
>paths but i can't display images....
>
>If i right click on the image the whole path is displayed on this way:
>http://www.test.com/Dir1/Dir2/Dir3/w...ages/image.gif
>
>Should i define global variables(?) or how to solve this....[/color]

Looks like you're probably missing a leading slash, or doing something else
wrong, hard to tell without some code.

--
Andy Hassall / <andy@andyh.co.uk> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
Newbee
Guest
 
Posts: n/a
#3: Jul 17 '05

re: Problems with images -- newbee


Looks like you're probably missing a leading slash, or doing something else
wrong, hard to tell without some code.
****

This is the code part for the image ( this is document_root version):
<?php
print("<img src='" . $_SERVER['DOCUMENT_ROOT'] .
"/web/firstDir/secondDir/images/image.gif" );
?>

but i have tryed with

<?php
print("<img src='" . $_SERVER['DOCUMENT_ROOT'] .
"/firstDir/secondDir/images/image.gif" );
?>

but with no success...


Jerry Stuckle
Guest
 
Posts: n/a
#4: Jul 17 '05

re: Problems with images -- newbee


Newbee wrote:[color=blue]
>
> Looks like you're probably missing a leading slash, or doing something else
> wrong, hard to tell without some code.
> ****
>
> This is the code part for the image ( this is document_root version):
> <?php
> print("<img src='" . $_SERVER['DOCUMENT_ROOT'] .
> "/web/firstDir/secondDir/images/image.gif" );
> ?>
>
> but i have tryed with
>
> <?php
> print("<img src='" . $_SERVER['DOCUMENT_ROOT'] .
> "/firstDir/secondDir/images/image.gif" );
> ?>
>
> but with no success...[/color]

An img tag is already relative to the document root. Don't add it
again.



--

To reply, delete the 'x' from my email
Jerry Stuckle,
JDS Computer Training Corp.
jstucklex@attglobal.net
Member of Independent Computer Consultants Association - www.icca.org
Closed Thread