Session_Variables_Soupermail

Buenos Dias Amigos!

I have a multipage form, quite simple actually... a form (page 1), a summary page (page 2), and a thank you page (page 3). Passing variables from p1 to p2 is established, however, upon finalizing the order in p2 and sending all of the pages content (hidden fields, fields, session variables) the session variables get dropped.

They do not appear in my email template that arrives in my inbox. I am using soupermail, but i do not think that is the problem.

I notced, that in my summary page (p2), where I re-display the users in put (<?php $_POST['VAR_NAME']; ?>) in an actual, editable txtField, that gets submitted and processed correctly. But, if I simply redisplay the sess_var on the page, it does not get submitted.

Any ideas?

Adios Amigos!

PlannettF
plannettAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

virmaiorCommented:
The session wouldn't follow through an e-mail... other than that, I'm not sure I can understand what you are asking.
0
BenMorelCommented:
Maybe the session is not started in each script. Remember to use session_start() in EACH of them.

There's 2 ways to achieve it with sessions :
1) with session_register()
First script :
<?php
 session_start();
 session_register('var_name');
 $var_name = "value";
?>
Second script :
<?php
 session_start();
 session_register('var_name');
 echo $var_name;
?>

2) with $_SESSION
First script :
<?php
 session_start();
 $_SESSION['var_name'] = "value";
?>
Second script :
<?php
 session_start();
 echo $_SESSION['var_name'];
?>

Note: don't use both session_register() and $_SESSION in the same script.

You can also do it without sessions, with hidden fields :
<input type="hidden" name="var_name" value="<?php echo htmlentities(@$_POST['var_name']); ?>" />

Or, if magic_quotes_gpc is enabled on your server :
<input type="hidden" name="var_name" value="<?php echo htmlentities(stripslashes(@$_POST['var_name')); ?>" />

Regards,
Ben
0
plannettAuthor Commented:
Page 1 has session start and session is started on the second page. Third page does not require it, as it is simply a "Thank you" page.

All of the data I am seeking to submit exists in page 2. Remember, in my original post, i stated that page 1 is the form, page 2 is a summary of 1 and that everything carried over just fine.

I think where I am confused is: do session_variables get submitted to soupermail when the user hits the submit button?

Apparently not, because nothing carries over into the results of the script.

Page 3 is irrelevant, it's a success page that gets called from a hidden value in page 2.

Thanks
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

virmaiorCommented:
I don't think session variables would carry into the perl script (soupemail).  You need to include the data as POST variables.  While it will be in the same session, I don't think soupemail is designed to take its values from SESSION vars.  So you'll need to include them in the post data being sent.  If you don't want the user to see them, use: "<INPUT type="hidden" value='your value'>

The manual seems to suggest that you can use $cookie_* for cookies (e.g. not $x but $cookie_x to get to the cookie x).  You might be able to use $cookie_ for session variables. g/l.

(from the manual):
If you want to check on cookies, prefix the cookie's name with $cookie_.
http://soupermail.sourceforge.net/manual.html
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ramonklownCommented:
just user your own PHP mail function
http://br2.php.net/manual/en/function.mail.php

example:
<?
session_start()
$_SESSION['email_add'] = $_SESSION['email_add'];

$message = 'Thanks for shopping';

if (mail( $_SESSION['email_add'], "the subject", $message,
     "From: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
     "Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n" .
     "X-Mailer: PHP/" . phpversion())){
echo 'success on mail send';
}
else { echo 'error on sending mail'; }

?>
0
Marcus BointonCommented:
PHP's implementation of sessions will be different to what you'll find in Perl, so session vars will not be available to Perl if you created them from PHP - unless there is a PHP_Session package in CPAN somewhere?

mail() is worth avoiding, especially on Windows. Use phpmailer instead:

http://phpmailer.sourceforge.net/
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.