php中实现页面跳转的几种方式,亲测有效!!!

一、在PHP脚本代码中实现

 <?php  header("location:url地址") ?> 

二、在js脚本代码中实现

1.[removed].href方法

[removed]
  [removed].href="XX.php"          
[removed]

2.[removed].assign方法

[removed][removed].assign("helloworld.php");
[removed]

3.[removed].replace方法

[removed]
  [removed].replace("helloworld.php");
[removed]

4.window.open方法 三个参数,第一个URL地址。第二个打开新页面方式(比如新页面_blank,_new,自身跳转_self),第三个是新页面的方式,包括样式,位置等。

[removed]
  window.open("index.php",_blank,width=300px);
[removed]


三、使用HTML脚本代码完成跳转

在<head>标签里执行代码直接插入这句代码就可以

<meta http-equiv="refresh" content="3;url='XX.php'"> 

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
意见
建议
发表
评论
返回
顶部