Search the Community
Showing results for tags 'Sanatization'.
-
Hello, I have recently been attempting to make HTML forms in my website filtered by PHP strings... I have a PHP Filter that should work, However I am not sure on how to Integrate it into my HTML forms. Here is what I have right now... HTML Form <h3>Add Site Manual</h3><div class="addurlSmall">Enter the Site Title, Url and Description you want to add, it will automatically add it in the database</div><br /><?php require 'BannedWords.php';?><form action="/index.php?a=admin" method="post"><div class=""> Site Title: <input type="text" name="addtitle" value="" required /><br /> Site URL: <input type="url" name="addurl" value="http://" required /><br /> Site Description: <br /><textarea lass="ads" name="adddesc" required></textarea></div><br /><input type="submit" value="Add new result"/></form> PHP Filter. <?php$ban_array = array( 'Bad', 'Words', 'Here');$input_array = array ( 'adddesc', 'addurl', 'addtitle');$isvalid = true;foreach ( $ban_array as $v ) { foreach ( $input_array as $vv ) { if ( strpos($form->data[$vv], $v) !== false ) { $form->validation_errors[$vv] = 'Banned words in use!!'; return false; } }}?> Any help would be appreciated Thanks.