Forum Moderators: coopster

Message Too Old, No Replies

include fails with query string

         

rainborick

3:06 am on Jan 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I've got a different issue with include(). My script fails with "failed to open stream: No such file or directory..." when the include URI has a query string, but it runs if I omit it. I've tried adding the path with set_include_path() just for drill, but it makes no difference. If it helps, allow_url_fopen is On.
Any help would be appreciated.

TheMadScientist

7:25 am on Jan 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Why do you need to include with a query_string when you can just set the variable?

$query='string';
include $_SERVER['DOCUMENT_ROOT'] . '/file.php';

Rather than:

include $_SERVER['DOCUMENT_ROOT'] . '/file.php?query=string';

Should work just fine...
If for some reason it does not I think you will need to use fopen()

rainborick

4:17 pm on Jan 4, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Obviously, I've been eating stupid food through the entire holiday season and have forgotten almost everything about programming. Thanks.

TheMadScientist

12:11 am on Jan 5, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



LOL... I do the same thing sometimes.
Glad you got it working...