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]; } }

User Comments

There are no user comments yet on this page.


Add A Comment

Comments will not appear until after they are moderated. Comments are usually moderated within a few hours on weekdays, but may take longer on weekends and holidays.

Name or nickname: (This will appear with your comment)


Email (this will never be displayed)


Enter your comment here. Use [b] and [/b] for bold, [i] and [/i] for italic, and [pre] and [/pre] for code samples. All literal HTML and PHP that you enter will be escaped out and displayed as you enter it.


Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2010, Licensed under the GPL Version 2