jackpf Posted April 1, 2009 Share Posted April 1, 2009 Hi all, I'm having a problem with hidden inputs with quotes on my site. When someone goes to post on the forum, if someone has posted while they were typing, it will save their post into a hidden input and prompt them to continue. However, the problem is that if the post contains quotes, it messes up the hidden input. I don't want to convert it to html special characters as the post may contain html. Is there any way to escape the quotes? Any help appreciated, Jack. Quote Link to comment https://forums.phpfreaks.com/topic/152064-solved-hidden-input-with-quotes/ Share on other sites More sharing options...
lonewolf217 Posted April 1, 2009 Share Posted April 1, 2009 <?php $string = str_replace("\"","\\"",$string); ?> Quote Link to comment https://forums.phpfreaks.com/topic/152064-solved-hidden-input-with-quotes/#findComment-798539 Share on other sites More sharing options...
jackpf Posted April 2, 2009 Author Share Posted April 2, 2009 Yeah...that doesn't really work I fixed it now anyway though - I used javascript to populate the input. Thanks anyway. Quote Link to comment https://forums.phpfreaks.com/topic/152064-solved-hidden-input-with-quotes/#findComment-799246 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.