php跳转重定向页面的方法:1、利用【header()】函数进行重定向;2、利用html头部中的meta标签;3、利用javascript进行跳转,代码为【$url='index.php'】。
php跳转重定向页面的方法:
第一种:利用header()函数进行重定向,这也是我用的较多的。(注意!locationhe和“:”之间不能有空格,否则无作用!)
<?phpheader('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>或者
<?phpheader('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进行跳转
<?phpheader('content-type:text/html;charset=utf-8');$url='index.php';//立即跳转至目标页面echo <script>window.location.href='$url';</script>;?>
牛刀云开发网站如何部署服务器网站打开好慢-其他问题云服务器怎么安装plc软件核实了都是没有问题的请查看下什么原因被拒绝云服务器和物理服务器哪个好用一点宝塔面板如何部署安全证书电脑出现qq闪退怎么回事|电脑出现qq闪退的解决方法显示有有害信息请帮忙打开