Hongmu Notes
Home Language Notes PHP

PHP

PHP (Hypertext Preprocessor) is a server-side scripting language particularly suited for web development and can be embedded within HTML. Its syntax is derived from the C language, incorporating features from languages such as Java and Perl to develop its own distinctive grammar; it has also been continuously refined and enhanced based on the strengths of these languages—for example, leveraging Java's object-oriented programming capabilities.

PHPStudy 8.2 Extension Fix

PHPStudy 8.2 Extension Fix Program Notes PHP Hobbies

I don’t know what’s wrong with php. After opening the 8.2 version of php, the extension cannot be installed. When opening the php.ini configuration, there is nothing. All, find a piece of content, fill it in, and the problem will be solved. [PHP] engine = On short_open_tag = On precision = 14 output_buffering = 4096 zli…
👁 1
PHP Questionnaire Survey System

PHP Questionnaire Survey System Program Notes PHP Hobbies Practical Collection

Questionnaire System · Complete Tutorial 1. System Architecture Data Flow User Fills in Questionnaire (index.php) │ │ POST FormData ▼ .api.php ←── Receive + record environment information (IP/OS/browser/device/time) │ │ Write JSON ▼ data/submissions.json │ │ Read ▼ ad…
👁 7
PHP batch compression of images in the server

PHP batch compression of images in the server Language Notes PHP

Directly copy this entire section and execute cat > /www/wwwroot/blog2.1.4s5.cn/compress.php << 'EOF' <?php /** * WebP image batch compression script */ // ---- Increase memory ---- ini_set('memory_limit', '…
👁 11
Empire cms8.0 search list page supports dynamic php code display

Empire cms8.0 search list page supports dynamic php code display Program Notes Empire cms PHP Summary of pitfalls

Empire cms updated to 8.0. During daily use, I discovered that this search list page does not support dynamic php code display, so I modified the code and put it here. <?php require("../../class/connect.php"); require("../../data/dbcache/class.php");…
👁 85
PHP queries the MySQL database, obtains each table, and then outputs the first eight data of each table.

PHP queries the MySQL database, obtains each table, and then outputs the first eight data of each table. Language Notes PHP mySql

php code<?php /** * Export the table structure of the MySQL database and the first 8 data of each table * Data is in reverse order by id (if there is no id, it is in reverse order by primary key/first column) * Database: 111, username: 11111, password: 1111 */ $host = 'localhost'; $user = '1111'; $pa…
👁 57
Practical Guide to Handling Prohibited Keywords in Website Advertising: Python-based Scanning + Baota Firewall Filtering + Keyword Database Management

Practical Guide to Handling Prohibited Keywords in Website Advertising: Python-based Scanning + Baota Firewall Filtering + Keyword Database Management Language Notes PHP PHP and mysql

Practical Guide to Handling Prohibited Keywords in Website Advertising: Python Scanning + Baota Firewall Filtering + Keyword Database Management. Author: Hongmu (QQ: 1810216796). First published on Hongmu Notes – GitHub: https://github.com/1810216796 (Full source code). 📌 Background: Recently, we received feedback from a client stating that their website contained prohibited advertising keywords – such as "First," "Best," and "National-Level" – which violated advertising regulations...
👁 106
PHP: Delete all files and folders in the current directory.

PHP: Delete all files and folders in the current directory. Language Notes PHP

The following is a secure PHP script designed to scan and delete all files and folders within the current working directory (excluding the script itself, unless otherwise specified). The script includes an interactive confirmation prompt to prevent accidental deletion. <?php /** * recursively delete all contents from a directory (excluding the directory itself) * * @param string $dir Path to the directory to be cleaned * @param...
👁 116
PHP – Output a website directory tree structure; Directory Tree Browser – Securely displays the tree structure of a specified folder.

PHP – Output a website directory tree structure; Directory Tree Browser – Securely displays the tree structure of a specified folder. Language Notes PHP

Directory Tree Browser – Securely displays the tree structure of a specified folder. How to use: 1. Place this file in the website's root directory and name it `tree.php` or any other name of your choice. 2. Modify the `TARGET_BASE` constant below to specify the root folder you wish to browse (relative to the website's root directory). 3. Access the page via your browser at: `http://yourwebsite/tree.php`. 4. Optional parameters: `?di...`
👁 170
A simple website backend using PHP + HTML.

A simple website backend using PHP + HTML. Language Notes PHP

后台代码:&lt;?php session_start(); // ============================ // 配置文件设置 // ============================ // 配置文件路径 $config_file = './config.php'; // 默...
👁 133
Batch add header configuration to PHP files

Batch add header configuration to PHP files Language Notes PHP

User-friendly &amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;amp;
👁 107
1 2 3 22