I'm trying to prevent XSS in my search forms. I've added this to escape HTML characters but this doesn't work. Any ideas?
$input = htmlspecialchars($input, ENT_QUOTES);
This is the search form I have
<form action="search.php" method="get">
<input type="text" name="q" value="search" />
<input type="submit" value="send" />
</form>