Hongmu Notes
Home Language Notes

Language Notes

css background color gradient attribute (linear

css background color gradient attribute (linear Language Notes CSS

Syntax: <linear-gradient> = linear-gradient([ [ <angle> | to <side-or-corner> ] ,]? <color-stop>[, <color-stop>]+) <side-o…
👁 239
After css is floated, the parent box has no height solution

After css is floated, the parent box has no height solution Language Notes CSS

As shown below, the child element div2 itself has height and width, but since it has float:left; attribute. Its parent element div1 has no height. <html> <head> </head> <body> <div id="div1"> <…
👁 171
css positioning

css positioning Language Notes CSS

Syntax: position: static | relative | absolute | fixed | center | page | sticky Default value: static Applies to: All elements except the display attribute defined as table-column-group | table-column Inheritance: No Animation: No...
👁 119
Implementation of two kinds of file downloads in php

Implementation of two kinds of file downloads in php Language Notes PHP

1. Directly add a file link 🔒 Hidden content: Viewable after logging in <button> <a href= "http://localhost/down.zip" > Download File </button> 2. Pass parameters to search for and redirect to a download link: Passing parameters: <button> <a href...>
👁 136
mysqli in PHP

mysqli in PHP Language Notes PHP PHP collection PHP and mysql

The `mysqli_num_rows()` function is exclusively used with `SELECT` query methods, whereas the `mysqli_affected_rows()` function returns the number of rows affected by the previous SQL statement across the entire database; this function is primarily used with `INSERT`, `UPDATE`, and `DELETE` operations.
👁 146
Summary of PHP integer division and rounding methods

Summary of PHP integer division and rounding methods Language Notes PHP

Four commonly used methods for applying the `intval` integer conversion function in PHP: 1. Direct truncation – discards the fractional part and retains the integer: `intval()`; 2. Rounding – rounds the number to the nearest integer: `round()`; 3. Ceiling – rounds the number up by adding 1 if it has a fractional part: `ceil()`; 4. Floor – rounds the number down to the nearest integer: `floor()`. I. `intval` – Converts a variable to an integer type; if the argument is a string, it is automatically converted to 0. Example: `intval(3.14159);`...
👁 146
php generate random numbers/generate random strings

php generate random numbers/generate random strings Language Notes PHP

Apply MD5 encryption to the timestamp and extract a portion of it: <?php function token($length){ $str = md5(time()); $token = substr($str, 5, $length); return $token;} echo token(6);?>
👁 159
Implementation of php caching function

Implementation of php caching function Language Notes PHP

Different websites require varying caching functionalities; some only need to cache the requested GET parameters, while others require caching the entire URL. Below is a commonly used caching code snippet that has already been written. Caching code: `<?php // Cache storage directory define('CACHE_ROOT', dirname(__FILE__). '/');`
👁 209
PHP 5 String functions

PHP 5 String functions Language Notes PHP

PHP string functions are an integral part of PHP core. No installation is required to use these functions. Function Description addcslashes() Returns a string with a backslash added before the specified character. addslashes() returns a string with backslashes added before predefined characters. bin2hex() Converts a string of ASCII characters to a hexadecimal value. chop() deletes words…
👁 169
php and HTML refresh current page

php and HTML refresh current page Language Notes PHP

PHP and HTML refresh the current page, which will be used many times, so record it! 🔒 Hidden content: You can view echo after logging in "&lt;script language=JavaScript&gt; location.replace(location.href);&lt;/script&gt;"; echo 'The server is busy, please&lt…
👁 149
1 27 28 29 30 31 33