Project Structure:
Operating effect:
conn.php
Copy CodeThe code is as follows:
$conn = @ mysql_connect ("localhost", "root", "") or Die ("Database link error");
mysql_select_db ("form", $conn);
mysql_query ("Set names ' GBK '"); Use GBK Chinese
Copy CodeThe code is as follows:
Require_once ("mssql.class.php");
1. Create a class and connect to the database
$DB = new MSSQL ("Dns=aaa;uid=sa;pwd=sa;dbname=test");
2. Connect to the database
$conn = $db->config
First, attach the code
Copy CodeThe code is as follows:
^[_.0-9a-z-]+@ ([0-9a-z][0-9a-z-]+.) +[a-z]{2,3}$
In this regular expression, "+" means that the preceding string has one or more occurrences; "^" means that the next string must appear at
phpMyAdmin is a frequently used MySQL management tool, backup and restore is an important function of phpMyAdmin, in the restoration of the database often encountered such a situation: phpMyAdmin restore the database when the maximum upload limit: 2,
These two days to achieve this function:
When a certain condition is reached, let the server send a message to the user, the number is more than one.
Basic idea: Linux timed scan, if you meet the conditions of the user, then send a text
Something that is often done and often thought of.
Obscure if condition
1) for | | The processing
The code above will take more time than the following code.
Although reducing the number of lines of code is a good goal, minimizing the
PHP Basic Knowledge Section
1. Ask for a value of $ A
Copy CodeThe code is as follows:
$a = "Hello";
$b = & $a;
Unset ($b);
$b = "World";
echo $a;
2. Find the value of $b
Copy CodeThe code is as follows:
$a = 1;
$x = & $a;
$b = $a + +;
Echo $b;
When we use curl to post data, we need to set the post data
curl_setopt ($c, Curlopt_postfields, $post _data);
If the $data here are
Copy CodeThe code is as follows:
$data = Array (
' Name ' = ' Scofield ',
' Time ' = ' 2012-2-3 '
)
Next, you
The first method: a function that comes with PHP
/*
Trim removes a string at both ends of a space,
RTrim is to remove a string to the right of the space,
LTrim is to remove the left space of a string.
*/
?>
Echo Trim ("space"). "
";
echo RTrim
A variable is NULL considered in the following cases:
is assigned a value NULL of.
has not been assigned a value.
Be unset ().
NULLType has only one value, which is a case insensitive keyword NULL (you can write null or write null)
first, the entrance
The import file can be a single file or multiple files, I now use the basic is a multi-file, but the content of the import file is basically the same, for the future to modify the other entrance method to do the basis,
Copy
Where is the 1.SESSION information stored?
Copy CodeThe code is as follows:
Session_Start ();
$_session[' name ']= ' Marcofly ';
?>
The session is saved to the C:\Windows\Temp directory by default, but you can change the save path of the session
However, to do so, there is no way to do some statistics, permission checks, and so on. So, many times, we use to let PHP to do the forwarding, to provide users with file download.
Copy CodeThe code is as follows:
$file =
Example: SQL injection attack
XSS attack
Copy CodeThe code is as follows:
Arbitrary code Execution
file contains and CSRF.
}
There are many articles about SQL attacks and various anti-injection scripts, but none of them can solve the fundamental
Process analysis of the client downloading files from the server:
The browser sends a request to access a Web page in the server (for example: down.php), the code for the page is as follows.
After the server accepts the request, run the down.php
Copy the Code code as follows:
$x = ' I am very long, how to change the line? ' I am very long,
How do I change lines? I am very long, how to change the line? I am very long,
How do I change lines? I am very long, how to change the line? ';
$xx =
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