PHP is a very easy
language to learn, and many people without any sort of background in
programming learn it as a way to add interactivity to their web sites.
Unfortunately, that often means PHP programmers, especially those newer to web
development, are unaware of the potential security risks their web applications
can contain. Here are a few of the more common security problems and how to
avoid them.
Rule Number One:
Never, Ever, Trust Your Users
It can never be said
enough times, you should never, ever, ever trust your users to send you the
data you expect. I have heard many people respond to that with something like
"Oh, nobody malicious would be interested in my site". Leaving aside
that that could not be more wrong, it is not always a malicious user who can
exploit a security hole - problems can just as easily arise because of a user
unintentionally doing something wrong.