亚洲最大看欧美片,亚洲图揄拍自拍另类图片,欧美精品v国产精品v呦,日本在线精品视频免费

  • 站長資訊網
    最全最豐富的資訊網站

    php header方法跳轉頁面問題

    php header方法跳轉頁面:1、立即跳轉,代碼為【header('Location:other.php')】;2、提示跳轉,代碼為【header('Refresh:3,Url=other.php');echo '3s 后跳轉'】。

    php header方法跳轉頁面問題

    php header方法跳轉頁面:

    header()為php函數,向瀏覽器發(fā)送指定命令

    html:

    <meta http-equiv="Refresh" content="3;url=other.php"/>

    立即跳轉:

    header('Location:other.php'); //file_put_contents('bee.txt','execute'); die;

    執(zhí)行header時候,并不是立即結束,而是會把頁面執(zhí)行完畢;在header前面不能有任何輸出,若有開啟輸出緩沖則不提示錯誤,

    php.ini->output_buffering = 4096|OFF

    提示跳轉:

    header('Refresh:3,Url=other.php'); echo '3s 后跳轉'; //由于只是普通頁面展示,提示的樣式容易定制 die;

    封裝的跳轉函數:

    /*  *跳轉  *@param $url 目標地址  *@param $info 提示信息  *@param $sec 等待時間  *return void */ function jump($url,$info=null,$sec=3) {  if(is_null($info)){   header("Location:$url");  }else{   // header("Refersh:$sec;URL=$url");   echo"<meta http-equiv="refresh" content=".$sec.";URL=".$url.">";   echo $info;  }  die; }

    相關學習推薦:PHP編程從入門到精通

    贊(0)
    分享到: 更多 (0)
    網站地圖   滬ICP備18035694號-2    滬公網安備31011702889846號