Results 1 to 8 of 8

Thread: use of $_Get in PHP 4.1.1

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    The Netherlands
    Posts
    96

    use of $_Get in PHP 4.1.1

    Is it possible to use this in PHP 4.1.1

    PHP Code:
    $_GET["id"]; 
    Or should it be renamed to

    PHP Code:
    $GET["id"]; 

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    For strict 4.1, it should be w/o the underline.
    If it's possible that it may also run on an older version of PHP, then you might want to leave it in.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256


    I didn't even know there was a $GET. I thought all the super globals had the $_ prefix to them. And what is strict 4.1?

    And it wouldn't run on an earlier version, because the superglobals didn't exist on earlier versions. They were implemented in 4.1, and fully addressed in 4.2

    Prior to that, either you used the variable name (such as $id) or used $HTTP_GET_VARS['id'] or whatever it was.

    ...this whole thread just confuses me...
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    sunnuva....... you're right..... now that you mentioned it, I don't see how $GET would work..... other than simply geing just another variable....

    what I meant by "strict" was that one way was left for degradation purposes, but that the new way works better/safer/and is recommended. Also not all hosts allow superglobals (mine #$%)$# host included) ...
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Oh. I gotcha

    Your host doesn't allow superglobals!? Do you have to use just like $id (register_globals on)?

    Man. That's like backwards. PHP recomments register_globals off (and is by default) and praises the use of the superglobals.

    That's just crazy!
    My evil laugh has a squeak in it.

    kristopherwilson.com

  6. #6
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337

    Re: use of $_Get in PHP 4.1.1

    Originally posted by Chrissie
    Is it possible to use this in PHP 4.1.1

    PHP Code:
    $_GET["id"]; 
    Or should it be renamed to

    PHP Code:
    $GET["id"]; 
    if you can't use

    PHP Code:
    $_GET["id"]; 
    then you can use

    PHP Code:
    $HTTP_GET_VARS["id"]; 
    but that is not an autoglobal

    also, if you have register_globals on you should still be able to use the superglobals.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Aug 2002
    Location
    The Netherlands
    Posts
    96

    My mistake

    Yeah my mistake it shouldn't be $Get but
    $HTTP_GET_VARS

    But 4.1.1 does not allow $_GET is that true?

  8. #8
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256

    Re: My mistake

    Originally posted by Chrissie
    Yeah my mistake it shouldn't be $Get but
    $HTTP_GET_VARS

    But 4.1.1 does not allow $_GET is that true?
    I thought it had, but it might be 4.1.2 that they started with it, or something later.

    I know it was all leading up to 4.2 where register_globals was off by default, but I'm not sure when they started adding it.

    Note: I just looked it up. "Introduced in 4.1.0. In earlier versions, use $HTTP_GET_VARS."

    So it should be available in 4.1.1.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width