onedumbcoder Posted July 3, 2009 Share Posted July 3, 2009 so i have an input text box where someone enters a search word, but i having trouble eching back what they typed in, the single quotes are messing everything up $searchvalue = str_replace('\'','\\\'', stripslashes($searchword)); $searchvalue = "value='" . $searchvalue . "'"; is not working and I have no idea why I tried just using addslaches that didnt work, i tried it without it that didnt work. Please one of you gurus please help me! i am spending the day crying over this. :'( Link to comment https://forums.phpfreaks.com/topic/164714-warning-having-serious-issues-with-single-quotes-displaying-in-input-value/ Share on other sites More sharing options...
ldougherty Posted July 3, 2009 Share Posted July 3, 2009 So if I understand you clearly the search isn't working when someone puts a ' or " into the search box ie can't Try using mysql_escape_string http://us2.php.net/manual/en/function.mysql-escape-string.php Link to comment https://forums.phpfreaks.com/topic/164714-warning-having-serious-issues-with-single-quotes-displaying-in-input-value/#findComment-868595 Share on other sites More sharing options...
onedumbcoder Posted July 4, 2009 Author Share Posted July 4, 2009 basically what is happening is once the page renders what is inside the input box is not valid. the single quotes are missing. Link to comment https://forums.phpfreaks.com/topic/164714-warning-having-serious-issues-with-single-quotes-displaying-in-input-value/#findComment-868612 Share on other sites More sharing options...
trq Posted July 4, 2009 Share Posted July 4, 2009 Your going to need to describe your problem allot clearer than that. Link to comment https://forums.phpfreaks.com/topic/164714-warning-having-serious-issues-with-single-quotes-displaying-in-input-value/#findComment-868617 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.