Universal Parameter Reading

Description: This simple yet practical function will read in your scripts’ parameters regardless of how they are passed.

<?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("");
         }
 
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.