如何使用PHP让网页直接跳转

如题所述

在php文件内让当前操作的网页跳转,一般经常用的有两种方法:1.用php自带的函数法:执行玩动作后,加上这个就会跳转:header("Location:http://~~~~.com");2.用js的方法:加上这句:echo "<script>window.location.href='http://~~~~~.com';</script>";
温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-07-05
<input type="button" value="跳转" onclick="window.location.href='a.php'"/>
或者是使用一个点击函数传入值:
<input type="button" value="跳转" onclick="tiao('a.php')"/>
<script type="text/javascript">
function tiao(urls){
window.location.href=urls;//根据传过来的地址跳转
}
</script>