Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Creating a session variable with PHP

Community Beginner ,
Sep 22, 2008 Sep 22, 2008

Copy link to clipboard

Copied

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
TOPICS
Server side applications

Views

390
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 22, 2008 Sep 22, 2008

Copy link to clipboard

Copied

LATEST
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
>

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines