<?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
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
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.
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
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
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
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
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.
Hot Tools
PHP library for dependency injection containers
PHP library for dependency injection containers
A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking
Small PHP library for optimizing images
Small PHP library for optimizing images