検索
ホームページphp教程php手册php get post传递数据 安全问题

php get post传递数据 安全问题

Jun 13, 2016 am 10:11 AM
gethttpphppost移行違いパラメータそして安全性データ方法質問

php get post  post方式传递数据   post get   php post   get post区别 php 参数传递   http get post   post和get的区别   get与post的区别   post和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);       //调用父类构造函数,网友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);      //过滤文本中的HTML标签
  $this->str = htmlspecialchars($this->str);    //将文本中的内容转换为HTML实体
  $this->str = addslashes($this->str);      //加入字符转义
  return $this->str;
 }
 function sql()
 {
  $this->str = mysql_escape_string($this->str);
  return $this->str;
 }
}

?>


 

声明
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。

ホットAIツール

Undresser.AI Undress

Undresser.AI Undress

リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover

AI Clothes Remover

写真から衣服を削除するオンライン AI ツール。

Undress AI Tool

Undress AI Tool

脱衣画像を無料で

Clothoff.io

Clothoff.io

AI衣類リムーバー

Video Face Swap

Video Face Swap

完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

ホットツール

VSCode Windows 64 ビットのダウンロード

VSCode Windows 64 ビットのダウンロード

Microsoft によって発売された無料で強力な IDE エディター

メモ帳++7.3.1

メモ帳++7.3.1

使いやすく無料のコードエディター

WebStorm Mac版

WebStorm Mac版

便利なJavaScript開発ツール

SublimeText3 中国語版

SublimeText3 中国語版

中国語版、とても使いやすい

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Eclipse を SAP NetWeaver アプリケーション サーバーと統合します。