Fabis94 Posted July 25, 2009 Share Posted July 25, 2009 I remotely load page into a div with JQuery and PHP. Sometimes when i refresh the page i get these symbols:  I heard it has something to do with the wrong encoding, but this is beginning of my page from which i'm loading the text: <?php header("Content-Type: text/html"); header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Cache-Control: no-store, no-cache, must-revalidate"); header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); DEFINE('_ISO','charset=UTF-8'); ?> And this is the beginning of the page that loads the text: <?php include ("connection.php"); $connect = mysql_connect($server, $username, $password) or die('Error 1: Cannot connect to the MYSQL server.'); mysql_select_db($database) or die('Error 2: Cannot select the database.'); ?> <!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"><!-- InstanceBegin template="/Templates/index.dwt" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Site</title> <script type="text/JavaScript" src="jquery.js"></script> <script type="text/JavaScript"> function loadContent(elementSelector, sourceUrl) { $(""+elementSelector+"").empty().html("<br><br><br><center><font size='+3' face='Arial'>Loading</font><br><img src='loading.gif'></center>"); $(""+elementSelector+"").load(""+sourceUrl+""); } </script> What's wrong :/ Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/ Share on other sites More sharing options...
ignace Posted July 25, 2009 Share Posted July 25, 2009 header("Content-Type: text/html; charset=ISO-8859-1"); <input type="Content-Type" content="text/html; charset=ISO-8859-1"> Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-882849 Share on other sites More sharing options...
Fabis94 Posted July 25, 2009 Author Share Posted July 25, 2009 Wasn't the encoding supposed to be UTF8 for the symbol to disappear? Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-882891 Share on other sites More sharing options...
PFMaBiSmAd Posted July 25, 2009 Share Posted July 25, 2009 Those are the Unicode/UTF-8 BOM (Byte Order Mark) characters that the editor placed at the start of the file (a Windows only problem.) They are not due to any headers or character encoding being used in the file. Save the file without the BOM. Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-882899 Share on other sites More sharing options...
Fabis94 Posted July 25, 2009 Author Share Posted July 25, 2009 Huh, how do i do that? Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-882911 Share on other sites More sharing options...
Daniel0 Posted July 26, 2009 Share Posted July 26, 2009 What editor do you use? We can't tell you without that information. Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-883004 Share on other sites More sharing options...
vineld Posted July 26, 2009 Share Posted July 26, 2009 If you use notepad or wordpad or some other similar editor you should take a look at Notepad++ instead. Makes coding much smoother unless you want something heavy duty. Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-883007 Share on other sites More sharing options...
ignace Posted July 26, 2009 Share Posted July 26, 2009 Huh, how do i do that? PFMaBiSmAd sometimes forget's he's talking to mere mortals Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-883094 Share on other sites More sharing options...
Fabis94 Posted July 30, 2009 Author Share Posted July 30, 2009 I use Dreamweaver and occasionally PHP Expert Editor. Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-886839 Share on other sites More sharing options...
Fabis94 Posted August 2, 2009 Author Share Posted August 2, 2009 Umm so anyone? Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-888601 Share on other sites More sharing options...
Daniel0 Posted August 2, 2009 Share Posted August 2, 2009 You were already told to save in UTF-8 without BOM. Look through your editors' settings or look in the manual. We're not experts in every single editor out there. Quote Link to comment https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-888736 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.