The fastest easiest way to get it right.

gp

NAME

gp

FUNCTION

The PHP function gp retrieves the Get/Post value associated with the variable name provided. A user can provide a default value that should be returned in case the requested variable does not exist.

INPUTS


  • string - Requested variable name
  • string - value to return if the variable does not exist

RETURNS

mixed - either the value of the variable if it was passed to the browser, or the default value if provided, or an empty string.

SOURCE

function gp($key,$vardefault='') {
    #echo "
Gp called with -$key- -$vardefault-"; $post=$GLOBALS["AG"]["clean"]; if (!isset($post[$key])) { #echo "
-> not set, returning $vardefault"; return $vardefault; } else { #echo "
-> key exists, returning {$post[$key]}"; return $post[$key]; } }
comments powered by Disqus
Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2013, Licensed under the GPL Version 2