Shoutbox

PHP problem, getting:  - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: PHP problem, getting:  (/showthread.php?tid=56543)

PHP problem, getting:  by lordy on 03-07-2006 at 02:56 AM

OK I have the following code:

code:
<?php
$download = $_GET['download'];

if (empty($download)) {
require_once("downloads_index.php");
}
?>

and that puts the file in fine, however for some reason, just above where the file is being included, I get these characters: 

I have no idea what could be causing that... so if anyone else has any idea? :)
RE: PHP problem, getting:  by ShawnZ on 03-07-2006 at 04:14 AM

are you sure its not a problem in downloads_index.php?


RE: PHP problem, getting:  by lordy on 03-07-2006 at 04:40 AM

downloads_index.php doesnt contain any php, only pure HTML... a table and some other text


RE: PHP problem, getting:  by lordy on 03-07-2006 at 04:50 AM

I found the problem, downloads_index.php was encoded in UTF-8, where as the file it was being included into was encoded in ANSI


RE: PHP problem, getting:  by rav0 on 03-07-2006 at 04:52 AM

Those characters are from the file that's being included. If you try to view a Unicode BOM (a binary code that's at the begining of a file) as though it were ANSI text (or a bunch of other encodings), "" is something that you might end up with.

Get your editor to save downloads_index.php without a BOM, or save it as ANSI. You can open it with Windows Notepad, and then copy the text into a new file and save the new file.


RE: PHP problem, getting:  by lordy on 03-07-2006 at 04:59 AM

lol thanks, I posted that i solved theproblem just before you posted that solution, and yes it was to do with the encoding. thanks anyway :)