之前发帖子说[正式启用eztk.net域名,见证人列表工具移至网站根目录](https://steemit.com/cn/@oflyhigh/eztk-net),但是这个站点目前只有一个[Witness List](https://www.eztk.net/witnesses.php),所以我实在不知道主页该写点啥。  (图源 :[pixabay](https://pixabay.com/)) 既然没啥写的,就先跳转到[Witness List](https://www.eztk.net/witnesses.php),其实跳转的方法有好多种,比如用Apache的`URL_REWRITE`或者用HTML代码`<meta http-equiv="refresh" content="5;url=https://www.eztk.net/witnesses.php"> `或者用JavaScripte的`window.location.href='https://www.eztk.net/witnesses.php;` 不过我最喜欢用的还是如下代码: >`<?php` `header('Location: https://www.eztk.net/witnesses.php');` `?>` 编辑index.php,填上上述代码,保存并上传到服务器,访问,然后美滋滋地等跳转,结果一片空白,并没有跳转至我要的页面,这是咋回事呢? 查看了一下`error_log`发现了如下内容: >`[30-Oct-2018 02:44:49 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/user/public_html/index.php:1) in /home/user/public_html/index.php on line 2` 哦,原来是这个问题啊,这个问题几十年前刚学PHP的时候我遇到无数次了,不过是在`header()`之前有了其它输出嘛(字符啊、空格之类的),去掉就好了。结果我瞪大眼睛找了半天,也没找到任何字符。 会是什么原因呢?我冥思苦想,想了好久终于灵光一现,我该不会手贱把PHP文件格式设置成了`UTF-8 (BOM)`了吧? 点击另存为,看了一下当前的文件格式,果不其然是`UTF-8 (BOM)` > 而`UTF-8 `和`UTF-8 (BOM)`文件格式有啥区别呢?我们来对比一下两个文件的二进制码就知道了   经过对比我们发现,后者比前者多出来三个字节***`0xEF,0xBB,0xBF`***,这就是导致***`Cannot modify header information - headers already sent by`***的罪魁祸首啦。 那么解决起来也很简单了,把文件另存为`UTF-8 `,就搞定啦。 有关更多关于BOM的细节,去参考[Byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark)吧,我就不献丑啦。 # 相关链接 * [Byte order mark](https://en.wikipedia.org/wiki/Byte_order_mark) * [Witness List by @oflyhigh](https://www.eztk.net/witnesses.php) * [温故而知新:复习一下字符编码(ASCII、GB2312、Unicode、UTF-8、区位码)](https://steemit.com/encoding/@oflyhigh/ascii-gb2312-unicode-utf-8) * [纸上得来终觉浅:来验证一下编码的问题](https://steemit.com/encoding/@oflyhigh/hydbr) * [每天进步一点点:VC中不同编码间字符串转换](https://steemit.com/encoding/@oflyhigh/vc) ---- <center><strong>Vote For Me As Witness</strong> https://steemit.com/~witnesses type in **`oflyhigh`** and click ***`VOTE`*** [](https://steemit.com/~witnesses) [Vote @oflyhigh via Steemconnect](https://steemconnect.com/sign/account-witness-vote?witness=oflyhigh&approve=1) <strong>Thank you!</strong></center>
author | oflyhigh |
---|---|
permlink | utf-8-bom |
category | cn |
json_metadata | {"tags":["cn","programming","bom","utf-8"],"image":["https://steemitimages.com/DQmRkLq6rRew3mHfx4vYGWyqpC8wSebLPeC2iZCXAdpuGkR/image.png","https://cdn.steemitimages.com/DQmXyjLyTWZ1LuLuj8jXGV682CbRoMYx9j9sSKg2xts8bFb/image.png","https://cdn.steemitimages.com/DQmVus28gb3quKVB4WDj1MfxsyCfSU3hHKXcDQknYvcf7LB/image.png","https://cdn.steemitimages.com/DQmYkK3Tw4Z45Zi6K5C3w3MsBvVefyySxnewiPMiEWXSk8x/image.png","https://cdn.steemitimages.com/DQmX5NysqT44FBa3bhuWqQ69nAbseu8Nt5YQPn2pYejPVxA/image.png"],"links":["https://steemit.com/cn/@oflyhigh/eztk-net","https://www.eztk.net/witnesses.php","https://pixabay.com/","https://en.wikipedia.org/wiki/Byte_order_mark","https://steemit.com/encoding/@oflyhigh/ascii-gb2312-unicode-utf-8","https://steemit.com/encoding/@oflyhigh/hydbr","https://steemit.com/encoding/@oflyhigh/vc","https://steemit.com/~witnesses","https://steemconnect.com/sign/account-witness-vote?witness=oflyhigh&approve=1"],"app":"steemit/0.1","format":"markdown"} |
created | 2018-11-01 02:52:42 |
last_update | 2018-11-01 02:52:42 |
depth | 0 |
children | 7 |
last_payout | 2018-11-08 02:52:42 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 26.816 HBD |
curator_payout_value | 8.130 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 2,531 |
author_reputation | 6,410,924,137,254,968 |
root_title | "每天进步一点点:UTF-8 (BOM)导致的问题" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,448,082 |
net_rshares | 31,136,761,371,899 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
adm | 0 | 15,057,294,953,061 | 80% | ||
thecryptodrive | 0 | 40,192,360,477 | 25% | ||
wongshiying | 0 | 101,534,385 | 100% | ||
mark-waser | 0 | 128,859,167,366 | 100% | ||
slowwalker | 0 | 2,540,666,748,692 | 20% | ||
blockchainbilly | 0 | 4,297,923,657 | 50% | ||
deanliu | 0 | 1,501,186,785,407 | 100% | ||
joythewanderer | 0 | 306,865,927,569 | 40% | ||
ace108 | 0 | 400,110,334,786 | 25% | ||
laoyao | 0 | 37,163,632,114 | 100% | ||
somebody | 0 | 1,379,523,957,473 | 100% | ||
midnightoil | 0 | 134,853,161,337 | 100% | ||
xiaohui | 0 | 749,679,807,412 | 100% | ||
silentlucidity53 | 0 | 0 | 75% | ||
oflyhigh | 0 | 2,616,800,323,757 | 100% | ||
xiaokongcom | 0 | 203,086,571 | 100% | ||
yulan | 0 | 15,829,573,474 | 100% | ||
chinadaily | 0 | 199,940,271,904 | 100% | ||
helene | 0 | 926,379,728,361 | 100% | ||
ethansteem | 0 | 203,959,406,189 | 100% | ||
englishtchrivy | 0 | 123,623,665,408 | 25% | ||
davidjkelley | 0 | 5,963,859,394 | 100% | ||
digital-wisdom | 0 | 54,702,553,619 | 100% | ||
ethical-ai | 0 | 17,940,974,150 | 100% | ||
jwaser | 0 | 28,904,443,759 | 100% | ||
bwaser | 0 | 6,867,635,433 | 100% | ||
jianghao | 0 | 181,676,029 | 10% | ||
ellepdub | 0 | 1,821,552,771 | 100% | ||
herpetologyguy | 0 | 163,594,630,533 | 100% | ||
handyman | 0 | 122,739,315 | 100% | ||
strong-ai | 0 | 15,226,433,538 | 100% | ||
steemtruth | 0 | 3,032,364,918 | 10% | ||
redes | 0 | 1,393,869,864,876 | 27% | ||
lalala | 0 | 178,860,643,474 | 100% | ||
dapeng | 0 | 36,384,239,727 | 100% | ||
devilwsy | 0 | 2,356,173,038 | 100% | ||
janiceting | 0 | 2,343,251,813 | 100% | ||
lydiachan | 0 | 33,169,852,920 | 100% | ||
technoprogressiv | 0 | 14,884,629,789 | 100% | ||
blackbunny | 0 | 140,756,086,587 | 100% | ||
da-dawn | 0 | 51,589,254,503 | 100% | ||
bxt | 0 | 191,951,773,127 | 100% | ||
lingfei | 0 | 69,713,750,341 | 100% | ||
yyyy | 0 | 426,649,153 | 100% | ||
alexis555 | 0 | 1,791,766,091,878 | 25% | ||
austinsandersco | 0 | 710,579,915 | 70% | ||
teachblogger | 0 | 5,618,429,847 | 50% | ||
kingofdew | 0 | 45,498,523,870 | 100% | ||
frankintaiwan | 0 | 0 | 10% | ||
wylo | 0 | 548,384,042 | 100% | ||
jkkim | 0 | 25,468,825 | 10% | ||
ebejammin | 0 | 5,826,776,714 | 100% | ||
jassennessaj | 0 | 2,196,141,094 | 10% | ||
cryptohustler | 0 | 28,283,375,443 | 100% | ||
exec | 0 | 92,705,849,847 | 100% | ||
eval | 0 | 794,225,182 | 100% | ||
catchawhale | 0 | 29,737,177,480 | 20% | ||
speeding | 0 | 3,661,280,042 | 100% | ||
walkinharmony | 0 | 12,224,671,439 | 40% | ||
asterix87 | 0 | 13,804,877,322 | 100% | ||
vikbuddy | 0 | 4,744,087,987 | 100% | ||
abetterworld | 0 | 2,899,857,753 | 100% | ||
raili | 0 | 1,632,795,615 | 90% | ||
that1consultant | 0 | 248,854,340 | 100% | ||
sanzo | 0 | 297,377,270 | 100% | ||
davaowhenyo | 0 | 556,343,454 | 100% | ||
allenshayzar | 0 | 556,343,454 | 100% | ||
raku | 0 | 559,061,898 | 100% | ||
resteeming | 0 | 556,739,354 | 100% | ||
ravenousappetite | 0 | 556,343,454 | 100% | ||
aabb | 0 | 12,356,672,197 | 100% | ||
catwomanteresa | 0 | 23,449,833,479 | 30% | ||
auntigormint | 0 | 482,869,408 | 100% | ||
mrliga | 0 | 18,410,850,612 | 100% | ||
sweethoney | 0 | 234,120,911 | 100% | ||
liangfengyouren | 0 | 1,613,071,579 | 50% | ||
hassanabid | 0 | 1,727,372,990 | 20% | ||
jiangchen | 0 | 12,277,191,623 | 100% | ||
lancy | 0 | 4,473,225,926 | 92% | ||
skenan | 0 | 28,540,009,714 | 50% | ||
bearpaw | 0 | 52,725,040 | 100% | ||
freedom-fighter | 0 | 556,343,454 | 100% | ||
technologynepal | 0 | 559,061,898 | 100% | ||
chenlocus | 0 | 1,235,032,336 | 40% | ||
davidke20 | 0 | 2,232,438,470 | 10% | ||
rosatravels | 0 | 3,192,062,593 | 1% | ||
khalilad | 0 | 544,387,100 | 100% | ||
ms8988 | 0 | 545,529,481 | 100% | ||
xiaoshancun | 0 | 270,490,423 | 100% | ||
stakuza | 0 | 345,246,478 | 100% | ||
holmesian | 0 | 190,486,997 | 100% | ||
ikonik | 0 | 343,531,738 | 100% | ||
vfxness | 0 | 17,564,599 | 100% | ||
lemminon | 0 | 557,193,055 | 100% | ||
bobdos | 0 | 21,656,208,796 | 50% | ||
heyeshuang | 0 | 604,114,763 | 100% | ||
razor80 | 0 | 555,770,374 | 100% | ||
fastiduos | 0 | 557,193,055 | 100% | ||
winniex | 0 | 3,517,088,227 | 10% | ||
rebecca80 | 0 | 148,716,191 | 100% | ||
hymle | 0 | 3,552,438,600 | 100% | ||
weavingwords | 0 | 57,597,598,137 | 100% | ||
nitro.live | 0 | 257,904,810 | 100% | ||
huatanzhang | 0 | 1,757,636,805 | 100% | ||
chaerin | 0 | 163,500,071 | 100% | ||
windowglass | 0 | 16,269,319,788 | 50% | ||
cnbuddy | 0 | 1,023,879,871 | 0.1% | ||
chann | 0 | 3,564,486,932 | 20% | ||
coindzs | 0 | 142,130,333 | 100% | ||
maiyude | 0 | 1,783,874,579 | 5% | ||
joeliew | 0 | 132,875,779 | 5% | ||
vamos-amigo | 0 | 156,834,833 | 5% | ||
yjcps | 0 | 3,743,198,112 | 100% | ||
historylover | 0 | 1,011,461,433 | 100% | ||
ethanlee | 0 | 3,571,069,445 | 100% | ||
andrewnoel | 0 | 593,246,704 | 100% | ||
fredo77200 | 0 | 3,616,135,293 | 100% | ||
norinke | 0 | 362,313,830 | 100% | ||
fanso | 0 | 1,580,518,815 | 100% | ||
cryptoknight27 | 0 | 556,954,377 | 100% | ||
let-it-fly | 0 | 3,416,582,007 | 100% | ||
spammy | 0 | 40,021,249 | 20% | ||
hepeng.chn | 0 | 97,372,378 | 100% | ||
bambugrove | 0 | 447,685,623 | 100% | ||
astros | 0 | 2,535,022,560 | 100% | ||
shine.wong | 0 | 791,074,299 | 61% | ||
alijewel | 0 | 514,079,886 | 100% | ||
steemchoose | 0 | 27,644,057,336 | 2.1% | ||
julian2013 | 0 | 10,302,134,551 | 25% | ||
lkvictor2005 | 0 | 7,886,862,155 | 100% | ||
ilovecoding | 0 | 836,438,274 | 10% | ||
devsup | 0 | 2,775,317,891 | 0.69% | ||
team-aceh | 0 | 5,092,935,992 | 100% | ||
alvin0617 | 0 | 2,840,372,063 | 20% | ||
sskiller | 0 | 71,212,339 | 30% | ||
steemall | 0 | 71,285,493 | 30% | ||
yangzimin | 0 | 508,096,023 | 100% |
Hello! Your post has been resteemed and upvoted by @ilovecoding because **we love coding**! Keep up good work! Consider upvoting this comment to support the @ilovecoding and increase your future rewards! ^_^ Steem On!  *Reply !stop to disable the comment. Thanks!*
author | ilovecoding |
---|---|
permlink | 20181101t025253735z |
category | cn |
json_metadata | {"tags":["ilovecoding"],"app":"ilovecoding"} |
created | 2018-11-01 02:52:54 |
last_update | 2018-11-01 02:52:54 |
depth | 1 |
children | 0 |
last_payout | 2018-11-08 02:52:54 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 323 |
author_reputation | 40,845,997,808 |
root_title | "每天进步一点点:UTF-8 (BOM)导致的问题" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,448,088 |
net_rshares | 392,341,260 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
ilovecoding | 0 | 392,341,260 | 5% |
author | julian2013 |
---|---|
permlink | re-oflyhigh-utf-8-bom-20181101t025741862z |
category | cn |
json_metadata | {"community":"busy","app":"busy/2.5.6","format":"markdown","tags":["cn"],"users":[],"links":[],"image":[]} |
created | 2018-11-01 02:57:48 |
last_update | 2018-11-01 02:57:48 |
depth | 1 |
children | 4 |
last_payout | 2018-11-08 02:57:48 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.042 HBD |
curator_payout_value | 0.012 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 10 |
author_reputation | 398,595,897,784,320 |
root_title | "每天进步一点点:UTF-8 (BOM)导致的问题" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,448,264 |
net_rshares | 49,306,524,528 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
oflyhigh | 0 | 48,750,524,528 | 2% | ||
black109 | 0 | 556,000,000 | 100% |
哈哈这个叫做branding Posted using [Partiko Android](https://steemit.com/@partiko-android)
author | crypto.talk |
---|---|
permlink | crypto-talk-re-julian2013-re-oflyhigh-utf-8-bom-20181101t064309221z |
category | cn |
json_metadata | {"app":"partiko"} |
created | 2018-11-01 06:43:09 |
last_update | 2018-11-01 06:43:09 |
depth | 2 |
children | 3 |
last_payout | 2018-11-08 06:43:09 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.042 HBD |
curator_payout_value | 0.013 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 84 |
author_reputation | 5,672,582,596,884 |
root_title | "每天进步一点点:UTF-8 (BOM)导致的问题" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,457,478 |
net_rshares | 48,769,126,721 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
oflyhigh | 0 | 48,769,126,721 | 2% |
👍
author | black109 |
---|---|
permlink | re-cryptotalk-crypto-talk-re-julian2013-re-oflyhigh-utf-8-bom-20181102t132608372z |
category | cn |
json_metadata | {"tags":["cn"],"app":"steemit/0.1"} |
created | 2018-11-02 13:26:12 |
last_update | 2018-11-02 13:26:12 |
depth | 3 |
children | 0 |
last_payout | 2018-11-09 13:26:12 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 1 |
author_reputation | 6,373,909,098 |
root_title | "每天进步一点点:UTF-8 (BOM)导致的问题" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 0 |
post_id | 74,542,177 |
net_rshares | 0 |
机智👍
author | oflyhigh |
---|---|
permlink | re-cryptotalk-crypto-talk-re-julian2013-re-oflyhigh-utf-8-bom-20181101t140215028z |
category | cn |
json_metadata | {"tags":["cn"],"app":"steemit/0.1"} |
created | 2018-11-01 14:02:15 |
last_update | 2018-11-01 14:02:15 |
depth | 3 |
children | 1 |
last_payout | 2018-11-08 14:02:15 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.000 HBD |
curator_payout_value | 0.000 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 3 |
author_reputation | 6,410,924,137,254,968 |
root_title | "每天进步一点点:UTF-8 (BOM)导致的问题" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,479,369 |
net_rshares | 0 |
码农的事儿真是不懂呀 Posted using [Partiko Android](https://steemit.com/@partiko-android)
author | sunai |
---|---|
permlink | sunai-re-oflyhigh-utf-8-bom-20181101t042936958z |
category | cn |
json_metadata | {"app":"partiko"} |
created | 2018-11-01 04:29:39 |
last_update | 2018-11-01 04:29:39 |
depth | 1 |
children | 0 |
last_payout | 2018-11-08 04:29:39 |
cashout_time | 1969-12-31 23:59:59 |
total_payout_value | 0.041 HBD |
curator_payout_value | 0.013 HBD |
pending_payout_value | 0.000 HBD |
promoted | 0.000 HBD |
body_length | 80 |
author_reputation | 17,899,844,015,065 |
root_title | "每天进步一点点:UTF-8 (BOM)导致的问题" |
beneficiaries | [] |
max_accepted_payout | 1,000,000.000 HBD |
percent_hbd | 10,000 |
post_id | 74,451,791 |
net_rshares | 48,785,421,787 |
author_curate_reward | "" |
voter | weight | wgt% | rshares | pct | time |
---|---|---|---|---|---|
oflyhigh | 0 | 48,785,421,787 | 2% |