I think that is what I want to do. Here is my scenario:
I have 5 forms. Each is an HTML page, that when the submit button is pressed, posts the data to a PHP page for processing (the viewer just gets taken to the next form). On the PHP page, the data is formatted and sent as an email. The problem is that the email address of the viewer is only asked for and entered on the first form, yet each of the five forms will send an email, and will need that viewers address as an $EmailFrom variable.
I wanted to pass just the email address from the first form where it is physically entered, to each of the other forms. I don't think that a "GET" method will work since there is way too many fields on the form and it will be too much data to pass in a url. So, I thought that storing a session variable would be my best bet. My thoughts were to put it in the first HTML page, and then destroy it in the last PHP page. But I have never done this, and have not had any luck yet.
I put this code on my first HTML page, in between the DTD and the HTML tag:
<?php
session_start();
?>
Then I put this on the bottom of my PHP page:
$_SESSION['from']= $EmailFrom ;
Then on each of the remaining PHP pages, I entered this at the top:
$EmailFrom = $_SESSION['from'];
But the email address I see on the actual email I receive is:
"INVALID_ADDRESS@.SYNTAX-ERROR." <INVALID_ADDRESS@.SYNTAX-ERROR.
Can anyone help me to understand this a little better?
Thank you!