PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
redmonkey
Forum Regular
Posts: 836 Joined: Thu Dec 18, 2003 3:58 pm
Post
by redmonkey » Sun Feb 05, 2006 5:48 pm
[quote="onejoy1"]I got:

Warning: Cannot modify header information - headers already sent by (output started at /home/users/sjg5005/http/nihongo/directory2.php:1) in /home/users/sjg5005/http/nihongo/directory2.php on line 1
ã
onejoy1
Forum Newbie
Posts: 14 Joined: Sun Feb 05, 2006 4:50 am
Post
by onejoy1 » Sun Feb 05, 2006 6:38 pm
Code: Select all
<?php header("Content-type: text/css; charset: UTF-8"); ?>
<html>
<body>
<? echo "はじめ!"; ?>
</body>
</html>
is what I put in the wordpad file.
ÿþ<?php header("Content-type: text/css; charset: UTF-8"); ?> <html> <body> <? echo "o0X0
Gambler
Forum Contributor
Posts: 246 Joined: Thu Dec 08, 2005 7:10 pm
Post
by Gambler » Sun Feb 05, 2006 8:19 pm
I don't understand what Gambler means by save files as utf-8, unless you mean to make sure that when I save them, the encoding is set to utf-8?
Files may have different encodings. It can be, for example, ISO-8858-1, or UTF-8. If you save file in one encoding, but identify it as another, it will probably be displayed as junk. Good editors allow you to see what encoding you are using.
timvw
DevNet Master
Posts: 4897 Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium
Post
by timvw » Sun Feb 05, 2006 9:22 pm
Notice that you have a space before <?php ... And there should be absolutely *no* output if you use the
http://www.php.net/header function...
eyespark
Forum Commoner
Posts: 50 Joined: Tue Jan 24, 2006 7:36 am
Post
by eyespark » Mon Feb 06, 2006 3:18 pm
Output causing error might also be BOM (byte order mark for utf-8 ). You should save your file without BOM.
onejoy1
Forum Newbie
Posts: 14 Joined: Sun Feb 05, 2006 4:50 am
Post
by onejoy1 » Mon Feb 06, 2006 6:50 pm
Code: Select all
<?php header("Content-type: text/css; charset: UTF-8"); ?>
<html>
<body>
<? echo "はじめ!"; ?>
</body>
</html>
There is no space there, that's just how it copied.
How do I save the file without BOM?
onejoy1
Forum Newbie
Posts: 14 Joined: Sun Feb 05, 2006 4:50 am
Post
by onejoy1 » Tue Feb 07, 2006 12:08 am
I'm using DW6. I can't find a way to remove the BOM. I also tried writing it in notepad and wordpad and still the characters remained.
I read somewhere that there is a script to remove the BOM if it cannot be removed manually, but I can't find a script anywhere that would do that.
onejoy1
Forum Newbie
Posts: 14 Joined: Sun Feb 05, 2006 4:50 am
Post
by onejoy1 » Thu Feb 09, 2006 11:30 pm
I'm still trying to figure out a way to save a file w/o the BOM. Can anyone help me?
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Thu Feb 09, 2006 11:38 pm
stop using Dreamweaver? You can search through the Editors thread (link can be found in the Forum Tour) for other more useful Unicode compliant editors
onejoy1
Forum Newbie
Posts: 14 Joined: Sun Feb 05, 2006 4:50 am
Post
by onejoy1 » Fri Feb 10, 2006 2:53 am
lol, I'm using dreamweaver because the other person I'm doing this project on hasn't used anything but dreamweaver before. So I have no choice..
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Feb 10, 2006 8:15 am
yeah you do. What editor you use shouldn't have baring on what editor that person uses.
onejoy1
Forum Newbie
Posts: 14 Joined: Sun Feb 05, 2006 4:50 am
Post
by onejoy1 » Fri Feb 10, 2006 11:53 am
Regardless, do you know an editor that I can save without the BOM with? I looked for the editor's section but I couldn't find it.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Fri Feb 10, 2006 12:02 pm
onejoy1
Forum Newbie
Posts: 14 Joined: Sun Feb 05, 2006 4:50 am
Post
by onejoy1 » Fri Feb 10, 2006 12:07 pm
Thanks!