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.

Batch rename HTML files to PHP files

Batch rename HTML files to PHP files Language Notes PHP

User-friendly and highly recommended. <?php // Security note: It is advisable to run this script in a test environment first and back up important files. echo '<h3>Batch renaming of HTML files to PHP</h3>'; // Check for the presence of a confirmation parameter if (isset($_GET['confirm']) && $_GET['conf...
👁 116
sqlite database online php read operation view, pbootcms database online view

sqlite database online php read operation view, pbootcms database online view Program Notes PbootCms Language Notes PHP

When using pbootcms, a database is often used, but the database of pb is a .db file, so it is very troublesome. There is no ready-made visualization page to view the database, so a php visualization page for php online viewing is developed here. This will be much more convenient. How to use? In the folder of the db file, create a php, put the following code in it, modify your database name, and then access p...
👁 167
Video streaming platform using DPlayer tutorial for playing M3U8 videos.

Video streaming platform using DPlayer tutorial for playing M3U8 videos. Language Notes PHP

First, load the necessary DPlayer CSS files: <link rel= "stylesheet" href= "https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.css">; and the JavaScript file: <script src= "https://cdn....">
👁 256
A novel reader written in html, php, ajax

A novel reader written in html, php, ajax Language Notes PHP CSS JavaScript Bootstrap

Pure reading version: <?php // index.php session_start(); $uploadDir = 'books/'; $booksFile = $uploadDir . 'books.json'; // Initialize the book storage directory if (!file_exists($uploadDir))…
👁 171
PHP+HTML+bootstrap simple page verification, beautiful

PHP+HTML+bootstrap simple page verification, beautiful Language Notes PHP Summary of pitfalls

Rendering, enter the password to access the original page. Super simple, super usable code! Code: // Verify password logic $correct_password = 'www.4s5.cn'; // Set the correct password $is_authenticated = false; if (isset($_POST['password'])) { i…
👁 273
When sql statements are queried in, they are sorted according to the order in in.

When sql statements are queried in, they are sorted according to the order in in. Language Notes PHP mySql

Original SQL statement: $sql=$empire->query("select classid,sonclass,classname,islast,islist from {$dbtbpre}enewsclass where classid in (1,22,239,241,75,80,45,62)…
👁 189
How to pass variables to js files in php? (How does the code in the js file obtain external variables?)

How to pass variables to js files in php? (How does the code in the js file obtain external variables?) Language Notes PHP JavaScript

If you want to pass variables from PHP into a JavaScript file, you have a few options: Inline JavaScript: You can use PHP variables directly in JavaScript code in an HTML file, just like you did in the example code. This allows PHP to include the values of PHP variables when generating JavaScript code. But this…
👁 210
When using Pagoda as a reverse proxy, how does PHP obtain the domain name of the source site?

When using Pagoda as a reverse proxy, how does PHP obtain the domain name of the source site? Language Notes PHP

Website: 4s5.cn now wants to access 123.4s5.cn through a reverse proxy. My current idea is to obtain the domain name 123.4s5.cn through 4s5.cn’s PHP! I have been exploring for a long time, and finally found that when writing reverse proxy rules, I can directly set the rules and pass 123.4s5.cn! location / { proxy_pass …
👁 224
PHP batch image width/height modification

PHP batch image width/height modification Language Notes PHP

Save this somewhere so you don't lose it – otherwise, you might spend a long time searching for it when you need it, or just save it when you don't need it! <?php die(); // $array = glob(__DIR__ . '/*.{jpg,jpeg,png,gif}',GLOB_BRACE); // print_r($array); // foreach ($array...
👁 142
EmpireCMS uses PHP to directly submit data for updating articles.

EmpireCMS uses PHP to directly submit data for updating articles. Program Notes Empire cms Language Notes PHP

Submitted code: While having some free time, I took the time to thoroughly study the Train Engine module and integrate it with Empire CMS, resulting in the following code. Experienced PHP developers are welcome to modify this code; however, this is merely a simple submission script – the data must be configured manually! <?php $url = "http://www.4s5.cn/e/admin/123.php"; // Replace this with the actual URL where the data should be received...
👁 386
1 2 3 4 22