Sunday, April 7, 2013

Filter Input

Never trust on user input, always filter the data before send to server OR save in database.

Following are different type of filter which we must use
Email Address: Trim and validate the email address
Phone: Trim and validate the Phone number according to country.
Name: Strip tags, Trim the Name
URL/Website Name: Trim and validate the URL of the website.
Description : Strip tags, trim, remove bad words from the description

strip_tags: To Remove the Strip Tags like <script></script> or <a></a>
trim: To remove the Null & extra spaces from left / right.
htmlentities: To sanitieze the description.


No comments:

Post a Comment