Home>Article>Backend Development> What should I do if php displays a blank page when loading the frameset page?
Solution to php showing blank when loading frameset page:
Solution to php page showing blank when loading frameset page
It’s a problem with bom
What is bom?
In a utf-8 encoded file, the BOM is in the file header, occupying three bytes, and is used to indicate that the file belongs to utf-8 encoding. There are many softwares that recognize the BOM header, but some still cannot. BOM header, for example, PHP cannot recognize BOM header, which is why an error occurs after editing UTF-8 encoding with Notepad.
The simple ways to remove the BOM header are the following two:
1. How to remove the BOM header with editplus
After the editor is adjusted to UTF8 encoding format, save it There will be a string of hidden characters (that is, BOM) in front of the file, which is used by the editor to identify whether the file is UTF8 encoded.
Run Editplus, click Tools, select Preferences, select the file, select UTF-8 identification to always delete the signature,
Then edit and save the PHP file without BOM. Yes.
2. Ultraedit method to remove BOM header
After opening the file, select the encoding format in the Save as option (utf-8 without BOM header), confirm and it will be ok
How about it, it is very simple to remove the BOM header
3. How to remove the BOM header in Dreamweaver
DW->Modify->Page Properties->Title/Encoding, which will include Unicode signature ( Uncheck the box in front of Bom)
and save.
Let’s talk about the BOM information of utf8
BOM refers to the storage method of the PHP file itself as UTF-8 with BOM. The Chinese garbled way of ordinary pages is generally not caused by this reason. .
header("Content-type: text/html; charset=utf-8");
This sentence controls the encoding method of the html output page,
BOM only This is only available when "Notepad" is used to store UTF-8 under WINDOWS. You can use WINHEX to delete the first 2 bytes.
In the encoding settings in Dreamweaver, you can set whether to include BOM. Generally, as long as the output of PHP is not a picture (GDI Stream), BOM will not cause problems.
GDI Stream will be displayed as a red cross if there are extra characters at the beginning.
Recommended tutorial: "php tutorial"
The above is the detailed content of What should I do if php displays a blank page when loading the frameset page?. For more information, please follow other related articles on the PHP Chinese website!