Re: require with $_GET parameters

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

  • Next message: Er Galv?o Abbott: "Re: require with $_GET parameters"
    Date: Sun, 3 Oct 2004 13:32:31 +0100
    
    

    Hi

    You need to use the full URL if passing parameters - from the help file:

    /* Won't work; looks for a file named 'file.php?varone=1&vartwo=2'
     * on the local filesystem. */
    include ("file.php?varone=1&vartwo=2");

    /* Works. */
    include ("http://someserver/file.php?varone=1&vartwo=2");

    For your example:

    include('admin/header.php?item=Users&oper=Add'); won't work

    but

    include("http://yourserver/admin/header.php?item=Users&oper=Add"); will work

    HTH

    Paul Barfoot

    "Er Galv?o Abbott" <galvao@galvao.eti.br> wrote in message
    news:d9971ed2.0410021442.e555c5a@posting.google.com...
    > Greetings.
    >
    > I'm trying to do a require with get variables as below:
    >
    > require_once('admin/header.php?item=Users&oper=Add');
    >
    > So I can dynamically show the header as 'Add Users'.
    >
    > Require is failing as it would be considering the parameters as part
    > of the filename.
    >
    > I've took a look at PHP's documentation and it states
    > (http://us2.php.net/manual/en/function.include.php):
    >
    > quote:
    > --------------------------------------------------------------------------------
    > // Works.
    > include 'http://www.example.com/file.php?foo=1&bar=2';
    > --------------------------------------------------------------------------------
    >
    > So I've tried replacing require for include, but it's still failing.
    >
    > If I remove the parameters it works.
    >
    > Is this possible?
    >
    > Please someone help.
    >
    > TIA,
    > __________________
    > Er Galvão Abbott
    > <? PHP ?> && #! Perl Programmer


  • Next message: Er Galv?o Abbott: "Re: require with $_GET parameters"