Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Redirection to a unique page based on user/pass in ASP

Posted on 2004-04-27
8
Medium Priority
?
216 Views
Last Modified: 2010-04-06
I have a logon set up, but I'm looking to redirect the users to a page that will have info specifically for them.  I have considered storring the page in the database and then getting it once the pass/user are checked.  Also, I'm trying to figure out how to protect these pages.  I've thought of using the session variable to restrict access, but I could use some coding examples on this.  I'm a newbie with ASP, so as much step through as you can give would help.  I place a high value on this and I'm not in the same time crunch I was, but time is somewhat of a factor.
0
Comment
Question by:themikecooke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
8 Comments
 
LVL 10

Assisted Solution

by:m8rix
m8rix earned 400 total points
ID: 10935925
First of all, read the tutorial on this page http://www.codefixer.com/tutorials/session_cookies.asp, it is very straight forward and easy to follow there.

In addition to that you can set a cookie:

Session("UserAccount")=Username

and query your database with this information.
0
 
LVL 6

Accepted Solution

by:
pkaleda earned 1600 total points
ID: 10938837
Another great resource for ASP and all other web dev subjects is http://www.w3schools.com/.  You can start by reading ASP section.  they have an area for Sessions as well.

What I would do is store the information you want to show teh user in a database.  Tie it to a user id or username.  when they login, you can do this?

<%
session("Username") = rs("Username") ' rs is teh recordset from a database or you can use any other way to set it.
session("UserID") = rs("UserID")
%>

Then you create a single page that pulls the information from a database and displays it based on the user.

<%
Userid = Session("UserID")

conn=Connect String
sql = "Select * from userinfotable where userid = '"&userid&"'"
set rs = conn.execute(sql)

If not rs.eof then
on error resume next
while not rs.eof
response.write("here is your info "&rs("column1")&"<br />")
rs.movenext()
wend
end if
%>

Now you have one page that is used by all users, but the info displayed is taylored based on thier userid or username.

PK
 
0
 

Author Comment

by:themikecooke
ID: 10943911
PK
   I'm liking your solution.  Basically I have a ppt that I want the user to have access to and to be able to see.  Each presentation is tailored to the user.  I'm going to play with this solution a for another 12 hours before closing the question.  Thanks for the help!
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 6

Expert Comment

by:pkaleda
ID: 10944289
Cool.  Glad I can help.  I think this is a great simple solution.
0
 
LVL 6

Expert Comment

by:pkaleda
ID: 10944298
You can also when they go to the page, have it auto redirect them to teh PPT so it opens without them having to click anything.
0
 
LVL 10

Expert Comment

by:m8rix
ID: 10944545
> First of all, read the tutorial on this page http://www.codefixer.com/tutorials/session_cookies.asp, it is very straight
> forward and easy to follow there.

> In addition to that you can set a cookie:
>
> Session("UserAccount")=Username
>
> and query your database with this information.

Thanks to PK for following on from my post and demonstrating on how to query your database with the user information I specified.

all you have to do now is store the ppt file name in a database field so when the user's log in has been authenticated you can then retrieve the personalised ppt file.

The best thing about this is that you can display any number of ppt files for each unique user.

Glad we could help.

m8rix
0
 
LVL 6

Expert Comment

by:pkaleda
ID: 10948860
Thank you for the A.  Glad we could help.
0
 

Author Comment

by:themikecooke
ID: 10956150
Can you give me some coding for how I might display the ppt files.  I would like to have them as pps files so that they simply run.  But, I can pull the location from the database, but how do I open the pps in a new window.  Any suggestions would be greatly appreciated.

Mike
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question