View Full Version : include is added characters

10-06-2004, 06:24 PM

Can anybody try this out for me?

include ("http://www.hitzradio.com/update_songinfo.php")

to see if it adds these characters : ´╗┐ in front of the song that is on the site.

It does it for me, but apparently not for everybody

Thank you

10-06-2004, 08:01 PM
here is a simple overview of HTML entities...

╗ - »
┐ - & #239
´ - & #191;

10-06-2004, 08:17 PM
ok...but how do i get rid of it, because it's not there on the page that i am taking it from

10-06-2004, 08:35 PM
htmlentities(include ('http://www.hitzradio.com/update_songinfo.php'));

Read more at http://uk2.php.net/manual/en/function.htmlentities.php

10-06-2004, 08:41 PM
It still gives me those 3 characters.

I'm trying a way so that the song goes into a MySQL database (with the UPDATE feature), then i pull it out of there....you think that'll work?

10-06-2004, 08:45 PM
Did you read the PHP manual page? Did you add ENT_QUOTES?

10-06-2004, 08:45 PM
Looks like an encoding issue. Is the page you are including 'update_songinfo.php' UTF-8?

10-06-2004, 09:05 PM
ok, here's what i did, first i had the code like this

print htmlentities(include('http://www.hitzradio.com/update_songinfo.php', ENT_QUOTES));

and it gave me a parse error because of the ','

so then i changed my code to this

$include = include ("http://www.hitzradio.com/update_songinfo.php");
print htmlentities("http://www.hitzradio.com/update_songinfo.php", ENT_QUOTES)

and it still gives me the weird characters

10-06-2004, 09:30 PM
The second one would just display the URI.

Try this:
$src = include 'http://www.hitzradio.com/update_songinfo.php';
echo htmlentities($src, ENT_QUOTES);

10-06-2004, 09:32 PM
it still gives me the 3 characters.....is there a code that'll say "erase the first 3 characters" ?

10-06-2004, 09:37 PM
substr_replace($src, '', 0, 3);

10-06-2004, 09:43 PM
isn't this supposed to solve the problem?

print (substr_replace(include 'http://www.hitzradio.com/update_songinfo.php', ' ', 0, 3));

because it didn't remove anything

i even tried this

$src = include 'http://www.hitzradio.com/update_songinfo.php';
print (substr_replace($src, ' ', 0, 3));

10-06-2004, 09:43 PM
Can you show us the page where these characters are occuring?

10-06-2004, 09:44 PM

look to the right of the calender....above the image writen "sponsor" on it

10-06-2004, 09:48 PM
Ahh ha! you are including a UTF-8 file into an ISO-8859-1 encoded page.

Thus your problem. Quick fix, save the offending ISO-8859-1 file to UTF-8 and you are all set.

10-06-2004, 09:51 PM
but the page with the song is not mine, i can't change that, that means i have to put it in a text file, save it as a UTF-8, then take it from the txt file.....right?

10-06-2004, 09:56 PM
i got it.... i create a song.php page put this in it

header('Content-type: text/html; charset=utf-8');

(thanx to error 404 for the htmlentities link --> that made me put the header in the page)

then on my page i included the song.php

which worked out great

10-14-2004, 10:25 PM
Hi again,

I've stumble onto another problem regarding this aspect of my site....if i put header('Content-type: text/html; charset=utf-8'); it'll remove the weird characters, but I also have a french version of the site, and putting header('Content-type: text/html; charset=utf-8'); will remove any words like ╔coutez, ša...

is there another content-type that'll work for both

I got it....put this in the head

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="fr">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">