Strings can be escaped in php before inserting them into database. But what happens, if an user of my website enters a php code?
For eg. An user submits the following to a form, which escapes the string and inserts the data into my database.
Hello! <?php echo 'this is evil'; ?>'
Then this php line will be stored in the database. And when I display the content, it will be converted into this :
<div>Hello!<?php echo 'this is evil'?></div>
Isn't this a potential security risk? As the php code can be very malicious?
Does this mean I have to use strip_tags
on every user input?