Re: PHP Session variable
| From: | Richard Davey | Date: | Tue, 27 Mar 2007 14:40:36 +0000 |
| Subject: | Re: PHP Session variable | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251456@lists.php.net to get a copy of this message | ||
Chris Carter wrote:
session_start(); session_register ("tamma"); $HTTP_SESSION_VARS ["tamma"] = $email;Use $_SESSION. HTTP_SESSION_VARS is deprecated and hasn't been used since PHP 4.0.6 (or rather, shouldn't have been) You don't need session_register().
On the webform: <? $HTTP_SESSION_VARS ["email"] = $email; ?>This is *setting* the session value. You want to READ it here. You could do it like this: Page 1: session_start(); $_SESSION['tamma'] = $email; Mail Form: session_start(); echo '<input type="hidden" name="email" value="' . $_SESSION['tamma'] . '">'; Then it will come into your mail PHP script as a standard REQUEST value. Or of course, you could skip 'hiding' it on the mail form completely, and just access it directly in the mail script: session_start(); $email = $_SESSION['tamma']; Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk "Never trust a computer you can't throw out of a window"