Home > Backend Development > PHP Tutorial > php get post passes data security issues_PHP tutorial

php get post passes data security issues_PHP tutorial

WBOY
Release: 2016-07-13 17:09:20
Original
1421 people have browsed it

php get post Transfer data in post method post get php post get post difference php parameter transfer http get post difference between post and get difference between get and post post and get

/**
* @name date safe class 0.1
* @author kevin xu
* @copyright kenvin E-mail:gincn@cn.cashboxparty.com MSN:gincn@live.cn
*/
interface dateSafe{
function gincn();
}
class safe extends doSafe implements dateSafe
{
public $safe;
function __construct($safe)
{
parent::__construct($safe); //Calling the parent class constructor, the error found by netizen javachen
$this->safe = $safe;
}
function gincn()
{
$this->safe = parent::xss($this->safe);
$this->safe = parent::sql($this->safe);
return $this->safe;
}
}
class doSafe
{
protected $str;
function __construct($str)
{
$this->str = $str;
}
function xss()
{
$this->str = trim($this->str); //Clean up space characters
$this->str = nl2br($this->str); //Convert newline character to

$this->str = strip_tags($this->str); //Filter HTML tags in text
$this->str = htmlspecialchars($this->str); //Convert the content in the text to HTML entities
$this->str = addslashes($this->str); //Add character escape
return $this->str;
}
function sql()
{
$this->str = mysql_escape_string($this->str);
return $this->str;
}
}

?>


www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/629765.htmlTechArticlephp get post post method to pass data post get php post get post difference php parameter transfer http get post post and get The difference between get and post The difference between post and get ?php /** * @name date safe cl...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template