Jump to content

Recommended Posts

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 :/

Link to comment
https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/167421-%C3%AF%C2%BB%C2%BF/#findComment-882899
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.