Skip to main content
Participating Frequently
September 22, 2008
Question

Creating a session variable with PHP

  • September 22, 2008
  • 1 reply
  • 418 views
Can anyone offer me a PHP script that creates a session variable? The Dreamweaver CS3 Help documentation offers coding samples for ColdFusion and ASP but not for PHP. I tried this without success:
"$_SESSION['usermail']= $_POST['sub_email'];" in which I am trying to capture an email address from a form and save it to use in a confirmation email to a new subscriber. Any help would be sincerely appreciated.
najrellim@gmail.com
This topic has been closed for replies.

1 reply

Inspiring
September 22, 2008
I use this -

<?php

if (!isset($_SESSION)) {
session_start();
}
?>

at the top of the page, and then this within the code block where you are
processing the form's data -

$_SESSION['usermail']= $_POST['sub_email'];

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Jugdish" <webforumsuser@macromedia.com> wrote in message
news:gb8aov$691$1@forums.macromedia.com...
> Can anyone offer me a PHP script that creates a session variable? The
> Dreamweaver CS3 Help documentation offers coding samples for ColdFusion
> and ASP
> but not for PHP. I tried this without success:
> "$_SESSION['usermail']= $_POST['sub_email'];" in which I am trying to
> capture
> an email address from a form and save it to use in a confirmation email to
> a
> new subscriber. Any help would be sincerely appreciated.
> najrellim@gmail.com
>