Home PHP Libraries Other libraries PHP parameter data filtering security class
PHP parameter data filtering security class
<?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;

This is a PHP parameter data filtering security class. Friends who need it can download and use

Disclaimer

All resources on this site are contributed by netizens or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this site are for learning reference only. Please do not use them for commercial purposes. Otherwise, you will be responsible for all consequences! If there is any infringement, please contact us to delete it. Contact information: admin@php.cn

Related Article

Detailed explanation of php parameter filtering and data filtering examples Detailed explanation of php parameter filtering and data filtering examples

12 Jul 2017

This article will introduce you to PHP parameter filtering and PHP data filtering, including the basic principles of PHP submission data filtering and PHP simple data filtering. Friends who are interested can learn together.

PHP data filtering: preventing security vulnerabilities during transmission PHP data filtering: preventing security vulnerabilities during transmission

28 Jul 2023

PHP Data Filtering: Preventing Security Vulnerabilities During Transmission In network development, the security of data transmission has always been an important concern. Especially in PHP development, we need to pay attention to security issues during data transmission to prevent security vulnerabilities. This article will introduce several common PHP data filtering methods to help developers deal with security risks in data transmission. Input filtering When receiving input data from users, we need to filter it to prevent malicious users from attacking by entering special characters or script codes. by

How does PHP perform data validation and security filtering? How does PHP perform data validation and security filtering?

29 Jun 2023

PHP is a commonly used server-side scripting language that is widely used for web development. During the development process, data verification and security filtering are very important to prevent malicious attacks and illegal data input, and ensure the security and stability of the system. This article will explore how PHP performs data validation and security filtering. Data verification refers to ensuring the legality and accuracy of input data and preventing malicious injection and illegal data input. In PHP development, we can use the following methods for data validation: Form validation: HTML forms are user-directed services

PHP data filtering: from user input to database security PHP data filtering: from user input to database security

28 Jul 2023

PHP Data Filtering: From User Input to Database Security Overview: In web development, the security of user input data is a very important issue. Improper input filtering and validation may expose the database to attacks such as SQL injection, cross-site scripting (XSS), etc. This article will introduce how to use PHP for data filtering and validation to ensure the security of data from user input to storage in the database. Input filtering User-entered data is not trustworthy, so it must be filtered appropriately. The following is a

Detailed explanation of php parameter filtering and data filtering, detailed explanation of php_PHP tutorial Detailed explanation of php parameter filtering and data filtering, detailed explanation of php_PHP tutorial

12 Jul 2016

Detailed explanation of php parameter filtering and data filtering, detailed explanation of php. Detailed explanation of php parameter filtering and data filtering, detailed explanation of php. The following is a code to introduce php parameter filtering to you class mysafe{ public $logname; public $isshwomsg; function __construct(){ s

Website Security Strategy: Input Data Validation and Filtering in PHP Website Security Strategy: Input Data Validation and Filtering in PHP

29 Jun 2023

Website security has always been one of the focuses of attention of the majority of netizens. With the rapid development of the Internet, more and more websites are attacked by hackers, and users' personal information and assets are also facing serious threats. In order to protect the security of websites and users, developers need to adopt effective security strategies to defend against various attacks. This article will focus on input data validation and filtering technology in PHP to help developers improve website security. First, let’s understand what input data validation and filtering is. Input data validation is performed on the input data submitted from the user side.

See all articles