register_globals == Evil
July 31st, 2003 • Geeking Out
We just finished tracking down a nasty bug in our work order system that was erasing the description field of Sam’s records. It turns out that since the helpdesk system doesn’t use $_POST to grab its variables, it was loading a session variable called $description from another of our web systems. Not an easy one to track down.
So to all you PHP programmers out there - learn to use the superglobal arrays. It’s more of a pain, but it’ll save your butt someday. Well, either that, or don’t use generic variable names like $description. Call it $description_of_my_evil_plan or something that nobody else would ever think to use.
Sorry about two bug-related posts in a row… but I’ll take computer bugs over the live variety any day.
If you have no idea what this entry was about, feel free to complain loudly and I’ll feel free to keep posting about geeky stuff when I feel like it.
♫ Ry Wilson - A Little Creepin'
matthew
July 31st, 2003 at 11:27 am
I am working on an intranet website with PHP session variables too! Arg! I've not had enough experience with these.. want to help me out? I'll gladly accept any help you want to give =] heh
Good job on your find.. I hate bugs like that one where you'd swear it wasn't a bug just looking at it.
adam
July 31st, 2003 at 11:51 am
I'd be glad to help if I can. IM me at nanovivid any time.
JULIE!!!!!!!!
July 31st, 2003 at 5:10 pm
GAH THAT WAS SO BORING ADAM YUCK GROSS SERIOUSLY WHAT PLANET ARE YOU FROM GAH.
adam
July 31st, 2003 at 5:43 pm
:-*
dan
August 1st, 2003 at 11:46 am
lol at julie. the all caps was a nice touch.