This post was last edited by u010572351 on 2013-06-27 21:10:49
At the moment I know that SQL attacks are filled with a lot of '% ' such special characters to implement, if I am the login interface want to prevent SQL attacks,
I know that the user name and password do not appear special characters, I use regular match, as long as there is a special character I will directly kill it, so deal with it?
Also, what do addslashes generally do? Trouble master more share under anti-injection these, l
and directly
Replace it.
------ Solution --------------------
If the value is passed, use ceil ($ _ get ['okid.
------ Solution --------------------
if(!get_magic_quotes_gpc()){!empty($_POST)Add_S($_POST);!empty($_GET)Add_S($_GET);!empty($_COOKIE)Add_S($_COOKIE);!empty($_SESSION)Add_S($_SESSION);}!empty($_FILES)Add_S($_FILES);functionAdd_S($array){if(is_array($array)){foreach($arrayas$key=>$value){if(!is_array($value)){$array[$key]=addslashes($value);}else{Add_S($array[$key]);}}}}
Fil
mechanism.
5, addslashes () and stripslashes ()
The addslashes () function adds a backslash before the specified predefined character. The predefined characters are: single quotes (') double quotation marks (") backslash (\) NULL
$str = "Is your name O'reilly?";// Outputs: Is your name O\'reilly?echo addslashes($str);
The stripslashes () function deletes the backslash added by the addslashes () function.
4, get_magic_quotes_gpc ()
Int get_magic
= array ();
If (ctype_alnum ($ _ post ['username'])
{
$ Clean ['username'] =_ _ post ['username'];
}
?>
Although regular expressions can be used in this case, PHP built-in functions are more perfect. These functions are much less likely to contain errors than your own code, and an error in the filtering logic almost means a security vulnerability.
1.3.4. Output escape
Another Web Application Security Foundation is to escape the output or encode special characters to ensu
Tags: Book Book O 'Reilly O'reilly media, Inc. is a leading publishing company in the world in the Unix, X, Internet, and other open-system book fields. It is also a pioneer in online publishing. From the best-selling "the whole Internet User's Guide amp; catalog" (one of the 50 most important books in the 20th century by the New York Public Library) to GNN (the earliest Internet portal and commercial website), to website (the first desktop PC we
Learning opencv (Chinese Version)
[Original book name] Learning opencv: computer vision with the opencv Library[Original Publishing House] O 'Reilly media, Inc.Author: Gary bradski and Adrian kaehlerTranslated by Yu Shiqi and Liu Ruiqi [same translator's work][Description] Tsinghua University Press o''reilly Series[Publishing Club] Tsinghua University Press [book no.] 9787302209935[Shelving time][Publicat
Original Title: R cookbook author: Paul teetor Translator: Li Hongcheng Zhu wenjia Shen Yicheng series name: O 'Reilly boutique Books Series Press: Machinery Industry Press ISBN: 9787111420217 mounting Date: May 2013 publication date: Opening: 16 open pages: 1 version: 1-1 category: for more information about computers, and introduction to "classic instances of R language", computer books, and "classic instances of R language: o'reilly media spreads i
Original Title: programming iOS 5, second edition original Publishing House: O 'Reilly media Author: Matt neuburg Translator: Chen jianliu Yang: O 'Reilly boutique book series Publishing House: Machinery Industry Publishing House ISBN: 9787111418474 Release Date: April 2013 publication date: 16 open pages: 763 versions: 2-1 category: computer> Software and programming> mobile development> more about iPhone,
strings together to create a valid SQL command. Therefore, I think the statement object can simplify the creation and execution of dynamic SQL commands.
4. Use the Helper function to format dynamic SQL commands
When creating a dynamic SQL command executed using the statement object, we need to solve some formatting problems. For example, if we want to create an SQL command to insert the name 'Reilly into the table, we must replace the "'" In '
2616 if you are interested.
Learn about the HTTP protocol:
1. O 'Reilly-HTTP pocket reference: This is a short book about the HTTP protocol. It can be used as an entry guide.
2. O 'Reilly-HTTP the definitive guide: this is a typical book, because it contains a lot of content and can be used as the first choice for HTTP protocol learning.
3. Sams-HTTP developers Handbook: This is a little simpler than http
and execution of dynamic SQL commands.
4. Use the Helper function to format dynamic SQL commands
When creating a dynamic SQL command executed using the statement object, we need to solve some formatting problems. For example, if we want to create an SQL command to insert the name 'Reilly into the table, we must replace the "'" In 'Reilly with the two connected. The best way to do this is to create a helper
, unless SQL commands are processed in batches, we should consider using the statement object.
In addition, using the statement object makes it easier to write dynamic SQL commands, because we can connect strings together to create a valid SQL command. Therefore, I think the statement object can simplify the creation and execution of dynamic SQL commands.
4. Use the Helper function to format dynamic SQL commands
When creating a dynamic SQL command executed using the statement object, we nee
, readfds ))Printf ("A key was pressed! \ N ");ElsePrintf ("timed out. \ n ");}If you are on a line buffered terminal, press enter (return). Otherwise, it times out in any case.Now, you may think that this is the way to wait for data on the datagram socket-you are right: it may be. Some UNIX systems can use this method, while others cannot. You may have to check the man page of the system before trying it.Last thing about select (): If you have a set of characters that are listening (Listen, yo
added to C #3.0 were mostly centered on Language Integrated Query
Capabilities or LINQ for short.
The C #3.0 features added to support LINQ comprised implicitly typed local variables,
Anonymous types, object initializers, lambda expressions, extension methods, query
Expressions and expression trees.
C #3.0 also added automatic properties and partial methods.
After reading this book, I will have a deep understanding of the latest situation of C # And have also reviewed the previou
stage isThe C language must have a solid foundation. If you have read the Expert C Programming, you will not find it difficult.Can basically use vim and Emacs, one of which.Makefile is basically written.This is an essential book for learning at this stage. The author, Steven, is a senior whom I admire very much. Unfortunately, this book is just a few years old.It is comprehensive and difficult to learn at the beginning, but it is not a small benefit to stick to it. The second edition has been i
Valid Java programming language guide
By Joshua Bloch
Addison-Wesley professional
Paperback, 252 pages
Design Patterns: Elements of reusable object-oriented software
By Erich Gamma; Richard helm; Ralph Johnson; John vlissides
Addison-Wesley professional
Hardcover, 395 pages
Head first design patterns
By elisw.freeman; Eric Freeman; Bert Bates; Kathy siider
O 'Reilly media, Inc.
Paperback, 676 pages
Expert one-on-one J2EE design and development
HTML 5 Application Development Practice GuideOriginal title of basic information: programming HTML 5 applications Author: Zachary kessin Translator: Chen shengxiang Wang endeavor series name: O 'Reilly boutique Books Series Press: Machinery Industry Press ISBN: 9787111414513 Release Date: april 2013 publication date: December 29,: 16 webpage: 1: 1-1 category: Computer
For more information, see "HTML 5 Application Development Practice Guide". Computer
connection. This two parameter can be used together, which means that the SSH connection is used only to transmit data and does not perform remote operations.
$ ssh-nt-d 8080 Host
The f parameter, which indicates that the SSH connection is successful and runs in the background. This allows you to perform other operations in the local shell without interrupting the SSH connection.
$ ssh-f-D 8080 Host
To close this background connection, you only kill the process with
Book DescriptionThe canvas element is a revolutionary feature of HTML5 that enables powerful graphics for rich Internet applications, and this pocket reference provides the essential tials you need to put this element to work. if you have working knowledge of JavaScript, this book will help you create detailed, interactive, and animated graphics-from charts to animations to video games-whether you're a web designer or a programmer interested in graphics.
Canvas pocket referenceProvides both a
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.