<?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

31 Aug 2025
This tutorial details how to use PHP and HTML to achieve the function of dynamically filtering HTML table data. By setting buttons with GET parameters, users can filter table rows according to the proxy status (such as online, offline, disconnected), thereby efficiently retrieving and displaying data in specific states on the server side, improving the interactivity of data display. The article also emphasizes the security issues and preventive measures of SQL queries.

16 Apr 2025
Say you have a list of 100 names:

03 Sep 2025
This article introduces in detail how to use PHP and URL GET parameters to achieve dynamic filtering of HTML table data obtained from the database. By creating a button with specific status parameters, the user can click the button, and the server-side PHP script modifies the SQL query based on the received parameters, so that only table rows that meet the conditions are displayed. The tutorial highlights the use of preprocessing statements to prevent SQL injection attacks and provides complete code examples and security practice suggestions.

25 Jul 2025
In relational databases, it is not supported to directly define "conditional foreign keys" to implement foreign key constraints based on specific values. However, at the application layer, we can flexibly implement conditional loading and filtering of associated data through query builders (such as LaravelEloquent), thereby achieving a "conditional connection" effect. This article will introduce in detail how to use the with method and its closure parameters in LaravelEloquent, conditional filtering of the association model, and how to use whereHas to filter the main model.

31 Jul 2025
The core difference between WHERE and HAVING is the filtering timing: 1. WHERE filters rows before grouping, which are used to exclude original records that do not meet the conditions; 2. HAVING filters the aggregate results after grouping, which are used to filter groups that meet the conditions. For example, when querying active employees, use WHEREstatus='active', and when screening department users exceed 5, use HAVINGemployee_count>5; the two can also be used in combination, first reduce the amount of data through WHERE, and then filter the aggregated results through HAVING. For example, first filter full-time employees and then filter departments with an average salary of more than 60,000. Correct use of both can improve query efficiency and accuracy.

03 Sep 2025
This article will guide how to use PHP and GET parameters to implement dynamic filtering of database data in HTML tables. By setting filter buttons on the page, users can refresh and display corresponding data rows in real time according to specific status (such as online or offline), effectively managing and displaying a large amount of information.


Hot Tools

A collection of 50 excellent classic PHP algorithms
Classic PHP algorithm, learn excellent ideas and expand your thinking

PHP library for dependency injection containers
PHP library for dependency injection containers

Small PHP library for optimizing images
Small PHP library for optimizing images
