OsakaWebbie
Programmer
I have a set of PHP files that always start with a couple includes - the first defines some functions and establishes a database connection, and the second uses sessions to authenticate the user. Everything worked fine on my local machine, running Apache/PHP/MySQL on Windows and using Shift-JIS as the character set to encode Japanese text. I uploaded the whole thing to a web hoster who is running MySQL with UTF-8, so I converted the database data and changed the page header to specify UTF-8, and most things were working fine. But I have one PHP source file that has a little bit of Japanese text in it, and today I learned that I can open it in Notepad and do Save As, specifying UTF-8, to convert the text. I did that, and uploaded the new file. But for some mysterious reason, now some text is sent to the browser before my early code runs - to be exact, "<br />" and a carriage return. Naturally my session code complains that the headers are already sent. I didn't change anything in my code, the source and the two included files all start immediately with "<?php", and I don't even have any instances of "<br />" anywhere in my files (I'm still using plain "<br>" - please don't lecture me about that). So I don't know where that text is coming from - does anyone else have a clue? I don't know whether it's relevent, but the file in question is called inside an iframe of another file.