$variable="blah"; include("file.php"); ?> Code (markup): this works, allowing the included file to use the variable $variable but, I changed my include path to another directory: $variable="blah"; include("http://www.site.com/directory/file.php"); ?> Code (markup): and it no longer works....$variable isn't recongized. Could this be resolved, and how can I refer to other folders above the current directory using a local path not using http://
Reference the file with the file path, not a URL. Doing it as a URL isolates it into it's own script. You would need to know the full path on the server... could be something like: /home/sites/site1/www/file or something along those lines.
this is a long shot, but try include '/directory/file.php'; or include 'directory/file.php'; http://ca.php.net/manual/en/function.include.php
I think, in general, if file.php is not in your server, you CANNOT do it. Because when you request a PHP file from an URL, the server will process that file and return the output. If I am not right, so I can easily hack other site by inlcude("http://www.theirserver.com/include.inc.php") PHP:
Is this correct? I have this issue here: http://forums.digitalpoint.com/showthread.php?t=7795 and this answer might solve my problem. But isn't there a better way to include output from a different page? I basically ned to scrape a file's output.
oh, even more help in case i want to see some variables. I forgot to mention that shawn's solution did work, just use a local path.