Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases 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 July 31st, 2004, 06:13 PM
Authorized User
 
Join Date: Jul 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Passing Session Variables to the Next Page

Hi All,

I need some help passing session variables from my login page to the next page. This is what I am trying to do:

- When users of the Human Resources Department access the next few pages via a login page, I want them to only see a button that is for Human Resources.
- Conversely, when users of the Information Services Department access the next few pages via a login page, I want them to only see a button that is for Information Services.

The order of the pages is as follows:
1.) Login Page
2.) Default Thank You Page (telling users that the login was successful)
3.) User Interface Page (where the user, depending on which department they are from, can only view specific buttons that pertain to their department).

I thought I was doing it correctly with the following code for the 'User Interface Page':

<MM:If runat="server"
Expression='<%#(session("sessDepartment")="HR")%>' >
<ContentsTemplate>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="108" height="46">
                      <param name="BGCOLOR" value="">
                      <param name="movie" value="HR Button (Dept Module).swf">
                      <param name="quality" value="high">
                      <embed src="HR Button (Dept Module).swf" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="108" height="46" ></embed>
                    </object>
</ContentsTemplate>
</MM:If>

On the page before (the 'Default Page'), I have the following script:

<script runat="server" language="VB">
Sub Page_Load()
Session("sessDepartment")=Request("hfDepartment")
Session("sessEditPages")=Request("hfEditPages")
End Sub
</script>

On the page before that, the 'Login Page', I have the following code which authenticates the Username. In my Access Database, I have two tables that are linked which should pull the Department that the username is from. Here is the Login Page code:
<%
if dsLogin.RecordCount > 0 then
Session("sessUsername") = Request.Form("tfUsername")
FormsAuthentication.RedirectFromLoginPage("tfUsern ame.value", true)
else if ((Request.Form("tfUsername"))) <> Nothing _
OR ((Request.Form("tfPassword"))) <> Nothing
Response.Write("Login Failed. Please Try Again.")
end if
%>

Any thoughts to why this is not working? Oh yeah, I'm using Dreamweaver as an application.
Thanks,
Jim




 
Old August 1st, 2004, 04:42 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Is this an ASP application or an ASP.NET app?

If it's ASP.NET, I think you're better off posting in one of the ASP.NET forums. This forum is for "classic" ASP database problems, so I don't think your problem fits in the topic of this forum....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Baby I'm a Star by Prince and the Revolution (Track 8 from the album: Purple Rain) What's This?
 
Old August 1st, 2004, 01:59 PM
Authorized User
 
Join Date: Jul 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Imar. I'll post there.

Jim






Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing session variables from login page. captainzorro Classic ASP Components 1 April 23rd, 2008 11:54 PM
Passing session variables from IIs to Tomcat aman thaper Internet Information Services 0 November 14th, 2006 09:34 AM
passing variables through session dmlocke Beginning PHP 4 May 4th, 2005 10:35 PM
Passing Session Variables to the Next Page [email protected] ASP.NET 1.0 and 1.1 Professional 1 August 1st, 2004 06:25 PM





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