After I browse creatingFile.php, I find createdFile.php.
Yes, It’s successfully created.
As I browse createdFile.php, I can see the text “englishText”.
So far, so good.
BUT, as I change creatingFile.php like the below. a tiny problem which I can’t solve happens.
As I browse createdFile.php, I can see some broken characters instead of the text “koreanText”.
I go to the directory which has the files “creatingFile.php” and “createdFile.php”.
As I open the file “createdFile.php” with the old friend notePad selecting UTF-8, I can see the text “koreanText”.
After I save “createdFile.php” with the notePad, I can see the text “koreanText” in the browsing result.
I like to see the text “koreanText” in the browsing result without openning and saving the file "createdFile.php with the notePad.
How can I see the text “koreanText” when I directly browse the file “createdFile.php” before working with the notePad?
As I browse the file creatingFile.php, it says “Warning: Cannot modify header information - headers already sent by (output started at creating.php:1) in creating.php on line 2”.
I don’t quite understand what “creatingFile.php” is representing. Anyway, make sure the header command is placed in the line of execution of your code before any output takes place.
The file “creatingFile2.php” has the code above, and the code above is all code in the file "creatingFile2.php, and there is no space before “<?php” and after “?>”.
You can see it at http://dot.kr/x-test/creatingFile2.php, but I can still see the warning when I browse it.
What is the problem in the code of “creatingFile2.php”?
well as I said, you need the php where the header() is, to not have anything come before it. not a single return. so the first character in the file needs to be <, that’s the < of the <?php bit. and that includes any other files being included, linked to. make the header() the first thing which happens. and make no characters at all preceded the <?php bit.
well I don’t know then. There’s no guarantee my suggestion, when not giving the error, will solve your original problem. But it seems reasonably likely to me. It’ll tell browsers to display it correctly I think (this is assuming the data is actually correct). So far as being able to use header() properly I’m not sure what the problem is. Whenever you get that error it means that some sort of output has occurrred before the header() command, and because headers must come before normal output, php and/or the server, outputs what headers it has as soon as and before any output is to be output. Basically some output has taken place before your header() command. Where and what I don’t know. Maybe someone else can help?
> did you the code above in your server?
Yes I’ve used that line before for sure. It works, i.e. doesn’t give error.