How to pass variables received in GET string through a php header redirect?(如何通过 php 标头重定向传递 GET 字符串中收到的变量?)
问题描述
在用户提交表单后,我从 Aweber 接收 GET 字符串中的值.我获取他们发送的变量并将它们提交到 SMS 网关,以通过短信通知第 3 方提交.
I'm receiving values in a GET string from Aweber upon user's submission of a form. I take the variables they send and submit them to a SMS gateway to notify a 3rd party of the submission by text message.
这是我的问题.我需要将在 php 标头中执行传出 SMS 命令的页面重定向到另一个页面,该页面最终显示从 Aweber 发送的 GET 变量.
Here's my problem. I need to redirect the page that performs the outgoing SMS commands in a php header to another page that finally displays the GET variables sent from Aweber.
我可以在第一页检索变量及其值.如何将它们传递到第二页?
I can retrieve the variables and their values in the first page. How do I pass them to the second page?
这是我在第一页 (sms.php) 上用来收集 Aweber 发送的变量的代码:
Here is the code I'm using on the first page (sms.php) to collect the variables sent by Aweber:
$fname = $_GET['name'];
$femail = $_GET['email'];
$fphone = $_GET['telephone'];
....etc
header('Location: confirmed.php');
exit;
推荐答案
session_start();
$_SESSION['fname'] = $_GET['name'];
$_SESSION['femail'] = $_GET['email'];
$_SESSION['fphone'] = $_GET['telephone'];
....etc
header('Location: confirmed.php');
然后在下一页获取它,例如:
and get it on the next page like:
session_start();
$fname = $_SESSION['fname'];
$femail = $_SESSION['femail'];
$fphone = $_SESSION['fphone'];
....等
这篇关于如何通过 php 标头重定向传递 GET 字符串中收到的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何通过 php 标头重定向传递 GET 字符串中收到的变量?


基础教程推荐
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01
- 在多维数组中查找最大值 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01