Re: php includes and ajax [message #173103 is a reply to message #173087] |
Mon, 21 March 2011 12:43 |
Captain Paralytic
Messages: 204 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Mar 20, 10:16 pm, "John D'Orazio" <donjohn.f...@gmail.com> wrote:
> SNIPPED
> I'd like to understand better the principles behind this stuff though, if there is a standard
> way of doing the file includes that'll work on every server in ajax calls....
I am assuming that you (John D'Orazio) are also Lwangaman.
The first thing to do is to FORGET ABOUT AJAX!!! I am not saying this
because you should not use it, but because php knows nothing about
AJAX. The server does not know whether the request came from an AJAX
request or just someone typing the URL in a browser.
Next is that in general (IMHO) it is best to code your php such that
it uses relative paths. That way, all your main programs need to know
is what your application's file structure is and not what your hosting
server looks like.
|
|
|