kmaid Posted October 4, 2008 Share Posted October 4, 2008 Need help filtering out XSS and SQL injection currently I validate all my user input using regular expressions but I am worried it may still leave some room for JavaScript or possibly mysql special characters. Currently to make sure I use function libStripInputSlashes() { $input_arr = array(); foreach ($_REQUEST as $key => $input_arr) { $_REQUEST[$key] = htmlspecialchars($input_arr); $_REQUEST[$key] = mysql_real_escape_string($input_arr); } } Are there any better solutions than using this? Thanks Kmaid Link to comment https://forums.phpfreaks.com/topic/127008-need-help-filtering-out-xss-and-sql-injection/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.