search
HomePHP LibrariesOther librariesPHP parameter filtering and data filtering classes
PHP parameter filtering and data filtering classes
<?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.

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 examplesDetailed explanation of php parameter filtering and data filtering examples

12Jul2017

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.

Filtering and sorting XML data using PythonFiltering and sorting XML data using Python

07Aug2023

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,

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

12Jul2016

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

Detailed explanation of PHP data filtering functions: data filtering skills for filter_var, filter_input, filter_has_var and other functionsDetailed explanation of PHP data filtering functions: data filtering skills for filter_var, filter_input, filter_has_var and other functions

18Nov2023

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.

Python implements XML data filtering and filteringPython implements XML data filtering and filtering

09Aug2023

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

PHP form filtering: HTML tags and special character filteringPHP form filtering: HTML tags and special character filtering

09Aug2023

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

See all articles