Jump to content

register_globals


unidox

Recommended Posts

Register_globals is completely gone in PHP6, by the way.

It's probably one of the worst things ever designed for PHP.  Not gonna lie.

 

Here's what it does:

Let's say you had a form field called "name", and you sent it through POST.  Now, you know that it would be in $_POST['name'].

With register_globals, $name is INSTANTLY equal to that when you start the script.  I guess they thought it would make life easier.  Here's the issue:  GET has a higher priority over POST when it comes to register_globals (at least, I think. I think it's GPC, like magicquotes)  So, they could send in your form, but they could also change the action URL and add let's say...$password to the GET string, i.e:

yourdomain.com/process.php?password=A_PASSWORD

 

Now, $password has that value set in the script by default.  It basically made your script insanely insecure.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.