PHP頁面跳轉

2021-09-01 06:30:20 字數 613 閱讀 1707

header()函式的主要功能是將http協議標頭(header)輸出到瀏覽器。

語法header(string,replace,http_response_code)

string

必需。規定要傳送的報頭字串。

replace

可選。指示該報頭是否替換之前的報頭,或新增第二個報頭。

預設是 true(替換)。false(允許相同型別的多個報頭)

可選。把 http 響應**強制為指定的值。(php 4 以及更高版本可用)

<?php

//頁面跳轉

header('location:test.html');

die;

在用header前不能有任何的輸出

header後的php**還會被執行,所以要用die或exit終止。

例如,此**可以放在程式中的任何合法位置。

echo <

PHP頁面跳轉

if isset url url echo cho meta http equiv refresh content 秒數 url 跳轉的檔案或位址 其中 xx是秒數,0為立即跳轉.refresh 是重新整理的意思.url 是要跳轉到的頁面.url echo 其中 更改 self 就可以實現跳轉限制原...

php頁面跳轉

php中如何跳轉,我們看下面的 form3.php html head head title title script type text css script form action formprocess3.php method post body table tr td name td td ...

php頁面跳轉

php中如何跳轉,我們看下面的 form3.php html head head title title script type text css script form action formprocess3.php method post body table tr td name td td ...