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 字符串中收到的变量?
基础教程推荐
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
