HighDots Forums  

URL Variables

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss URL Variables in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jeremy Williams
 
Posts: n/a

Default URL Variables - 07-01-2005 , 11:35 PM






I am trying to basically accomplish what Macromedia has done on this site.
When a user logs in, I want to create a message at the top of the page that
says, "Welcome, [UserName]." I am aware that I probably need to do this by
passing along a URL variable from the login page (probably on the submit
button) that will then appear on the top of my navigation bar on all the
subsequent pages for the remainder of the session.

I know I need to add a URL variable to the bindings panel. I want to pass
along the users first name. That field name in my Access Database (oh yeah,
I'm coding in ASP VBScript) is "FirstName." So, it should read "Welcome,
FirstName." I am really lost, however, at how to code the two pages. The
first page, being the Log In page that will pass the variable, and then the
subsequent pages that will then display the now dynamic navigation bar to
display the welcome message.

I know there are a lot of you who are no doubt much smarter than I am on this.
Any suggestions? Thank you in advance. FYI, I have already successfuly set
up my login pages using my Access database.




Reply With Quote
  #2  
Old   
J.S. \(UltraSuite\)
 
Posts: n/a

Default Re: URL Variables - 07-02-2005 , 02:58 AM






On your login page if login is successful then set the first name of the
user to a session variable. Then on any page that you wish to retrieve that
just use:

Welcome <%=Session("sessionvarname")%>

--
__________________________________________________ __________________
UltraSuite Extension Packages: http://www.ultrasuite.com/
The *most popular* Suites of DMX 2004 and DMX Server Behaviors
for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
__________________________________________________ __________________



Reply With Quote
  #3  
Old   
Jeremy Williams
 
Posts: n/a

Default Re: URL Variables - 07-02-2005 , 01:15 PM



This is excellent advice. Can you please explain further how I would add the
session variable to the login page? For example, I have a "Log In User"
variable listed under the server behaviors panel in Dreamweaver. It is
connected to the "submit" button on the login form. Would I select the submit
button and attach the server variable in that way?

Also, I understand that I need to add the server variable through the bindings
panel. Would I select "Request Variable" or "Session Variable?" What would I
enter as the name--the "FirstName" field from the table in my database?

In summary, I don't quite understand how to first, insert the session variable
and secondly, how to hook that session variable up to pass the "FirstName"
along to the following pages.

Thank you!


Reply With Quote
  #4  
Old   
CarlGrint
 
Posts: n/a

Default Re: URL Variables - 07-02-2005 , 04:00 PM



Actually that is just adding extra work, where it is not needed.

When you user logs in, the Dreamweaver login behaviour creates a Session
called MM_Username, which is the Username of said person.

You can simply place a recordset on each page which is filtered by said
MM_Username session and gives you the full details in your users table, and
thus you can place their Forename and Surname and any other details you want on
the page.
This will also mean you can give them the option to update their details.

I have a free tutorial on creating the login area which you might find useful:

http://www.cgw3.co.uk/tutorials/tuto...&TutorialID=31


Originally posted by: Jeremy Williams
This is excellent advice. Can you please explain further how I would add the
session variable to the login page? For example, I have a "Log In User"
variable listed under the server behaviors panel in Dreamweaver. It is
connected to the "submit" button on the login form. Would I select the submit
button and attach the session variable in that way?

Also, I understand that I need to add the session variable through the
bindings panel. Would I select "Request Variable" or "Session Variable?" What
would I enter as the name--the "FirstName" field from the table in my database?

In summary, I don't quite understand how to first, insert the session variable
and secondly, how to hook that session variable up to pass the "FirstName"
along to the following pages.

Thank you!




Reply With Quote
  #5  
Old   
Jeremy Williams
 
Posts: n/a

Default Re: URL Variables - 07-02-2005 , 09:45 PM



CarlGrint,

Thank you for your help. I have it working! I do have one question, though.
I have inserted the following code at the top of my navigation bar:

Welcome, <%=Session("MM_UserID")%>!

The problem I am having is that before anyone logs in, the navigation bar
shows (of course):

Welcome, !

Is there any way to have the "Welcome, !" only show along with the user's name
once the user has logged in?


Reply With Quote
  #6  
Old   
J.S. \(UltraSuite\)
 
Posts: n/a

Default Re: URL Variables - 07-05-2005 , 12:49 PM



"CarlGrint" <webforumsuser (AT) macromedia (DOT) com> wrote

Quote:
Actually that is just adding extra work, where it is not needed.
Not everyone uses the built-in login server behavior and for those who don't
MM_Username will not work.


--
__________________________________________________ __________________
UltraSuite Extension Packages: http://www.ultrasuite.com/
The *most popular* Suites of DMX 2004 and DMX Server Behaviors
for ASP, ASP.Net, ColdFusion, JSP, and PHP_MySQL
__________________________________________________ __________________




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.