Forum DOs and DON'Ts
Please use CODE tags
Including your email address in a post is not recommended
My Blog
OK, so I think that basically to translate from ancient PHP to modern PHP, you need to add this to your other script.
However, it is a bit more complicated than that because the script reposts to itself and it will need to repost this report data item - or it could be converted to a session variable. Needs more work and it's bedtime hereCode:$report = $_POST['report'];
THAT WAS IT!!!!!!!!!!!! WOOOOHOOOOO!
register_globals needed to be turned on.
Thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you, thank you.
Take a lot of care if you decide to update your PHP version.
What version are you running?
If I remember correctly register_globals was depracted in v.5.3 and removed entirely in v.5.4
Could be problematic if one of your web hosters decides to upgrade!
My memory is fallible but I'm fairly sure the above is correct, been while since I did php stuff in earnest though :/
No, enabling register_globals is the wrong approach. Not only is it insecure, but as cryptotheslow observes, it has been deprecated in the most recent PHP versions.
All the POST information is stored in the $_POST array (and also the $_REQUEST array which includes both GET and POST input). You can create a local $reports variable from $_POST['reports'], as spjackson observes. However any script that includes user-generated input, unless it is running in a closed environment like an intranet, needs to have that input validated. So, again, make sure you have something to handle values that don't match the ones you expect.
I've seen all sorts of things attached as values to exposed variables. The cardinal rule is not to trust user input.
Last edited by SeijiSensei; August 15th, 2012 at 03:45 AM.
Understood - but until the client is ready to spend the money to have the code updated, I have to take what I can get... and this is a temporary fix.
Well, I'd make sure you activate register_globals only for this client. You can do this in .htaccess or in the <Directory> stanza for the client's virtual host by adding "php_flag register_globals on". I wouldn't turn it on globally via php.ini if you can avoid it.
Echo this comment.
On our server we have some systems that rely on register variables being on (older shopping carts) and others that rely on register variables being off.
This has to be set by domain / client.
Ultimately you have to write your code to meet the current standards to avoid wholsale collapse of your site one day.
Mick 'n Keef rock, Chas beats time and Ronnie is the new boy
Registered as user 466848 with the Linux Counter. Registered Ubuntu User 22858. Our company website or our new venture
Bookmarks