Home >> Snippet List >> Snippet

Name
Universal parameter reading
Description
This simple yet practical function will read in your scripts' parameters regardless of how they are passed
PHP Snippet
<?PHP
 
FUNCTION param($Name)
         {
         GLOBAL $HTTP_GET_VARS;
         GLOBAL $HTTP_POST_VARS;
         GLOBAL $HTTP_COOKIE_VARS;
 
         IF(ISSET($HTTP_GET_VARS[$Name]))
            RETURN($HTTP_GET_VARS[$Name]);
 
         IF(ISSET($HTTP_POST_VARS[$Name]))
            RETURN($HTTP_POST_VARS[$Name]);
 
         IF(ISSET($HTTP_COOKIE_VARS[$Name]))
            RETURN($HTTP_COOKIE_VARS[$Name]);
 
         RETURN("");
         }                
 
?>