I'm using PHP to store some session variables to track what users enter into a search form, then we can restore these if they need to start their search again. This is all working well, except for the following.
Users are allowed to wrap a search string with double quote marks which will perform a different type of search on that field (exact match). If a user enters text like this into one of the text search field:
"heart condition"
the seach works and the value is retained in the PHP session variable, but when we come to restore it when doing the search again it fails. Here's the code for restoring the text input:
<input type="text" id="condition" name="condition" value="<?php echo $conditionSearchValue; ?>">
I gather the double quote marks are causing the problem as this would be:
<input type="text" id="condition" name="condition" value=""heart condition"">
Is there a way to restore the input with the double quote marks that I don't know about?
Thanks