search
  • Sign In
  • Sign Up
Password reset successful

Follow the proiects vou are interested in andi aet the latestnews about them taster

Home PHP Libraries Other libraries PHP 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

PHP filter_var(): A Guide to Data Filtering and Validation PHP filter_var(): A Guide to Data Filtering and Validation

10 Dec 2025

filter_var() is PHP's built-in lightweight data filtering function. It supports email verification, number/URL verification, HTML escaping, etc. It follows the RFC standard and returns a legal value or false. It needs to cooperate with options and flags to accurately control the behavior.

PHP multi-dimensional array multi-condition data search and filtering guide PHP multi-dimensional array multi-condition data search and filtering guide

27 Dec 2025

This tutorial details how to efficiently search and filter multi-condition data in multi-dimensional arrays in PHP. In view of the pain point that array_search cannot meet the needs of multi-column search, the article focuses on how to use the array_filter function combined with anonymous callback functions to implement complex matching logic based on multiple key-value pairs, and provides detailed code examples and usage precautions to help developers accurately locate the required data.

PHP and SQL: Multi-condition query for user data filtering through $_SESSION PHP and SQL: Multi-condition query for user data filtering through $_SESSION

11 Jan 2026

This article explains in detail how to use the AND operator to combine multiple filter conditions in SQL queries, and focuses on demonstrating how to safely integrate user login information in PHP $_SESSION into the WHERE clause to achieve personalized display of data for specific users. The article emphasizes the importance of using prepared statements to effectively prevent SQL injection attacks, and provides specific PHP mysqli sample code and related precautions.

How to enable Pico.css on demand in a project without polluting styles globally How to enable Pico.css on demand in a project without polluting styles globally

09 Feb 2026

Pico.css has provided the pico.conditional.min.css version since v2, which only takes effect on elements with class="pico" added, completely solving the problem of style conflicts with other UI libraries.

What is the difference between mysql full database recovery and single database recovery_mysql operation method instructions What is the difference between mysql full database recovery and single database recovery_mysql operation method instructions

09 Feb 2026

Full database recovery is to directly import the SQL file generated by mysqldump--all-databases, covering all libraries (including system libraries). The risk is high, but it is suitable for the entire instance crash; you must check the CREATEDATABASE statement, target library list and character set, SQL mode, permission library synchronization and other details.

How to secure your MySQL server? (Security Hardening Checklist) How to secure your MySQL server? (Security Hardening Checklist)

26 Feb 2026

MySQL security hardening requires disabling anonymous users and test libraries, restricting root remote login and creating dedicated management accounts, forcing TLS encryption, closing local_infile and other dangerous functions, and regularly checking key security variables.

Show More