Posted by Juan Manuel
2015-02-11

Hi! Do we have a form to prevent duplicate entries based on a certain field? Say, the username is an input... and I want to check against the DB that the same username is not already registered. On the other hand, I would like to know if there's a way to remove all HTML tags or scripts from a textarea. Thanks so much!!
Posted by Tom
2015-02-17

Hi,

>Do we have a form to prevent duplicate entries based on a certain field?

You may want to take a look at CheckUsernameConflict function in web/staff/app/cls_ps_staff.inc.php. The function checkes if the user enters an username that alaready exists in the database. The function is not very general, so you still need to understand how it works and modify it appropretely for your needs.

>sanitize HTML

Do you really need to sanitize HTML? You can make HTML tags ineffective when you display it on a page using the htmlspecialchars PHP functiion. Normally, that's enough. If you really need to remove HTML tags, then you need to write code yourself or use some prewritten PHP libraray do do so.