Dealing w/ register_globals
Spending time around osCommerce like I do, I spend some time fixing scripts that use register_globals when they shouldn't. I realized the fastest method to dealing with them is to do some VIM magic, combined with some quick PHP thinking
Step 1: get all the POST keys
Step 2: Happy magic super VIM time (with justice)
:%s/^.*$/\$& = $_POST[&];/gStep 3: hackish hackish Sally
Don't ask... The name Sally came to mind (I don't even know anyone named Sally...).You throw the newly generated buffer that looks like:
$zarg = $_POST[zarg];
$fnord = $_POST[fnord];
$fnord = $_POST[fnord];
into the appropriate place and bam, you now have a reference to everything w/ register_globals. I'm not sure this is the greatest solution, but when modifying lots of stupid code, feel free to go to town. Sucka.
This page is CategoryHowTo