/**
* @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);
$this->
str = nl2br($this->str); >
$this->str =
strip_tags($this->str);
$this->str = htmlspecialchars(
$this->str); //Convert the content in the text into HTML entities
$this->str = addslashes(
$this->str);
return $this->str;
}
function sql
()
{
$this->str =
mysql_escape_string
($this->
str
);
return $this->str;
}
}
?>
http://www.bkjia.com/PHPjc/629768.htmlwww.bkjia.comtrue
http: //www.bkjia.com/PHPjc/629768.html
TechArticle?php /***@namedatesafeclass0.1 *@authorkevinxu *@copyrightkenvinE-mail:gincn@cn.cashboxparty.comMSN:gincn@live.cn*/ interface dateSafe { function gincn (); } class safe extends d. ..