Absolute path to images
#1
Absolute path to images
I try show images with absolute path and all time don´t show images, with the same path read directory perfectly with php but don´t show images

My Example:

Quote:<img src="/var/sentora/hostdata/zadmin/public_html/website_com/images/image.jpg" />

I think the path is right, but the only problem is don´t show images, also read perfectly dir and the number of images inside but don´t show image, i disable open_dir_base for read directory in this domain, but how i tell don´t show images with src.

Thank´s in advanced for the help, regards.
Reply
#2
RE: Absolute path to images
(04-13-2023, 03:39 AM)franmm25 Wrote: I try show images with absolute path and all time don´t show images, with the same path read directory perfectly with php but don´t show images

My Example:


I think the path is right, but the only problem is don´t show images, also read perfectly dir and the number of images inside but don´t show image, i disable open_dir_base for read directory in this domain, but how i tell don´t show images with src.

Thank´s in advanced for the help, regards.

Websites can not use absolute paths for images or files in that manner.
You would need to do something like this: (recommended)
Code:
<img src="./images/image.jpg" />
or:
Code:
<img src="http://website.com/images/image.jpg" />

Also, if they are on different sites, then you will need to use the php function fopen or curl. Otherwise you will need to use JavaScript.
-TGates - Project Council

SEARCH the Forums or read the DOCUMENTATION before posting!
Support Sentora and Donate: HERE

Find my support or modules useful? Donate to TGates HERE
Developers and code testers needed!
Contact TGates for more information
Reply
#3
RE: Absolute path to images
(04-13-2023, 03:39 AM)franmm25 Wrote: I try show images with absolute path and all time don´t show images, with the same path read directory perfectly with php but don´t show images

My Example:


I think the path is right, but the only problem is don´t show images, also read perfectly dir and the number of images inside but don´t show image, i disable open_dir_base for read directory in this domain, but how i tell don´t show images with src.

Thank´s in advanced for the help, regards.

You can't use a path from the /var/ folder. It would be website.com/images/your image.jpg
Reply
#4
RE: Absolute path to images
(04-16-2023, 09:31 AM)TGates Wrote: Websites can not use absolute paths for images or files in that manner.
You would need to do something like this: (recommended) basketball stars
Code:
<img src="./images/image.jpg" />
or:
Code:
<img src="http://website.com/images/image.jpg" />

Also, if they are on different sites, then you will need to use the php function fopen or curl. Otherwise you will need to use JavaScript.

(11-20-2024, 11:19 PM)kevwebbie Wrote: You can't use a path from the /var/ folder. It would be website.com/images/your image.jpg

woww, what does /var/ mean?
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
only 10 images? Ron-e 3 12 ,438 08-21-2014, 01:10 AM
Last Post: TGates

Forum Jump:


Users browsing this thread: 1 Guest(s)