Re: require with $_GET parameters

From: Paul Barfoot (Paul_at_theglobalfamily.fsworld.co.uk)
Date: 10/03/04


Date: Sun, 3 Oct 2004 20:36:37 +0100

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


Relevant Pages

  • Re: Property autofill contents
    ... The help topic on the BuiltInDocumentProperties suggests that you use the Object ... Browser to see what properties are available. ... If you copy/paste that macro into a module in the VBA editor and run ... I then called those two up in the Office help file. ...
    (microsoft.public.word.vba.beginners)
  • Re: Bookmaker problem
    ... Malcolm Smith wrote in message ... >>> and the browser is set to shared since I have webster and O2 ... >> What email client do you have selected in BookMaker's preferences? ... I waded through the help file regarding the 'shared' setting and file ...
    (comp.sys.acorn.apps)
  • Re: Error with VBScript 5.6 CHM
    ... > I am getting an error when I open the Script56.CHM file and whenever I click on anything in the help file. ... What version of the browser is installed on the problematic machine? ... You will need at least Internet Explorer 5.5 or higher to fix this. ...
    (microsoft.public.scripting.vbscript)
  • Re: Web page in java
    ... I have a browser that can be run. ... java app, I just need to know how to open my help file with the browser on ... The browser will be stored in a folder called Apps and the help file ...
    (comp.lang.java.programmer)