wmguk Posted March 18, 2009 Share Posted March 18, 2009 Hey, I've got a small CMS system running, and for some reason the CMS script adds  to the pages on display and in the DB but not in the preview page script.... its only near the £ so it says on the main php page: 1 Twin-bedded room (ensuite): £82 - £86 this should be 1 Twin-bedded room (ensuite): £82 - £86 I've added some script... include 'admin/scripts/connection.php'; $sql="SELECT * FROM cmssystem WHERE name = 'rooms'"; $result=mysql_query($sql); while($row = mysql_fetch_array($result)) { $text1 = $row['content']; $content = str_replace(chr(192), " ", $text1); echo $content; } but that doesnt remove it.... any ideas what it could be? I thought charset, but my pages all start: !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> Link to comment https://forums.phpfreaks.com/topic/149938-cms-script-adds-%C3%A2-to-the-pages-on-display-and-in-the-db/ Share on other sites More sharing options...
wmguk Posted March 18, 2009 Author Share Posted March 18, 2009 scrub that, i was using the wrong chr... $content = str_replace(chr(194), " ", $text1); worked fine Link to comment https://forums.phpfreaks.com/topic/149938-cms-script-adds-%C3%A2-to-the-pages-on-display-and-in-the-db/#findComment-787455 Share on other sites More sharing options...
redarrow Posted March 18, 2009 Share Posted March 18, 2009 read this please.. http://dev.mysql.com/tech-resources/articles/4.1/unicode.html Link to comment https://forums.phpfreaks.com/topic/149938-cms-script-adds-%C3%A2-to-the-pages-on-display-and-in-the-db/#findComment-787457 Share on other sites More sharing options...
wmguk Posted March 18, 2009 Author Share Posted March 18, 2009 hi ya, thanks for that I checked my DB and its utf8_general_ci so i didnt think it would be the problem Link to comment https://forums.phpfreaks.com/topic/149938-cms-script-adds-%C3%A2-to-the-pages-on-display-and-in-the-db/#findComment-787461 Share on other sites More sharing options...
wmguk Posted March 19, 2009 Author Share Posted March 19, 2009 hmmm, ok, so I have a page that is set as: <?php header("Content-type: text/html; charset=utf-8");?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> my DB is set - utf8_general_ci but i get a square image instead of a £ symbol now? any ideas? If i view the db it shows a £ but as soon as that hits my page its a symbol!? Link to comment https://forums.phpfreaks.com/topic/149938-cms-script-adds-%C3%A2-to-the-pages-on-display-and-in-the-db/#findComment-788341 Share on other sites More sharing options...
dgoosens Posted March 19, 2009 Share Posted March 19, 2009 hi I think you don't communicate in UTF-8 with you database... you can read all about it here: http://www.tanzilo.com/2008/10/13/ Link to comment https://forums.phpfreaks.com/topic/149938-cms-script-adds-%C3%A2-to-the-pages-on-display-and-in-the-db/#findComment-788345 Share on other sites More sharing options...
wmguk Posted March 19, 2009 Author Share Posted March 19, 2009 but I have about 30 DB websites and this is the only one that has an issue, and i dont think ive done anything different... its just wierd! Link to comment https://forums.phpfreaks.com/topic/149938-cms-script-adds-%C3%A2-to-the-pages-on-display-and-in-the-db/#findComment-788353 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.