The htmlspecialchars () function in php will
The htmlspecialchars () function converts some predefined characters into HTML objects.
The predefined characters are:
& (And number) becomes & amp;
"(Double quotation marks) into & quot;
'(Single quotes) becomes & #039;
<(Less than) to become <;
> (Greater than) to become & gt;
Once <script> is changed to the & lt; script format, this js will not be executed.
Mysql injection prevention:
If (get_magic_quotes_gpc ()){
$ Name = stripslashes ($ name); // stripslashes () is used to clear the data obtained from the database or elsewhere. "\" Added by addshashes "\"
} Else {
$ Name = mysql_real_escape_string ($ name); // mysql_real_escape_string () mainly escapes 'and"
}
In addition, mysql cannot execute two statements in the same query. For example, mysql_query ('select * from table1; drop table B ;');
This is not acceptable.
From mountain's home