Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login.asp

Status
Not open for further replies.

jmurrayhead

Programmer
Joined
Feb 13, 2004
Messages
47
Location
US
Okay...what I'm doing is using the script provided by the Database Interface wizard to create a user login page. My server doesn't support the fancy stuff but this works. Does anyone know how I can re-write the script to support more than one user? I've tried a few things but they don't seem to work. Also, I want to make the cookies expire after a half hour rather than when the session is ended. How would I go about doing this?

Thanks in advance!

Jason
 
You need to use something like this.


con.Open...
set rs=Server.CreateObject("ADODB.Recordset")

user=Request("user")
pwd=Request("pwd")
sql="select * from users where user='"&user&"' and pwd='"&pwd&"'"
rs.Open sql,con,3,3

if rs.RecordCount=1 then
'it's the right user
Response.Cookies("looged")=true
Response.Cookies("looged").Expires=DateAdd("n",30,Now)
Response.Redirect "loginok.asp"
Response.End
end if

This is the main scenario. Table users contains the permited user logons to the site.

________
George, M
 
How do I make the table users? I haven't programmed in visual basic since high school, and that was with the Visual Basic program. Never done it on a web server. Also, my web is on an Apache server...so would that even work?

Thanks for your input!
 
Are you using APACHE+PHP+MySql? or APACHE with ASP Suport?

________
George, M
 
It's an Apache with ASP support. I can't use Access databases or anything like that, but the ASP page that the database interface wizard creates for the login page does work.

Thanks
 
You can store users to a file or to an array and compare them.
Also you should be able to access an Access database.

One more thing. You are under Linux/Unix? or Windows? if Windows why not use IIS?

________
George, M
 
I use Windows. As far I know, IIS costs money in which I do not have to spend on this at the moment. It all comes down to my ISP and what they give me access to. I may be wrong about the ASP support as well. FrontPage extentions are installed on the server, but some things aren't even activated. I would like to try through Access databases, but all that I have tried give me script errors. Even in the database interface wizard, after I upload it I get script errors. I can login to the database editor part, but after that, none of the data can be read.

Thanks,
 
I'm sorry i'm not familiar with the Apache's ASP suport and database access but as far as i knw IIS should be free and included in any Windowx XP-PRO, NT,2000,2003 also you can get PWS which it should work also on Windows XP Home and Windows 98. Windows 98-SE should have PWS(personal web server) you just need to install.

________
George, M
 
Well, I resorted to setting up on a different ISP. Windows 2003 server, IIS, ASP.net...all the goodies. Thanks for your help, though. I can now use Sharepoint Team Services and what not.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top