prova ad usare

codice:
htmlentities(stripslashes($_POST["query"]))