How to make two different folder get resources from one folder?

Hansmagz

I have a dynamic about page

<section class="page">

<header style="background-image: url('uploads/<?php echo $page[header_picture]; ?>'); background-position: center;"></header>

<div class="container">

    <?php echo $page['body_formatted']; ?>

</div>

and the Admin page

They both have same the same src

uploads/1473747556216.jpg

but my admin page are in a Admin folder.

How to make two different folder get resources from one folder?

Robert Wade

Each file would need to either provide an absolute or relative path to the source file.

If your directory structure is:

root
    about.php
    admin
        admin.php
    uploads
        1473747556216.jpg

Then relative paths would be:

"uploads/1473747556216.jpg" // from about.php
"../uploads/1473747556216.jpg" // from admin.php

Then absolute paths would be:

"http://whatever.com/uploads/1473747556216.jpg" // for either file

Then relative from root (if supported in your environment):

"/uploads/1473747556216.jpg" // from either file

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to Properly Get a File from resources Folder

How to delete one file from a folder, if two files with the same name and different ending exist in the same folder?

Get folder from Resources folder JAVA

How to read two files from one folder?

Compare two folders, copy files that are different from one folder to another

How to correctly get image from 'Resources' folder in NetBeans

How to get resources folder(files) from other maven module?

how to get list of all files from folder inside java resources folder

Get image from resources folder - Laravel

How do I sync two folders using bash so a change in one folder gets reflected in a different folder?

How To Copy Permission From One Folder To Another With Different Contents

How best to access a file from resources folder

how to separate and copy csv files from one folder to different folder depending on some condition

How to make a folder in one svn repo inherit from another folder in another svn repo

How to get all text files from one folder using Java?

Flutter How to get all files from assets folder in one List

How to access resources file (css, js files from theme folder) and get link from FTL?

(Swift) How to make subfolders in one folder

How to make a reference to a .wsdl file in src/main/resources folder?

Is there a way to get Folder object from ListItem one?

how to make ajax request to get the two different view in one template

cannot get folder from src/main/resources Java project Maven

JSP page is not able to get the Bootstrap files from the resources folder -IntelliJ

How can I move an image from one folder to another folder?

How to copy zipfile from one folder to another folder using Python

How to copy one hundred files from folder to folder?

Zip folder from resources into jar

JavaFX Image from resources folder

Make one website look as if it were in a folder of a different website