|
Posted by Justin Koivisto on 01/10/06 19:56
Oli Filth wrote:
> Justin Koivisto said the following on 10/01/2006 14:57:
>
>> Oli Filth wrote:
>>
>>> include("http://remote.server.example.com/script.php?host=http://local.example.com/mainscript.php");
>>
>> Out of curiosity, does the $_GET array actually get populated with
>> values sent in this way for the remote script?
>
> Yes. The receiving remote server doesn't care (or know) where the HTTP
> request for script.php came from, so it acts exactly as if someone had
> requested that URL from their browser.
I'll have to keep that in mind next time I consider using curl for a
simple get request...
>> I know that if you do something like:
>> include 'myfile.php?var=val1';
>>
>> That php looks for a file with that exact name (which will not exist in
>> most cases). Therefore in order to make that work (locally anyway),
>> you'd need to set the variable before the file was included.
>
> Well yes, because "?var=var1" is meaningless in a local filesystem.
> Setting the local variable works because both scripts are being run
> locally in the same PHP instance.
That's what I was trying to explain. When I first started php (many
years ago), I learned that while experimenting with different things.
One of these days I'll get my site together that I plan to use for
articles and such like that. ;)
--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
[Back to original message]
|