Possible Duplicate:
Is using $GLOBALS['HTTP_GET_VARS'] deprecated?
Invalid arguements in php
I get the following response when I run script in a WAMP environment:
Warning: Invalid argument supplied for foreach() in C:\wamp\www\GeCard\eCardScript_ecards\ecard_lib.php on line 17
Warning: Invalid argument supplied for foreach() in C:\wamp\www\GeCard\eCardScript_ecards\ecard_lib.php on line 21
This is my code:
function getPostGetVars() {
global $HTTP_POST_VARS,$HTTP_GET_VARS;
foreach ($HTTP_POST_VARS as $key => $value) { //This is line 17
global $$key;
$$key = $value;
}
foreach ($HTTP_GET_VARS as $key => $value) { //This is line 21
global $$key;
$$key = $value;
}
}
I am told that this code is deprecated. Can this piece of code be easily updated to eliminate the warnings?