note 111241 added to reserved.variables.post
| From: | Anonymous | Date: | Tue, 29 Jan 2013 22:12:50 +0000 |
| Subject: | note 111241 added to reserved.variables.post | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-193432@lists.php.net to get a copy of this message | ||
function post($param , $max_len = 256 , $filter = FILTER_SANITIZE_SPECIAL_CHARS, $replace = NULL ,
$func = NULL)
{
if($filter === NULL) # this param can be skipped using NULL
{
$filter = FILTER_SANITIZE_FULL_SPECIAL_CHARS;
}
if($max_len === NULL)
{
$max_len = NULL;
}
if ( isset($_POST[$param]) && !empty($_POST[$param])) # if the post paramter is set
{
$input = filter_input(INPUT_POST, $param, $filter);
if ( $max_len > strlen($input) ) # if max length is greater then the len of the
string
{
$max_len = strlen($input); # we use the max length of the string
}
$input = substr($input, 0 , $max_len);
}else
{
return '';
}
$input = preg_quote($input); # take care of escape characters
if($replace !== NULL)
{
preg_replace($replace, $input);
}
if ($func !== NULL)
{
return $func($input);
}
return $input;
}
----
Server IP: 69.147.83.199
Probable Submitter: 72.214.61.67
----
Manual Page -- http://php.net/manual/en/reserved.variables.post.php
Edit -- https://master.php.net/note/edit/111241
Del: integrated -- https://master.php.net/note/delete/111241/integrated
Del: useless -- https://master.php.net/note/delete/111241/useless
Del: bad code -- https://master.php.net/note/delete/111241/bad+code
Del: spam -- https://master.php.net/note/delete/111241/spam
Del: non-english -- https://master.php.net/note/delete/111241/non-english
Del: in docs -- https://master.php.net/note/delete/111241/in+docs
Del: other reasons-- https://master.php.net/note/delete/111241
Reject -- https://master.php.net/note/reject/111241
Search -- https://master.php.net/manage/user-notes.php