Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 18th, 2005, 03:31 AM
Authorized User
 
Join Date: Jan 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default Session Variable

how to use session variable in dreamweaver mx.. to keep track of the user id ...

youyou
__________________
youyou
 
Old January 19th, 2005, 03:01 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In ASP, you can use this:

Session("TheUser") = "youyou" ' to assign it

Dim theUser
theUser = Session("TheUser") ' to retrieve it.

In DW you can create a "dynamic variable" for a Session variable which you can drag and drop in your code and page, but personally, I never find it worth the trouble to create it. I always code them directly.

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Falling Away With You by Muse (Track 6 from the album: Absolution) What's This?
 
Old January 19th, 2005, 10:57 PM
Authorized User
 
Join Date: Jan 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thks ...
so how do i retrieve the userid and put it in the home page "Hello John" when the user John had login

youyou
 
Old January 20th, 2005, 02:49 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

With the code I showed you (assuming ASP, since you didn't specify the technology you use):

<%
Dim theUser
theUser = Session("TheUser") ' to retrieve it.
Response.Write(theUser)
%>

Or, somewhere embedded in a page:

<h1>Welcome, <%= Session("TheUser") %></h1>

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old January 20th, 2005, 11:48 AM
Authorized User
 
Join Date: Jan 2005
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thks for ur help ....

youyou





Similar Threads
Thread Thread Starter Forum Replies Last Post
session and variable... badboy1 ASP.NET 3.5 Basics 1 August 3rd, 2008 09:14 AM
Session variable anuradha80 General .NET 3 November 4th, 2004 12:39 AM
Session variable mrideout BOOK: Beginning ASP.NET 1.0 1 August 12th, 2004 07:01 PM
Session Variable mcdowell BOOK: Beginning ASP 3.0 5 June 20th, 2004 05:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.