+ 1
Php security
Hello guys and ladies I'm a beginner PHP developer and I have created my own CMS and I use this code to prevent vulnerabilities: Function escape($data){ $data = trim($data); $data = stripslashes($data); $data = htmlspecialchars($data); $data = mysqli_real_escape_string($data); return $data; } And Everytime I receive data I use this function to avoid from SQL injection, XSS and Other vulnerabilities. Please help me make it better and say your opinion.
2 Réponses
+ 2
To prevent embedding of HTML tags:
https://www.w3schools.com/php/func_string_strip_tags.asp
+ 1
👍