get_param ()

function get_param ($var_name, $default = '', $mode = '')

Use this function to read values from form which is using GET method, or from URL.

$var_name is the name of the variable to be read from.

$default is the default value to be assigned if the variable doesn't exist.

$mode is how to read the variable:

  • noslash = remove slashes from value.
  • nohtml = remove all HTML tags.
  • filterhtml = remove selected HTML tags defined in configuration panel.
  • html = allow HTML tags.
  • BY DEFAULT, get_param will add slashes, encode HTML tags with htmlspecialchars, thus making it SQL ready.

Example 1

require './includes/user_init.php';
echo get_param ('number', 5);

If you call the script with test.php?number=10, it will output '10'.

Posted On: Aug-19-2010 @ 07:00am
Last Updated: Jan-01-1970 @ 07:00am

There is no comment. Why not be the first?

More Comments/Post Your Own