<? PHP
If (1 ){
Header ("Location: http://www.baidu.com /");
}
Header ("Location: 01.php ");
Header ("Location: 03.php ");
Header ("Location: http://www.sina.com ");
Echo & quot; 111 & quot ";
Header ("Location: http://www.g.cn ");
Echo & quot; 222 & quot ";
Header ("Location: http://www.163.cn ");
Echo & quot; 333 & quot ";
?>
Why does the above Code not jump to the header ("Location: http://www.baidu.com /");?
Another problem is that the server reads the PHP file and sends it to the client a little bit, or does it send it to the client after reading it once? How does JavaScript read it?
PHP scripts are read sequentially from top to bottom, after one-time reading on the server end to the client, this file, when read if should be sent header ("Location: http://www.baidu.com /"); however, there are headers ("Location: 01.php") below ");
Header ("Location: 03.php ");
Header ("Location: http://www.sina.com"); will continue to read the last line, Echo priority is lower than the header, when many headers are tied together will display the last line, just like displaying an array, $ Forum [] Only displays the last record in the array when you write echo $ forum. Javascript is a client script. After downloading your page, all the Javascript script files are already in your computer and will only respond to the operations.