Baidu's online storage is fast and stable, and you deserve it. If you support direct connection in the future, you can directly use Baidu's online storage.
The temporary solution is provided here, which cannot be used in the future.
Set the
After setting the read-only attribute for the index. php file, the trojan will not have the permission to append an advertisement to the end of the file.Let's take a look at the specificCode, SET index. php read-only:
Copy code The Code is as
When you need to output the number of website user registrations, or determine whether duplicate records exist before inserting data, you need to obtain the number of MySQL query records that meet the conditions.
Method 1: make statistics
CopyCodeThe Code is as follows: $ sql3 = "create temporary table atmp_table (UID int (11), dnum int (20) not null )";
Mysql_query ($ sql3 );
$ Sql3 = "insert into atmp_table (UID, dnum) Select uid, count (soid) as dnum
From 'cy _ score2'
Where
CopyCode The Code is as follows: /* Copy the xcopy function usage:
* Xcopy ("feiy", "feiy2", 1): copy the files in feiy to feiy2, including subdirectories.
* Xcopy ("feiy", "feiy2", 0): copy the file under feiy to feiy2, excluding subdirectories.
*
Copy codeThe Code is as follows: $ array = explode (separator, $ string );
$ String = implode (glue, $ array );
The key to using and understanding these two functions is the relationship between the separator and glue. When an array is converted
Copy codeThe Code is as follows:
// Linked list NodeClass node {Public $ id; // node idPublic $ name; // node namePublic $ next; // next node
Public function _ construct ($ id, $ name ){$ This-> id = $ id;$ This-> name = $ name;$ This-> next = null;
Configure system Constants
1. Check and configure these preferences when the file system is working.
When the file system is running, these default values will increase the security of the system. However, when the underlying layer of php or apache
We often see some websites that display the browser type and language you are currently using. For example, the browser you are using is IE6 or traditional Chinese. Does it look so dazzling.
In fact, this function is not difficult to implement. It
Sometimes we need to use a random user name and password in the application, which can greatly improve the security of the application. To generate a random user name and password in PHP, you can use the mt_rand function or the rand function, the
Differences among flush (), ob_flush (), and ob_end_flush:
First, let's talk about the buffer, which is a memory address space of 4096 (1 kb) [in php. output_buffering configuration is found in the ini configuration file. php has the php
1. Singleton Mode
The Singleton Mode means that only one instance of this class exists in the application at any time. Generally, we use the singleton mode to allow only one object to access the database, thus preventing multiple database
In fact, it is also relatively simple, on the Code:
Copy codeThe Code is as follows:
$ Url = 'HTTP: // 127.0.0.1/test. php'; // The Link pointed to by POST$ Data = array ('Access _ token' => 'thekeyvalue');
$ Json_data = postData ($ url, $ data )
Description: preg_replace: searches and replaces regular expressions. If you only want to match strings, we recommend that you use str_replace () because of its high execution efficiency.Mixed preg_replace (mixed pattern, mixed replacement, mixed
Copy codeThe Code is as follows: class HtmlEncode {
Static $ _ convertToHtmlEntitiesSrcEncoding = 'utf-8 ';
/*** Convert a non-ASCII string to an HTML Object** @ Example HtmlEncode: encode ("I believe"); // output: I believe* @ Param string $ s
Copy codeThe Code is as follows: // For example, the stored procedure to be called is gxtj (a, B)
$ Db = new mysqli ("localhost", "ssss", "aaaaa", "bbbb ");
Mysqli_query ($ db, "set names utf8 ");
$ Result = $ db-> query ("call gxtj ($ year, $ jd)");
Processing of js returned data by php json_decodeAfter php json_decode, the data returned to the front-end is: encode_str = "{" green ": 10," size ": 5," strock ": 12}Then js uses eval ("obj =" + encode_str + ";");Json data can be instantiated as an
When calling a function, you assign the PHP array as a real parameter to the form parameter. Modifying the parameter in the function does not affect the array.
This process is passed as a value. The array variable is not a reference to the array
Copy codeThe Code is as follows: Function deldir ($ dir ){
// Delete the files in the directory first:
$ Dh = opendir ($ dir );
While ($ file = readdir ($ dh )){
If ($ file! = "." & $ File! = ".."){
$ Fullpath = $ dir. "/". $ file;
If (! Is_dir ($
Is there any way to automatically clear temporary folders?
The following code is a php code that cleans up files in a folder at regular intervals.Ps: this code will continue to be executed without restarting the website, so it is only used for
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service