![]() |
|
||
|
|
|
||
|
|
|||
|
|
|||||||
| Notices |
| Legacy Archived Main Board Business chat and general industry chat. All participation is welcome. Dont post your fucking spam here. |

|
|
Thread Tools | Display Modes |
|
|
#37 | |
|
Members
Join Date: Apr 2005
Posts: 157
|
Quote:
There are times when it's advisable to have php includes outside of the web root (usually /html/), so you can only include it like: include("/home/path/to/file"); ?> Most common these days is to slap it in a folder inside the web root, so you can use relative or absolute linking as you would any other file on the server. Relative: include("/path/to/file"); ?> Absolute: include("http:www.domain.com/path/to/file"); ?> (NB: this will allow it to be linked to from *any* domain, on-server or off-server - it can cause probs because php can only handle a certain amount of full URL connections). If you have multiple domains on a server but only want to have one folder serving all the includes, you can either call it all from one location (/home/path/to/file) or you can be sneaky and alias /symlink a folder so it can be relative across all domains. You can do this in htaccess but it's better to alias stuff in apache config. EG in your html you'd include "/includefolder/file" which would to all intents and purposes be served from domain.com/includefolder/file but in reality is served from /some/other/location/includefolder/file |
|
|
|
|
| Bookmarks |
|
|