Php jump-php prompts "headersalreadysentby" how to modify it!

Source: Internet
Author: User
Just a newbie, jump code someone else wrote for me, the purpose is to jump, the file is go. php when the URL is entered go. php? Idtaobao jumps to www.taobao.com and changes the host. The error "Warning: Cannotmodifyheaderinformation" is a newbie. The jump code is written by someone else to help me. The purpose is to jump to the file go. php.
When you enter go. php? When id = taobao, it will jump to www.taobao.com

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 learned that php. ini needs to be changed, but it is very troublesome to change the new host .. Is there any way to directly modify the above errors in the php code of the above file?

Code:


  Entering ....
  

How can I modify it? Thank you !!!

Reply content:

New guy, jump code someone else wrote for me, the purpose is to jump, the file is go. php
When you enter go. php? When id = taobao, it will jump to www.taobao.com

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 learned that php. ini needs to be changed, but it is very troublesome to change the new host .. Is there any way to directly modify the above errors in the php code of the above file?

Code:


  Entering ....
  

How can I modify it? Thank you !!!

The go. php page can only be used to determine whether to jump to the page. The html tag can be removed. The code of the go. php file can be reduced to the remaining php:

php
  

If the headers already sent error still persists, the editor that writes the Code hides the bom header information at the beginning of the file. You can search the relevant editor method on the Internet.

If you want to retain the html code and want to jump, you need to use the browser-side page Jump method. The code can be changed:

php
   Entering ....
   "; Break; case 'baidu': echo"
   "; Break; case 'others ': echo"
   "; Break ;}?>

What is the difference between http-equiv jump and header jump? Please refer to the http://segmentfault.com/q/1010000000703858

Set Put the code block at the top of the file.

Header () is used to send custom HTTP packets.
Note that header () must be called before any actual output, whether it is a common html Tag, empty lines in the file, spaces, or empty lines in the PHP> file.
This is a very common error. When using include, require, or other files
If there are spaces or empty rows before the header () is called.
If other files are not called, but only a PHP or HTML file is used separately, an error occurs before the header () is called.
Php Manual

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.