Posted: Wed Oct 11, 2006 10:17 am
Long arrays are deprecated. In PHP3 and PHP4, if you wanted to use them inside a function you had to gloablize them, but in in PHP4 and PHP5 the short arrays are super globals and do not need to be globalized (as they are already gloabl). So in a nutshell:dibyendrah wrote:Inside the function, unless you pass the variable as argument, other variable cannot be accessed unless you call global variable. So, you better call the global POST, GET variable by writing the statement :will solve your problem.Code: Select all
global $HTTP_POST_VARS;
With Regards,Code: Select all
function validateInput(){ global $HTTP_POST_VARS; if(empty($HTTP_POST_VARS['fname'])){ return false; }else{ return true; } }
Dibyendra
- Use $_GET not $HTTP_GET_VARS
- Use $_POST not $HTTP_POST_VARS
- Use $_COOKIE not $HTTP_COOKIE_VARS
- Use $_SESSION not $HTTP_SESSION_VARS
- Use $_SERVER not $HTTP_SERVER_VARS
- Use $_ENV not $HTTP_ENV_VARS