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 字符串中收到的变量?
基础教程推荐
- Web 服务器如何处理请求? 2021-01-01
- 使用 scandir() 在目录中查找文件夹 (PHP) 2022-01-01
- 将变量从树枝传递给 js 2022-01-01
- PHPUnit 的 Selenium 2 文档到底在哪里? 2022-01-01
- php中的PDF导出 2022-01-01
- 如何在数学上评估像“2-1"这样的字符串?产生“1"? 2022-01-01
- Yii2 - 在运行时设置邮件传输参数 2022-01-01
- 主题化 Drupal 7 的 Ubercart “/cart"页 2021-01-01
- php中的foreach复选框POST 2021-01-01
- php 7.4 在写入变量中的 Twig 问题 2022-01-01
