Re: require with $_GET parameters
From: Paul Barfoot (Paul_at_theglobalfamily.fsworld.co.uk)
Date: 10/03/04
- Previous message: Kurt Krueckeberg: "php-base mailing list manager"
- In reply to: Paul Barfoot: "Re: require with $_GET parameters"
- Next in thread: Er Galv?o Abbott: "Re: require with $_GET parameters"
- Reply: Er Galv?o Abbott: "Re: require with $_GET parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 3 Oct 2004 21:43:46 +0100
Apologies - part of the previous message should have been changed to read:
If I call inc_test.php in my browser everything works fine and the letter A
is displayed but if I remove the full URL path from inc_test.php i.e.
<?
include("inc_test2.php?letter=A");
?>
--
Paul Barfoot
"Paul Barfoot" <Paul@theglobalfamily.fsworld.co.uk> wrote in message
news:cjpkc8$vml$1@newsg1.svr.pol.co.uk...
> No different ideas, just more of the same!
>
> Have you actually tried it with the full URL? The help file seems quite
> clear that it is needed when passing parameters otherwise PHP tries to
> open a file with the name including the parameters.
>
> I have just tried this on my local set-up:
>
> Two php scripts as below
>
> inc_test.php
>
> <?
> include("http://localhost/inc_test2.php?letter=A");
> ?>
>
> and
>
> inc_test2.php
>
> <?
> if (!empty($letter)) {
> echo $letter;
> } else {
> echo 'letter was not passed';
> }
> ?>
>
> If I call inc_test.php in my browser everything works fine and the letter
> A is displayed but if I remove the full URL path from inc_test.php i.e.
>
> <?
> include("http://localhost/inc_test2.php?letter=A");
> ?>
>
> I get
>
> Warning: main(inc_test2.php?letter=A): failed to open stream: No such file
> or directory in c:\www\vhtdocs\paul\project\inc_test.php on line 2
>
> Warning: main(): Failed opening 'inc_test2.php?letter=A' for inclusion
> (include_path='.;c:\php4\pear') in
> c:\www\vhtdocs\paul\project\inc_test.php on line 2
>
> As you say, if you take the parameter out of the include in inc_test.php
> everything works and I get 'letter was not passed' returned to my browser.
> So it seems the full path is needed when passing parameters but not
> otherwise.
>
> --
> Paul Barfoot
>
>
> "Er Galv?o Abbott" <galvao@galvao.eti.br> wrote in message
> news:d9971ed2.0410031033.1e807ee5@posting.google.com...
>> Sorry, I didn't explained enough:
>>
>> I've added the entire physical path to the htdocs dir in the php.ini,
>> so I don't need to pass the entire URL or PATH.
>>
>> As I've stated before, if I remove the parameters it works.
>>
>> Any other ideas?
>>
>> TIA,
>>
>> __________________
>> Er Galvão Abbott
>> <? PHP ?> && #! Perl Programmer
>
>
- Previous message: Kurt Krueckeberg: "php-base mailing list manager"
- In reply to: Paul Barfoot: "Re: require with $_GET parameters"
- Next in thread: Er Galv?o Abbott: "Re: require with $_GET parameters"
- Reply: Er Galv?o Abbott: "Re: require with $_GET parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]