Re: require with $_GET parameters
From: Er Galv?o Abbott (galvao_at_galvao.eti.br)
Date: 10/04/04
- Previous message: Paul Barfoot: "Re: require with $_GET parameters"
- In reply to: Paul Barfoot: "Re: require with $_GET parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 Oct 2004 22:32:49 -0700
I'm sorry. As I've suspected it was a (VERY) stupid mistake:
I was calling the file with the PATH (e.g.:
/var/www/.../header.php?oper=Add...) instead of the URL (e.g.:
http://something.com/header.php?oper=Add...)
Thanks a lot for your replies.
Best regards,
__________________
Er Galvão Abbott
<? PHP ?> && #! Perl Programmer
"Paul Barfoot" <Paul@theglobalfamily.fsworld.co.uk> wrote in message news:<cjpoa4$lbg$1@news5.svr.pol.co.uk>...
> 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: Paul Barfoot: "Re: require with $_GET parameters"
- In reply to: Paul Barfoot: "Re: require with $_GET parameters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]