|
posted 03/4/2008 by Chris
Any input that you get from a user should be cleaned for malicious code. Here are some simple functions that will help...
- used to remove blank spaces from front and end of text trim($user_input)
- used to remove all html/javascript tags strip_tags($user_input)
- used to store any non-alphanumeric characters into a database safely htmlentities($user_input, ENT_QUOTES)
- used when getting text from a database to add the non-alphanumeric characters back in html_entity_decode($database_text, ENT_QUOTES) COMMENTS (displaying 0 comments) POST (leave a comment) |
POPULAR BLOG TAGS
bakery
flash
orwell
mit
google
drum machines
geek
routes
php
security
skateboard
ableton
brain
captcha
sports
open source
1984
php5tube
germans
color
quicksilver
cakephp
published
rot13
regular expressions
email
charlie
mbta
usort
launch
science
magazine
class
encryption
mailto
hobnox
code
spam
youtube
release
boston
defcon
snowboard
privacy
debuggeddesigns
as
trice
gmail
general
whoami
|