user1322707 user1322707 - 9 months ago 39
PHP Question

How to pass variables received in GET string through a php header redirect?

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.

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?

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'];

header('Location: confirmed.php');

$_SESSION['fname']   = $_GET['name'];
$_SESSION['femail']  = $_GET['email'];
$_SESSION['fphone']  = $_GET['telephone'];

header('Location: confirmed.php');

and get it on the next page like:

$fname   = $_SESSION['fname'];
$femail  = $_SESSION['femail'];
$fphone  = $_SESSION['fphone'];