Originally posted by kilbey1
Ok, my states are protected in that they can only be chosen via a dropdown menu...I have no freeform data.
This offers protection analogous to a paper condom; it will only protect you from users who are a) honest (ie., chaste), or b) don't know how to manipulate POST, GET, or COOKIE data (ie., too young to know what goes where.)
For example, I use Firefox. One of my favorite extensions is called RequestPoison.What it does is allow me, the web developer, to submit arbitrary content to any form element on a page of my choice. Additionally, I can add elements to the form that aren't even on that page. The whole point is to provide a means for web developers to be able to test the security of their web apps. And for this, I love it. But it also has the effect of facilitating malicious users. And this is just one of many.
The point: always, always, ALWAYS check that the user submitted data is EXACTLY what you think it is. Or put differently, NEVER EVER trust data that you didn't explicitly create in the first place.
As for backslash() ... it's alright. It will not protect you from XSS (Cross-Site Scripting) attacks, however, as it allows HTML through without a peep. Use explicit length limits, and htmlspecialchars() and/or htmlentities(), to get around this.
You may want to look at the OWASP web site, which has a lot of great info on web application security.
As for the paging issue ... sessions are not a bad choice for pages ... but
$_SESSION = $_POST;
is a far cray from
if (preg_match('/^[0-9]{1,4}$/', $_POST['page']))
$_SESSION['page'] = $_POST['page'];