<?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 and data filtering class. For data security, filtered data must be used before it can be used.
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.
07 Aug 2023
Implementing filtering and sorting of XML data using Python Introduction: XML is a commonly used data exchange format that stores data in the form of tags and attributes. When processing XML data, we often need to filter and sort the data. Python provides many useful tools and libraries to process XML data. This article will introduce how to use Python to filter and sort XML data. Reading the XML file Before we begin, we need to read the XML file. Python has many XML processing libraries,
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
18 Nov 2023
Detailed explanation of PHP data filtering functions: Data filtering skills for filter_var, filter_input, filter_has_var and other functions, requiring specific code examples. In web development, data filtering is a very important part. Filtering user-entered data protects our applications from potential security threats. PHP provides a series of powerful data filtering functions. This article will introduce in detail filter_var, filter_input and f.
09 Aug 2023
Python implements XML data filtering and filtering. XML (eXtensibleMarkupLanguage) is a markup language used to store and transmit data. It is flexible and scalable and is often used for data exchange between different systems. When processing XML data, we often need to filter and filter it to extract the information we need. This article will introduce how to use Python to filter and filter XML data. Import the required modules Before starting, we
09 Aug 2023
PHP form filtering: HTML tags and special character filtering In web development, forms are an important way for users to interact with the website. However, bad users may abuse the form to submit malicious code, posing a threat to the security of the website. In order to ensure the security of user input data, we need to filter form input. This article will focus on how to use PHP to filter HTML tags and special characters to prevent XSS attacks and other security issues. 1. Filter HTML tags using strip_tags function str
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