gp
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.
mixed - either the value of the variable if it was passed
to the browser, or the default value if provided, or
an empty string.
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