求助:PHP页面跳转 丢失 $_POST 数据
PHP页面跳转 丢失 $_POST 数据
test.php 内容如下
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
$_POST["aa"] = 111;
header("Location: " ."/test1.php");
exit(0);
<!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --> var_export($_POST);
$_POST["aa"] = 111;
header("Location: " ."/test1.php?aa=".$_POST["aa"]);
<br><font color="#e78608">------解决方案--------------------</font><br>跳转没法传参的<br>除非你用框架的那种带传参的是可以赋值的(不是真正的跳转是输出页面)
<br><font color="#e78608">------解决方案--------------------</font><br>header("Location:/test1.php")只是告诉浏览器,跳转到test1.php.<br>想不通为何要这么设计程序,原始数据直接提交到test1.php处理,轻松解决了不是。<br>
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号