Hi
I read it in the manual somewhere.
By using [url]http://[/url] or just www., etc in the file address, you cause php to ask apache for an external connection. That goes out to the web, and comes back in again. Apache will be set to block read requests for php files (it will only parse them for delivering html back).
Imagine you are in your house. Write a letter to your brother in the room next to you. Put a stamp on it, take it to the postbox. Postman collects it, takes it to the sorting office. Comes back next day, through letterbox. Brother gets it, treats it as junkmail and bins it.
Alternatively, walk to his room and give it to him, and because he can see it was you who wrote it, he reads it.
In my opinion, the php manual is lacking here. It ought to suggest includes always use the internal route unless calling an external script, which would probably not be possible due to security measures on the other server anyway.
All file opeing read calls have the same problem. Your major problem is if you develop a script locally to publish later. The $root variable would be different. I get round this by setting a config file to include in all my php files at the top. The file contains this code:
<?php
if (strtolower($_SERVER['DOCUMENT_ROOT'])=="d:/apache/htdocs/my_website")
{
//root to css, images, html, php (for includes) and java
$phpincRoot="d:/apache/htdocs/my_website";
$root_url="d:/apache/htdocs/my_website";
//root to php files for parsing (user to see resulting page)
$root_alturl="http://localhost:8080";
}
else
{
//root to css, images, html, php (for includes) and java
$phpincRoot="/home/******/public_html";
$root_url="http://www.yourweb.com";
//root to php files for parsing (user to see resulting page)
$root_alturl="http://www.yourweb.com";
}
Trevor