Ivan Ivković Posted February 13, 2012 Share Posted February 13, 2012 I'm not sure if this is an HTML or browser issue... But single quotes in strings from database don't work for me in Chrome for some reason. To mine or any other computers. Every other browser detects these quotes. I'm outputting an SQL result containing strings like: Texas Hold'em or America's Cup and I get Texas Hold America Quote Link to comment https://forums.phpfreaks.com/topic/257061-single-quotes-issue-in-google-chrome/ Share on other sites More sharing options...
scootstah Posted February 13, 2012 Share Posted February 13, 2012 What does the source look like? Quote Link to comment https://forums.phpfreaks.com/topic/257061-single-quotes-issue-in-google-chrome/#findComment-1317698 Share on other sites More sharing options...
Pikachu2000 Posted February 13, 2012 Share Posted February 13, 2012 Where are you outputting them? Into form fields? If so, did you quote the name= attributes? Are you using htmlentities or html_special_chars? Quote Link to comment https://forums.phpfreaks.com/topic/257061-single-quotes-issue-in-google-chrome/#findComment-1317699 Share on other sites More sharing options...
Ivan Ivković Posted February 13, 2012 Author Share Posted February 13, 2012 It would be easier if you see for yourself. I'm using Zend I guess I don't need those functions. And its working in Firefox, so I guess it's not a PHP issue? http://www.sportville.co/signup/user Quote Link to comment https://forums.phpfreaks.com/topic/257061-single-quotes-issue-in-google-chrome/#findComment-1317700 Share on other sites More sharing options...
Psycho Posted February 13, 2012 Share Posted February 13, 2012 The problem is not with Chrome - it is with the code. It just seems that FF is correcting the error - something you should not be relying on. I didn't check all of your code, but I found this one line that would cause problems <option label='People's Democratic Republic of Yemen' value='YD'>People's Democratic Republic of Yemen</option> You use single quotes to enclose the value for the label parameter. But, that value ALSO has a single quote mark in it. You could do several things: 1. Use double quotes (as long as no values use double quotes) 2. Use addslashes() 3. Use htmlspecialchars() Quote Link to comment https://forums.phpfreaks.com/topic/257061-single-quotes-issue-in-google-chrome/#findComment-1317704 Share on other sites More sharing options...
smerny Posted February 13, 2012 Share Posted February 13, 2012 if you use htmlentities($string, ENT_QUOTES) for the fields that may have quotes in them, it should clear that up. as psycho mentioned, the problem is you have this for example: label='Texas Hold'em Bonus Poker' the above function would change it to: label='Texas Hold'em Bonus Poker' which would show up in the browser how you want it Quote Link to comment https://forums.phpfreaks.com/topic/257061-single-quotes-issue-in-google-chrome/#findComment-1317705 Share on other sites More sharing options...
Ivan Ivković Posted February 13, 2012 Author Share Posted February 13, 2012 Thanks mates! Fixed it. I'll strangle my employee. Quote Link to comment https://forums.phpfreaks.com/topic/257061-single-quotes-issue-in-google-chrome/#findComment-1317717 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.