1. The Htmlspecialchars () function converts some predefined characters into an HTML entity function prototype: Htmlspecialchars (String,quotestyle,character-set) predefined characters are: & (And) Becomes & "(double quotation mark) becomes"
Php protects against SQL injection. htmlspecialchars (), addslashes (), and so on are generally used. However, it still does not work for some special characters. but we can replace it with regular expressions:
The code is as follows:
: This article describes how to use the trim function in PHP to remove spaces and special characters from the left and right sides of a string. For more information about PHP tutorials, see. This example describes how PHP uses the trim function to
Some symbols cannot be directly transmitted in the URL. If you want to pass these special symbols in the URL, you need to use their encoding. The following table lists some special URL symbols and codes.
Hexadecimal value1. In the + URL, the plus
Special characters in the URLSome symbols cannot be passed directly in the URL, and if you want to pass these special symbols in the URL, they will be encoded. The encoded format is: The ASCII code of the% plus character, which is a percent percent,
But we can replace it with a regular:
Copy CodeThe code is as follows:
function Dhtmlspecialchars ($string) {
if (Is_array ($string)) {
foreach ($string as $key = = $val) {
$string [$key] = Dhtmlspecialchars ($val);
}
} else {
$string =
The Basic Encoding Rules are as follows:1. Replace space with the plus sign (+)2. The forward slash (/) is used to separate directories and subdirectories.3. Question mark (?) Separate URLs and queries4. Specify special characters for the percent
The desktop icon, which is composed of special characters in the system wingdings, fully embodies an interesting application of wingdings. Using wingdings to add a lot of colors to Your webpage, such as some labels, you can use wingdings instead of
Http://bugs.sun.com/bugdatabase/view_bug.do? Bug_id = 4415733Http://bugs.sun.com/bugdatabase/view_bug.do? Bug_id = 4244499
A long-history bug, but sun does not seem to be eager to modify it. But we have to rely on java.Fortunately, there are more
I have been using several functions here and I will post them below.We hope to try to use the instance instead of simply using it, without worrying about its original meaning and Implementation ideas. Come on!
Using System;Using System.
Copy codeThe Code is as follows:Asp: TextBox ID = "txtFolderNameEng" CssClass = "frmTxt" runat = "server" MaxLength = "200" onkeypress = "TextValidate ()">Use the above method in the onkeypress event of textbox.You can restrict the input *,&,\,/,?, |
Function Name
Meaning
Introduction
Htmlspecialchars
Convert the Ampersand, single double quotation marks, greater than or less than sign into HTML Format
& Convert to & amp;"To & quot;'Convert to & #039;> Convert to & gt;
1. escape characters in sqlikte
Select * from table where number like '%/%' escape '/'
When the sqlite3 database is searching, some special characters need to be escaped,The escape is as follows: / -> // ' -> '' [ -> /[
1. Regular shape (circle, triangle, square, and diamond)
○ ⊙ ◎ Very large 。。. ° O. · lower • ● lower cost☉When there are too many threads, there are too many threads.
‧ □ {{{}}{{{{{{{}}}}☒■ 〓 ▁ ▂ ▃ ▄ ▅ ▇ █ ▋ ▌ ▍♢◇ ◆
2. graphical symbols♂♀♤♡◇♧❥☜☞☏
Pay enough attention to special characters such as quotation marks and angle brackets that may be entered by users, which may cause serious security problems. One of the basic methods of SQL injection is to use the security vulnerability that does
Often consulted, so reproduced: http://wenku.baidu.com/view/4a48193b376baf1ffc4fad8d.html
Textproperties in the document:
Use _ (underline) as the subscript ^(TIP)
\ BF -- simhei
\ It -- Italic
\ Sl-oblique font (rarely used)
\ Rm -- normal font
\
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.