Paths when both including and requesting AJAX

Posted by Cristian on Stack Overflow See other posts from Stack Overflow or by Cristian
Published on 2010-04-21T12:08:13Z Indexed on 2010/04/21 12:13 UTC
Read the original article Hit count: 188

Filed under:
|
|
|
|

I was wondering if there is a way of making a relative path to the main folder (where the index.php lies) from every file that needs to be included or requested by AJAX.

I want to combine both AJAX and PHP include so first time the page loads with PHP, and then to be able to refresh parts of the page with AJAX, but the files are the same and lie in subfolders.

I'm having problems with the path and although I can set an absolute path, then I have to change it every time the server changes. I want a relative path to where my project is, but not DOCUMENT_ROOT, because that one doesn't work with aliases. (or do you know how to make it work with aliases? )

Thanks !

© Stack Overflow or respective owner

Related posts about php

Related posts about AJAX