Pure newcomer, jump code others help me write, the purpose is to jump, file for go.php
Jump to www.taobao.com when the URL is entered Go.php?id=taobao
An error occurred after changing the host
Warning:cannot Modify header Information-headers already sent by (output started at/data/home/... /go.php:8) in/data/home/... /go.php on line 10
Baidu know need to change php.ini but new host changed this is very troublesome. Do you have any way to modify the above errors directly in the PHP code of the above file?
Code:
正在进入....
How should I change it? Thank you!!!
Reply content:
Pure newcomer, jump code others help me write, the purpose is to jump, file for go.php
Jump to www.taobao.com when the URL is entered Go.php?id=taobao
An error occurred after changing the host
Warning:cannot Modify header Information-headers already sent by (output started at/data/home/... /go.php:8) in/data/home/... /go.php on line 10
Baidu know need to change php.ini but new host changed this is very troublesome. Do you have any way to modify the above errors directly in the PHP code of the above file?
Code:
正在进入....
How should I change it? Thank you!!!
go.php the role of the page only to make a judgment jump use, the HTML tag can be completely removed, the code of the go.php file only need to be streamlined to the remaining PHP:
php
如果还出现headers already sent 错误的话,就应该是编写代码的编辑器在文件开头隐藏了bom头信息,网上搜一下相关的编辑器对应方法即可。
如果要保留html代码,并且想要跳转的话,需要使用浏览器端页面跳转的方法,代码可以修改为:
php
正在进入.... "; break; case 'baidu': echo " "; break; case 'others': echo " "; break;}?>
【http-equiv实现跳转与header跳转有啥区别】请参照 http://segmentfault.com/q/1010000000703858
Put !--? php ...?-->
code block at the top of the file.
The
Header () is used to send custom HTTP messages.
Note that the header () must be called before any actual output, whether it is an ordinary HTML tag, a blank line in the file, a space or a blank line in the php> file, or a space.
This is a very common mistake, if you have a space or a blank line before the header () is called, either through Include,require or by its access to the function in other files
.
If you are not invoking other files, just use a single PHP or HTML file, and there will be output errors before the header () is called.
PHP Manual