SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    I don't know what happened...

    I reformatted my computer a couple days ago, and yesterday I reinstalled all my web stuff (apache, PHP, MySQL), all the newest (apache 1.x not 2.x) on WinXP Pro.

    I don't know if its a php.ini option that I'm missing or what, but for some reason vars in URLs aren't being parsed. So if I have index.php?op=something, I get an errors that says $op isn't set.

    but, when I try it on a unix server it works fine

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The new default setting (for security reasons) in PHP is register_globals = Off

    You should start referencing the new superglobal associative arrays $_GET[] and $_POST[].

    //For instance
    echo $_GET['op'];

  3. #3
    SitePoint Evangelist cyngon's Avatar
    Join Date
    Aug 2001
    Location
    Livonia, MI, USA
    Posts
    513
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like register globals is turned off.

    PHP sets register globals to off by default for security reasons in new versions of PHP.

    If you want to enable it, you just have to change one line in the ini file.

    However, I suggest that you leave it off and instead use the $_GET and $_POST variables to get values passed from the script. For example, in the sample you posted, try doing:

    PHP Code:
    echo $_GET['op']; 
    Edit: Beaten to the punch by randem. Thats twice in a row. Gotta be quicker with the keyboard today I suppose.

  4. #4
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    changing everything to use $_GET is going to be a major project, which I will do over time, but for now I really need the old way to work.

    I changed php.ini register_globals = On, but that still doesn't work

    I also get errors like "Undefined variable: PHP_SELF" too

    thanks for the help

  5. #5
    SitePoint Addict IsaacV's Avatar
    Join Date
    Jan 2002
    Location
    Saint Petersburg
    Posts
    246
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is it really necessary to state the same thing 3 different times?!! I mean, is it just me?
    Pants.
    Join the NYFlava Fashions Contest

  6. #6
    SitePoint Enthusiast
    Join Date
    Apr 2001
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what do you mean, I didn't say anything 3 times?

  7. #7
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by IsaacV
    Is it really necessary to state the same thing 3 different times?!! I mean, is it just me?
    Yes, it is just you.

  8. #8
    SitePoint Addict IsaacV's Avatar
    Join Date
    Jan 2002
    Location
    Saint Petersburg
    Posts
    246
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I meant that cyngon and randem stated the same things.

    I just can't count
    Pants.
    Join the NYFlava Fashions Contest

  9. #9
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, their posts are set apart by just one minute. When they started writing their post, there were no replies.

  10. #10
    SitePoint Addict IsaacV's Avatar
    Join Date
    Jan 2002
    Location
    Saint Petersburg
    Posts
    246
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh, didn't see that. Maybe I should give me optometrist a call
    Pants.
    Join the NYFlava Fashions Contest


Bookmarks

Posting Permissions

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