php的參數過濾、資料過濾類
<?php class mysafe{ public $logname; public $isshwomsg; function __construct(){ set_error_handler('MyError',E_ALL); //----- } function MyError($errno, $errstr, $errfile, $errline){ echo "<b>Error number:</b> [$errno],error on line $errline in $errfile<br />"; exit; } function wlog($logs){ if(empty($logname)){ $this->logname=$_SERVER["DOCUMENT_ROOT"]."/log.htm"; } $Ts=fopen($this->logname,"a+"); fputs($Ts,$logs."\r\n"); fclose($Ts); } function showmsg($msg='',$flag=false){ $this->isshwomsg=empty($this->isshwomsg) ? false : true; if ($this->isshwomsg) { echo '<br />--------------------------------------<br />'; echo $msg; echo '<br />--------------------------------------<br />'; if ($flag) exit; }
這個是個PHP的參數和資料的過濾類,為了資料的安全性一定要過濾後的資料才可以使用。
免責聲明
本站所有資源皆由網友貢獻或各大下載網站轉載。請自行檢查軟體的完整性!本站所有資源僅供學習參考。請不要將它們用於商業目的。否則,一切後果都由您負責!如有侵權,請聯絡我們刪除。聯絡方式:admin@php.cn
相關文章

23 Oct 2024
本文介紹了一種在 PHP/MySQL 中使用鄰接清單模型儲存分層資料(例如類別和子類別)的方法。它提出了一種一次性資料檢索演算法,可以使用單一資料有效地獲取分層資料。

11 Nov 2024
在 Angular ng-repeat 中顯示過濾後的資料計數當使用 ng-repeat 在 Angular 中顯示過濾後的資料時,準確地...

08 Nov 2024
在 ng-repeat 中顯示過濾數據的長度在 Angular 應用程式中,通常使用 ng-repeat 指令顯示數據,該指令會迭代...

18 Jan 2025
SQL Server 中的條件 WHERE 子句在 SQL Server 中,條件 WHERE 子句可讓您根據...指定不同的篩選條件。


Hot Tools

熱門文章
丟失記錄:Bloom&Rage -Corey和Dylan的鎖組合
19 Feb 2025
手游攻略
Hello Kitty 島冒險:巧克力貓角色指南
24 Jan 2025
手游攻略
如何修復KB5050081無法在Windows 10中安裝?
31 Jan 2025
故障排查
Hello Kitty Island冒險:重新啟動機器人任務演練
16 Feb 2025
手游攻略
王朝勇士:起源 - Xinye練習之戰
26 Jan 2025
手游攻略