Ask an anti-injection question? & Lt; tr & gt; & lt; th & gt; Name: & lt; th & gt; & lt; td & gt; & lt ;? $ This-& gt; iff ($ flag, & nbsp; $ myBank [username], & lt; input & nbsp; nameusername & nbsp; placeholder: What about anti-injection?
Name:
Iff ($ flag, $ myBank ['username'],'')?>
There is no limit on other characters. some hackers can inject code. Is there a good way to prevent hackers from completely injecting code? Can only Chinese characters be entered?
------ Solution --------------------
Remove html tags PHP htmlspecialchars functions use regular expressions to match input
------ Solution --------------------
1) strip_tags (string str );
2) htmlspecialchars
3) preg_replace ("/<(. *?)> /"," ", $ Str );
------ Solution --------------------
Strip_tags
Htmlspecialchars
Two functions.
------ Solution --------------------
Use the php function mysql_real_escape_string to filter data and prevent injection.