Apache/PHP does not recoginize querystring keyvalue pair

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kang Sun

    #1

    Apache/PHP does not recoginize querystring keyvalue pair

    Greetings!
    I am testing Apache/PHP/MySQL. The connection seems to be right but
    when I try to http://my_machine/mypage.php3?id= 1", I won't be able to
    get value the variable $id. Did I miss anything in the configuration
    of Apache or I miss a function call before I check the value of $id in
    PHP file?
    Please help! Thanks!
    Please mail to sun_kang@hotmai l.com
    -- Kang
  • Tom Thackrey

    #2
    Re: Apache/PHP does not recoginize querystring keyvalue pair



    On 20-Oct-2003, sun_kang@hotmai l.com (Kang Sun) wrote:
    [color=blue]
    > I am testing Apache/PHP/MySQL. The connection seems to be right but
    > when I try to http://my_machine/mypage.php3?id= 1", I won't be able to
    > get value the variable $id. Did I miss anything in the configuration
    > of Apache or I miss a function call before I check the value of $id in
    > PHP file?[/color]

    try $_GET['id'] or $_REQUEST['id']

    look up register globals in the manual.


    --
    Tom Thackrey

    tom (at) creative (dash) light (dot) com
    do NOT send email to jamesbutler@wil lglen.net (it's reserved for spammers)

    Comment

    • John Downey

      #3
      Re: Apache/PHP does not recoginize querystring keyvalue pair

      Kang Sun wrote:
      [color=blue]
      > Greetings!
      > I am testing Apache/PHP/MySQL. The connection seems to be right but
      > when I try to http://my_machine/mypage.php3?id= 1", I won't be able to
      > get value the variable $id. Did I miss anything in the configuration
      > of Apache or I miss a function call before I check the value of $id in
      > PHP file?
      > Please help! Thanks!
      > Please mail to sun_kang@hotmai l.com
      > -- Kang[/color]
      "In PHP 4.2.0 and later, the default value for the PHP directive
      register_global s is off. This is a major change in PHP. Having
      register_global s off affects the set of predefined variables available
      in the global scope. For example, to get DOCUMENT_ROOT you'll use
      $_SERVER['DOCUMENT_ROOT'] instead of $DOCUMENT_ROOT, or $_GET['id'] from
      the URL http://www.example.com/test.php?id=3 instead of $id, or
      $_ENV['HOME'] instead of $HOME.

      For related information on this change, read the configuration entry for
      register_global s, the security chapter on Using Register Globals , as
      well as the PHP 4.1.0 and 4.2.0 Release Announcements.

      Using the available PHP Reserved Predefined Variables, like the
      superglobal arrays, is preferred."

      taken directly from the PHP manaul at


      --
      John Downey




      Comment

      Working...