0

I have a question on folder and file links.

Here's my folder structure:

--------------------root--------------------

------------project01----------------------|----------project02------------------folder level 1

p1.html---CSS--JS--PHP---Config---|--p2.html---CSS--JS--PHP-----folder level 2

----------css1---js1---php1---config---|--------------css2---js2---php2-----file level

I know how to link css1 and js1 to p1.html. But I don't know how to link php1 to js1 which has ajax. So up a folder then go into PHP folder. Also, php1.php includes config.php. Basic relationship is p1.html->js1.js->php1.php->config.php

There are what I have tried for the ajax url:

url : "../project01/php/php1.php" url : "/project01/php/php1.php" url : "project01/php/php1.php"

And none worked. Only way I can get it to work is by putting the php files in the project01 folder where the index1.html is, and just call

url : "php1.php"

Also, what if I want to link css1 to p2.html? How do I do that?

DarkBee
  • 16,592
  • 6
  • 46
  • 58
J13t0u
  • 811
  • 1
  • 8
  • 19
  • I think This is very properly explained here : http://stackoverflow.com/questions/908765/how-to-link-html-pages-in-same-or-different-folders Please Comment if you still did not find your answer. If I am not mistaken , this will go up a directory and then back down to another subfolder. url: "../php/php1.php" – izk Feb 19 '16 at 15:32
  • I tried swagers's answer, but didn't work. Maybe something else went wrong. I'll try some more then. Also, maybe I'm confused on where the reference happens. If my php files are in the same folder with the index.html, js files are in the js folder. js file is linked in the index.html, and instead to get the php file from js, I can't call up a folder, into where the php file is (../php1.php), instead, I just do php1.php, and this works. So how is this structured? – J13t0u Feb 19 '16 at 15:35
  • what if you try url: "../php/php1.php" – izk Feb 19 '16 at 15:39
  • It worked, I must have mixed things up last night when I tried it. Head wasn't straight. – J13t0u Feb 19 '16 at 15:50
  • haha , we all have that. Sometimes a break is neccesary. Good luck further. – izk Feb 19 '16 at 15:51

1 Answers1

0

This should work :

url : "../PHP/php1.php"

To link css1 to p2.html

url : "../project01/CSS/css1.css"
Munawir
  • 3,346
  • 9
  • 33
  • 51