|
Author |
Message |
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Tue Jun 10, 2003 2:20 pm (21 years ago) |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jun 10, 2003 2:53 pm (21 years ago) |
|
You can't include a file with ?querystring=whatever in it.
You have to set the variable in PHP. |
________________________________
|
|
|
|
Justin
4WebHelp Addict
Joined: 07 Jan 2002
Posts: 1060
|
Posted:
Tue Jun 10, 2003 2:55 pm (21 years ago) |
|
But you can with a full URL which PHP.net removed from PHP 4.3.2, it's so stupid. |
|
|
|
|
Daniel
Team Member
Joined: 06 Jan 2002
Posts: 2564
|
Posted:
Tue Jun 10, 2003 3:00 pm (21 years ago) |
|
It's not stupid. PHP is opening a file, bypassing "the Internet", and thus bypassing Apache at the same time, so it cannot pass a query string.
Include()ing a URL is wasteful, since the file is sitting right there on the website . [I was doing that on a few forum related files at 4WebHelp until I realised how silly it was (and got fed up of this server being the first host in our stats ] As to removing the possibility of including a URL, that may be stupid - I haven't looked into it .
http://www.php.net/include/ wrote: | // Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.
include 'file.php?foo=1&bar=2';
|
|
________________________________
|
|
|
|
jayant
Team Member
Joined: 07 Jan 2002
Posts: 262
Location: New Delhi, India
|
Posted:
Tue Jun 10, 2003 7:26 pm (21 years ago) |
|
No it's not disabled in 4.3.2 , i just tested it with it.
From MAN:
============
Warning
Windows versions of PHP prior to PHP 4.3.0 do not support accessing remote files via this function, even if allow_url_fopen is enabled.
Example 12-5. include() through HTTP
Code: | <?php
/* This example assumes that www.example.com is configured to parse .php *
* files and not .txt files. Also, 'Works' here means that the variables *
* $foo and $bar are available within the included file. */
// Won't work; file.txt wasn't handled by www.example.com as PHP
include 'http://www.example.com/file.txt?foo=1&bar=2';
// Won't work; looks for a file named 'file.php?foo=1&bar=2' on the
// local filesystem.
include 'file.php?foo=1&bar=2';
// Works.
include 'http://www.example.com/file.php?foo=1&bar=2';
$foo = 1;
$bar = 2;
include 'file.txt'; // Works.
include 'file.php'; // Works.
?> |
=============== |
________________________________ Jayant Kumar
Member of the 4WebHelp Team
Nibble Guru - Computing Queries Demystified
GZip/ Page Compression Test |
|
|
|
|
|
You cannot post new topics in this forum. You cannot reply to topics in this forum. You cannot edit your posts in this forum. You cannot delete your posts in this forum. You cannot vote in polls in this forum.
|
Page generation time: 0.121785 seconds :: 17 queries executed :: All Times are GMT
Powered by phpBB 2.0
© 2001, 2002 phpBB Group :: Based on an FI Theme
| |