But I'm dealing with putting the information from a recordset
into a session variable. I don't know what form variables are.
Also, why do I need TWO session variables? Why can't I just use one
for the recordset field I'm storing? And how do I know if I'm using
POST?
Nancy - Adobe Comm. Expert wrote:
> PHP sessions are more complicated.
No, they're not.
> You also have to start and
> register sessions like this:
>
> <?php session_start(); // This connects to the
existing session
> session_register ("name"); // Create a session variable
called name
> session_register ("job"); // Create a session variable
called job
> $HTTP_SESSION_VARS ["name"] = $name; // Set name = form
variable $name
> $HTTP_SESSION_VARS ["job"] = $job; // Set job = form
variable $job
> ?>
No, no, no!!! That is deprecated code that will break on most
modern
servers. This is the correct way to write the above example.
--
David Powers, Adobe Community Expert
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/
PHP sessions are more complicated. You'll have to make sure
the host hasn't
disabled them on the server for starters. You also have to
start and
register sessions like this:
<?php session_start(); // This connects to the existing
session
session_register ("name"); // Create a session variable
called name
session_register ("job"); // Create a session variable
called job
$HTTP_SESSION_VARS ["name"] = $name; // Set name = form
variable $name
$HTTP_SESSION_VARS ["job"] = $job; // Set job = form
variable $job
?>
--
Nancy Gill
Adobe Community Expert
Author: Dreamweaver 8 e-book for the DMX Zone
Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
2003)
Technical Editor: Dreamweaver CS3: The Missing Manual,
DMX 2004: The Complete Reference, DMX 2004: A Beginner's
Guide
Mastering Macromedia Contribute
Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
Web Development
After you do that, you can create a binding in the Data
Bindings window by
using the + and choosing Session Variable and naming it
mysession (as in the
example). That will create the binding that you can use
whereever you wish
on your page to get the value to show up.
Note .. the above is ASP .. you didn't specify your server
model.
--
Nancy Gill
Adobe Community Expert
Author: Dreamweaver 8 e-book for the DMX Zone
Co-Author: Dreamweaver MX: Instant Troubleshooter (August,
2003)
Technical Editor: Dreamweaver CS3: The Missing Manual,
DMX 2004: The Complete Reference, DMX 2004: A Beginner's
Guide
Mastering Macromedia Contribute
Technical Reviewer: Dynamic Dreamweaver MX/DMX: Advanced PHP
Web Development