如何通过php标头重定向传递在GET字符串中收到的变量? [英] How to pass variables received in GET string through a php header redirect?

查看:29
本文介绍了如何通过php标头重定向传递在GET字符串中收到的变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在用户提交表单后从 Aweber 接收 GET 字符串中的值.我将他们发送的变量提交给 SMS 网关,以通过短信通知第三方提交.

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字符串中收到的变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆