Php security | Sololearn: Learn to code for FREE!


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.

9/1/2020 1:09:19 PM


2 Answers

New Answer


To prevent embedding of HTML tags: