Making php includes work in a sub-directory -


OK, I'm creating an admin interface for my custom blog on url / admin.

Is it possible that I be able to use the same (as autoload) root directory?

If possible, I would like to be able to automatically correct the link in navigation so that they

thank you, nico

< The best practice for this is to define an 'ABSOLUTE_PATH' consistency in which the directory contains everything below. situated at. After that, you can only copy and paste everything, because it is defining the 'complete' path, which does not change from directory to directory.

Example

  Define ("ABS_PATH", $ _SERVER ['DOCUMENT_ROOT']); Or defined ("ABS_PATH", dirname (__ FILE__)); // This defines the path as the directory in the directory.  

Then at any point you can do this to include a file

  Include (ABS_PATH. "/ Path / copy / file" );  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -