Seth Willits wrote:

Is there anyway to get an absolute URL to work with Require & Include? Why doesn't it work already? I did see the tip about using $_SERVER, but this slows down page-loading considerably.


You can use URLs in your include() or require() calls.

include("http://www.google.com";);

But... if you try to include a .php page this way, you will get the RESULT of the PHP file being RUN by the server... not the PHP code. Now, if you have an "include.inc" page on another server that is actually PHP code, I guess you could include it using something like the above and it'll be run as PHP code within your script.

If you're talking about an absolute PATH, then, yes, that works too:

include('/var/www/site/mine/html/htdocs/sub/dir/include.php');

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to