Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - dbase password
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

dbase password

 Post Reply Post Reply
Author
sahdow View Drop Down
Newbie
Newbie


Joined: 17 May 2003
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sahdow Quote  Post ReplyReply Direct Link To This Post Topic: dbase password
    Posted: 22 May 2003 at 11:03am

Hello All,

I'm new to ASP and learn by example, basically a beginning coder.

I would like to setup a password protected area on my website that allows me to direct specific users to specific locations. When a person logs in Iwant them to go to their directory and nowhere else.

Can anyone provide a sample of asp code that would do this with an access dbase?



Edited by sahdow
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2003 at 12:59pm
response.redirect(rslogin("directory"))
Back to Top
farrukh View Drop Down
Groupie
Groupie
Avatar

Joined: 10 May 2002
Location: Pakistan
Status: Offline
Points: 147
Post Options Post Options   Thanks (0) Thanks(0)   Quote farrukh Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2003 at 5:13pm

 i cant understand wat u want. If u want only redirection then its given by Mart. If ne thing else then im waiting for it.

i have collected some nice avatars (37) and smileys (227) here you can download
http://www24.brinkster.com/webmastertool/download.html
Back to Top
Bluefrog View Drop Down
Senior Member
Senior Member


Joined: 23 October 2002
Location: Korea, South
Status: Offline
Points: 1701
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bluefrog Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2003 at 9:28am

What you're asking for requires preparation. If you are a beginning coder, learn the file system object(s). You'll need to create directories for each user. This is probably best done when you create the user - i.e. create the user and use an autonumber. In SQL something like:

User_Index int identity(1,1) NOT NULL CONSTRAINT PK_user_name1 PRIMARY KEY

You'll then be guranteed that each user will be unique.

Use the filesystemobject to create the directory when they register, then like posted above, use that column to determine where they go. You may wish to have a default set of files to write to their directory. I'd create that set and then read it in, replace whatever you need then write it to their directory.

What you've described is more than just a few lines of code. As posted above, response.redirect will do the redirection, and that's pretty much dirt simple. Here's a simple script that I use to write files (not directories):

<%
SUB fileWriter(PathName, FileName, FileString)

 dim fsoMyFile
 dim myfile
 SET fsoMyFile = CreateObject("Scripting.FileSystemObject")
 SaveToLocation = PathName & FileName
 SET myfile = fsoMyFile.CreateTextFile(SaveToLocation, 1, 0)

 myfile.write FileString
 myfile.close

 set fsoMyFile = nothing
 set myfile = nothing

END SUB
%>

The function accepts three things: the path (your directory), the new file name, and a string for the actual file you want to write.

I'll leave it up to you to figure out how to create directories. (It isn't that much different.)

HOWEVER - each page in the user's directory should check to find out if that is the right user, and if not, response.redirect ("../index.asp") or whatever. You'll probably need to use cookies there as well.

As for the Access database, that is the least of your worries. You've got a lot to figure out for what you've asked.

 

Back to Top
sahdow View Drop Down
Newbie
Newbie


Joined: 17 May 2003
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote sahdow Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2003 at 10:09am
Thanks for the help everyone, Now its time to start tinkering.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.