You must remember to define the character types later in the writing process.
mysql_query ("Set names ' GBK '")
The solution is so simple.
Today I made a database query, releasing the code.
Copy CodeThe code is as follows:
/*
filename:query.php
Do:
Index.asp page Code
Copy CodeThe code is as follows:
Set cmd = Conn.execute ("Select Bigclassid,bigclassname from Bigclass")
Tempid=cmd ("Bigclassid")
%>
">
">
No small class"
Response.Write html
End If
%>
Ajax.js Code
Copy CodeThe
In addition, the current noisy and vigorous SQL injection also has a lot of use in PHP, so to ensure security, PHP code is written on the one hand, PHP configuration is very critical.
We PHP hand-installed, PHP default configuration file
Find a little time on the internet, find it is not how.
Later, I thought of a way, is the original it.
Just use the Intercept plus replace function.
Copy CodeThe code is as follows:
function Smssubstr ($string, $length) {
if (strlen ($string)
The Repeater control does not have built-in rendering capabilities, which means that the user must provide a layout for the Repeater control by creating a template. When the page runs, the Repeater control renders an item for each record, in turn,
Say in front:1, the following topics, in addition to programming tasks need to be written on the papyrus provided to you. Paper is precious Earth resources, please save the use. Programming tasks in the corresponding environment, will require the
It took a day to make a point.
Do AJAX applications or flash applications, submit Chinese content to the background, involving encoding and decoding (encode, decode) and encoding format conversion.
The PHP end of the Internet unescape function is
The functions that are discarded in php5.3 are:
Ereg ()///Mb_ereg instead, or Preg_match instead, but matching rules need to be used/included.
Eregi ();//preg_match instead, add I after the rule, such as: Preg_match ("/^ (Style|style_) (. *) */i",
Loading basic files
Cake/basics.php defines common methods and time constants.
$TIME _start = Getmicrotime (); Record Start execution time
cake/config/paths.php defines some basic paths
Basic classes of cake/lib/object.php
Copy CodeThe code is as follows:
/*
1 (? s) represents Pattern.dotall, which is the matching newline, allowing the IMG to appear in multiple lines
2. * represents non-greedy matches any character until a later condition occurs
3: Represents this
Want to implement a function: A website invitation activity, then the participant (owner) to the promotion of the website address link to friends, friends click the link after the site registration success, owner's invitation log record number plus 1
PHP has $_get,$_post, but no $_put, so if you need to use it, then you have to simulate it yourself:
Copy CodeThe code is as follows:
$_put = Array ();
if (' PUT ' = = $_server[' Request_method ')} {
Parse_str (file_get_contents (' Php://input '), $
Today made a day, finally put Win2003 under the problem to solve, LoadModule php5_module E:\server\php528\php5apache2_2.dll may have some friends also know, add this sentence, You don't have to copy the php.ini to the system directory: Phpinidir
Upload CVS and import into the database, the test is successful (some of the code is not standardized, such as php_self there to rewrite into $_server["php_self"])
PHP code
Copy CodeThe code is as follows:
$fname = $_files[' MyFile ' [' name '];
$
First make sure that PHP has been extended
In the php.ini
Copy the Code code as follows:
Extension=php_curl.dll
and to ensure that
Php_curl.dll copied to the PHP installation directory under EXT, Libeay32.dll and Ssleay32.dll copied to the PHP
If the traffic is large, it will be a huge burden on the database, so it is very necessary to do the PHP data cache (cache) for the content of the change infrequently, I have made a simple php "file cache" class, I hope to be helpful to
Mysql_real_escape_string ()
So the SQL statement has a similar wording: "SELECT * from CDR where src =". $userId; Change to $userId =mysql_real_escape_string ($userId)
All printed statements, such as Echo,print, should be filtered using
Introduce two methods, first, save the following code as safe.php in the root directory of the Web site, and then add an include ("/safe.php") in front of each PHP file:
PHP Anti-injection code method one:
Copy CodeThe code is as follows:
Illegal
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