Skip navigation.

Harold's Home

   Home
  
XML version of this site

PHP Scripts

Index
CLI fun
Mail on 404
HB-NS (NewsScript)

Downloads

Applescripts
APOD to Desktop
Dreamweaver Extensions

Stuff

Writings
Other stuff
Central Grinder

OOOk Default:

VJ stuff
VJ Tools
Bananas
Strippers
Sample Movies

News

extract($_COOKIE);
Here's a cool function if you have register_globals off in php.ini but really really need to enable it for one webapplication: extract($_COOKIE);.
(This can be done for other global variables also like $_SERVER or $_REQUEST.)

Of course register_globals is off for a reason but sometimes you've got an old script that's not written by you and you really really need it and don't have the time (or rather the client doesn't have the money) for you to go over all the code and change it into a completely safe thing.

In the thing I'm working on right now I'm able to figure out all the regular post and get variables but the cookies (used to prevent ballot stuffing) gave me headaches until I came across this function.

Show all items | Read all items

About, copyright, privacy and accessibility | Mail