Php prevents SQL injection code. Php Tutorial prevents SQL injection code * functioninject_check ($ SQL _str) {prevents injection of $ checkeregi (select | insert | update | delete | * | .. |. | union | into | load_file | outfile, $ SQL _st php Tutorial prevents SQL injection code
*/
Function inject_check ($ SQL _str) {// prevents injection
$ Check = eregi ('select | insert | update | delete | '|/* | .. /|. /| union | into | load_file | outfile ', $ SQL _str );
If ($ check ){
Echo "illegal injection content entered! ";
Exit ();
} Else {
Return $ SQL _str;
}
}
Function checkurl () {// check the origin path
If (preg_replace ("/https tutorial? : // ([^:/] +). */I "," 1 ", $ _ server ['http _ referer'])! = Preg_replace ("/([^:] +). */", "1", $ _ server ['http _ host']) {
Header ("location: http://www.zhutiai.com ");
Exit ();
}
}
// Call
Checkurl ();
$ Str = $ _ get ['URL'];
Inject_check ($ SQL _str); // you can perform this operation when obtaining the parameter.
Prevents SQL injection code */function inject_check ($ SQL _str) {// prevent injection $ check = eregi ('select | insert | update | delete | '|/* | .. /|. /| union | into | load_file | outfile ', $ SQL _st...