OsakaWebbie
Programmer
I wrote some code a long time ago that I now can't remember why it worked, and can't get it to work again now that I'm on a new hoster who has different settings and different versions of stuff.
The old code depended on register_globals (yes, I know that's a bad idea, but the application is really big, old, and doesn't keep data that is particularly important to protect, so I haven't taken the time to upgrade it all yet). The spot I'm having trouble with does a tricky thing with the incoming POST variables, and that's the problem. In the file with the form, there are lots of inputs like this:
The number corresponds to the ID number for a record in my database. A list of all the numbers is also passed to the processing script. In the processing script, I loop through the numbers, assigning them to a simple variable called $sid. Then I take action based on the checked state of the corresponding checkbox, with code like this:
The double $$ looks weird, but with register_globals on, it worked - if the checkbox had been checked, the expression evaluated true. But when I try to change it to $_POST['$sid'] it doesn't work - I always get nothing for the value, as if no checkboxes were ever checked. How can I accomplish what I need?
The old code depended on register_globals (yes, I know that's a bad idea, but the application is really big, old, and doesn't keep data that is particularly important to protect, so I haven't taken the time to upgrade it all yet). The spot I'm having trouble with does a tricky thing with the incoming POST variables, and that's the problem. In the file with the form, there are lots of inputs like this:
Code:
<input type=checkbox name="237">
Code:
if ($$sid && other stuff) do something...