
PHP中重定向网页跳转页面的办法有三种,上面为各人具体引见一下。
第一种:行使header()函数进行重定向,这也是我用的较多的。(留意!location以及“:”之间不克不及有空格,不然无作用!)
<?php
header('content-type:text/html;charset=uft-8);
//重定向页面
header('location:index.php');
?>第二种:行使HTML 头部中的 meta标签,界说http-equiv=refresh 以及content=”跳转破费的工夫(秒为单元);url=跳转地点”
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
//跳转页面,跳转工夫:3秒钟,指标地点:index.php
<meta http-equiv="refresh" content="3;url=index.php">
<title>skip...</title>
</head>或许
<?php
header('content-type:text/html;charset=utf-8');
$url='index.php';
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
//跳转页面,跳转工夫:2秒钟,指标地点:index.php
<meta http-equiv="refresh" content="2;url=<?php echo $url; ?>">
<title>skip...</title>
</head>第三种:行使javascript进行跳转
<?php
header('content-type:text/html;charset=utf-8');
$url='index.php';
//立刻跳转至指标页面
echo <script>window.location.href='$url';</script>;
?>以上内容仅供参考!
保举视频教程:PHP视频教程
以上就是php重定向后跳转没有了的具体内容,更多请存眷资源魔其它相干文章!
标签: php php开发教程 php开发资料 php开发自学 跳转 重定向
版权声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。
抱歉,评论功能暂时关闭!