Our webhost just upgraded to php 4.2.1 and has disabled register_globals, so I've been converting our scripts over and I've come across the following problem:
I had a function "clean_input()" below that I used to strip off backslashes of user-inputted data for printing.
function clean_input(){
foreach ($_POST as $key=>$value){
$value = stripslashes($value);
$$key = $value;
}
}
If I echo $$key within the function, it appears to be working, but if I echo the key name outside of the function, it does nothing.
This function worked fine under php 4.0.6 with register_globals=on when I was using $HTTP_POST_VARS instead of $_POST.
Any ideas on how I can get it to work again with register_globals off?
Thanks,
Patrick