Hello, I have a search script, it does these $ismial1 = $_REQUEST['search']; $ismial1 = strip_tags($ismial1); $ismial1 = htmlspecialchars($ismial1); $ismial1 = htmlentities($ismial1); $ismial1 = trim($ismial1); but when user search something like this with quotes James o"keefe it get the search title like = James o\"keefe
Simplified: <?php $ismial1 = trim(htmlspecialchars(strip_tags($_REQUEST['search']))); ?> PHP: You don't need to run htmlspecialchars() aswell as htmlentities() one of them is just fine
Perhaps you have magic_quotes enabled, since i tested and it outputs correctly how you'd like it, try the following: <?php $ismial1 = trim(htmlspecialchars(strip_tags($_REQUEST['search']))); if (get_magic_quotes_gpc()) { $ismial1 = stripcslashes($ismial1); } echo $ismial1; ?> PHP: