开发者

Session to save "email" not passing onto confirmation page because of form.php

This is my process. Ive attached a link to each page so you can see the exact code since its important. I cant solve this problem.

page.php (where the form resides on, its at the bottom of the page)

form.php (where the this form and others are processed and the data is saved into the CRM)

开发者_StackOverflow社区

confirmation.php (where page.php redirects on after POST submit)

Basically i have a form on page.php that form POSTS to form.php where the data is saved into a CRM script and then redirects to confirmation.php.

I need to pass the "email" value onto confirmation.php What i did was i used a session on form.php to save the email value and then echo it on confirmation. Please check the code above to see how.

But the result? Its not working, the email is not being echoed on confirmation.php

Any ideas?

Importants part of the codes above (in my opinion):

On form.php at the very top:

<?php 
session_start();    
$_SESSION['contact'] = $_POST['email']; 
?>
<?php

On confimation.php at the very top:

<?php 
session_start(); 
?>
<?php

on confirmation.php i then echo it:

<?php echo $_SESSION['contact']; ?>

But its not working.


Just add the email address to the query string for the thank you URL.

Assuming the thank you URL doesn't already have variables in the query string, then this is all you have to do:

In form.php, change this:

if ($thanksurl) {
  header('Location: ' . $thanksurl);
}

To this:

if ($thanksurl) {
  $thanksurl .= '?email=' . $email;
  header('Location: ' . $thanksurl);
}

If there's already variables in the URL, then you'd want the additional line to look like this, with an ampersand instead of a question mark:

$thanksurl .= '&email=' . $email;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜