php教程之get传值方式-灵活性

[复制链接]
查看1856 | 回复0 | 2020-9-27 15:10 | 显示全部楼层 |阅读模式
php教程之get传值方式-灵活性
get很灵活,只要有页面的跳转就可以传递参数
post不灵活,post提交需要有表单的参与
1、 html跳转
   <a href="index.php?name=tom&age=20">跳转</a>

2、JS跳转
<script type="text/javascript">
        location.href='index.php?name=tom&age=20';
        location.assign('index.php?name=tom&age=20');
        location.replace('index.php?name=tom&age=20');
</script>

3、PHP跳转
header('location:index.php?name=tom&age=22')

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

UID
1
贡献
387
丢币
38902
主题
4607
回帖
116
注册时间
2018-9-25
最后登录
2024-4-26