drisate Posted February 19, 2008 Share Posted February 19, 2008 How to use this http://www.phpclasses.org/browse/package/2189.html?download=zip On a global scale for $_POST $_GET and $_REQUEST With out doing it one by one for every outputs Quote Link to comment Share on other sites More sharing options...
drisate Posted February 20, 2008 Author Share Posted February 20, 2008 Nobody? Quote Link to comment Share on other sites More sharing options...
awpti Posted February 20, 2008 Share Posted February 20, 2008 Post the code. Most of us don't feel like wading through the absolute mess that is phpclasses.org Quote Link to comment Share on other sites More sharing options...
therealwesfoster Posted February 20, 2008 Share Posted February 20, 2008 Here's something simple I do. <?php $post = array(); // empty var foreach ($_POST as $key => $value) { $post[$key] = addslashes( htmlspecialchars( $value ) ); } echo $post['username']; ?> So now, $post['username'] is the same at $_POST['username'].. except it's cleaned up Or, do it this way to make it a function. <?php function cleanRequest() { $post = array(); foreach ($_POST as $key => $value) { $post[$key] = addslashes( htmlspecialchars( $value ) ); } return $post; } $post = cleanRequest(); echo $post['username']; ?> Quote Link to comment Share on other sites More sharing options...
drisate Posted February 20, 2008 Author Share Posted February 20, 2008 lol yeah np hehe I attached the class to this message But from what i can see it's a one by one output filtrer ... how to make it global? (Thx Wesf90 but the XSS class seams to be alot more secure and since this is for a very big project i need to be the moste secure i can.) Quote Link to comment Share on other sites More sharing options...
drisate Posted February 20, 2008 Author Share Posted February 20, 2008 Any idea? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.