CoderZone.org

Category: >> PHP Code >> Universal parameter reading Bookmark and Share

<< lastnext >>

Snippet Name: Universal parameter reading

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

Comment: (none)

Author: CoderZone
Language: PHP
Highlight Mode: PHP
Last Modified: February 28th, 2009

<?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("");
         }                
 
?>
 
There haven't been any comments added for this snippet yet. You may add one if you like.  Add a comment 
© coderzone.org | users online: 5