1

Now I know a similar question has been asked before, but please bear with me. So I'm using the same line of code on two seperate pages yet one displays  and the other doesn't. What would be causing this?

The below code is on each of the two before mentioned pages:

<?php include("footerblock.php"); ?>

Which refers it to this code here:

<?php session_start(); ?>
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head><body>
<table style="text-align: center; width: 100%;" border="0" cellpadding="0" cellspacing="0">
<tbody><tr><td style="text-align: center;">
<?php
$cmtx_identifier = 'cmtx_reference';
$cmtx_reference = 'cmtx_url';
$cmtx_path = 'comments/';
require $cmtx_path . 'includes/commentics.php'; //don't edit this line
?>
</td>
</tr></tbody></table></body></html>
Aspect
  • 11
  • 2
  • Depends on the encoding the page claims to have. – eckes Feb 27 '15 at 22:54
  • Sorry I'm a bit new to this, could you please explain further? – Aspect Feb 27 '15 at 22:58
  • Thanks but I've already read through that page with no luck. I just what to figure out how come my first page does not display the , yet for some odd reason the second one does. I have looked over my code and both seem to be the same setup. – Aspect Feb 27 '15 at 23:09
  • If you like at the header response what does it say the content-type is? – chris85 Feb 27 '15 at 23:27
  • Obviously it IS encoding error. If you removed BOM from one of your files, you have to do it for all other files too. Just check every include()d file – Kyborek Feb 27 '15 at 23:43

1 Answers1

0
  1. Please, don't use inline styles (style="..."). It's a bad practice.
  2. Make sure your source files are encoded in UTF-8. Check your code editor settings or try switching to Sublime Text. In order to do this, change the settings and save all the files again.
  3. Try using this function on top of your PHP files. http://php.net/manual/en/function.mb-internal-encoding.php