I
I
Ilya Famin2020-05-27 16:38:44
PHP
Ilya Famin, 2020-05-27 16:38:44

Work images from any directory of the site?

I have a file index.phpand others by type header.phpfooter.phpand I need the images specified in to header.phpfooter.phpwork and in index.php(these are different folders, there is a folder with articles and categories) tried through ../and /, ./does it work, is there any php property that specifies any folder as root

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Ukolov, 2020-05-27
@Fama18122000

What does "images worked" mean? If we are talking about the fact that they should be loaded in the browser, then they should lie inside the root directory that the web server serves. And the path must be absolute , starting from this directory.
PHP has absolutely nothing to do with it.

X
xmoonlight, 2020-05-27
@xmoonlight

Define your root variable in index.php and then write all paths (anywhere) relative to it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question