Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP (http://www.go4expert.com/articles/asp-tutorials/)
-   -   Simple Login in ASP using MS Access database (http://www.go4expert.com/articles/simple-login-asp-using-ms-access-t1237/)

shabbir 25Feb2008 09:26

Re: Simple Login in ASP using MS Access database
 
Just write the set of if's and then Response.Redirect to the correct page unless you have some definite logic for the redirection.

biztalk 26Feb2008 12:49

Re: Simple Login in ASP using MS Access database
 
So you mean like this

Normal
'If remember me selected
if RememberMe = "ON" then
'Writing cookies permanently
Response.Cookies("UserName")=UserName
Response.Cookies("Password")=Password
Response.Cookies("UserName").Expires = Now() + 365
Response.Cookies("Password").Expires = Now() + 365
Response.Redirect "welcome.asp"
else
'writing cookies temporarily
Response.Cookies("UserName")=UserName
Response.Cookies("Password")=Password
Response.Redirect "welcome.asp"
end if

My version
'If remember me selected
if RememberMe = "ON" then
'Writing cookies permanently
Response.Cookies("UserName")=test
Response.Cookies("Password")=test
Response.Cookies("UserName").Expires = Now() + 365
Response.Cookies("Password").Expires = Now() + 365
Response.Redirect "test.asp"
else
'writing cookies temporarily
Response.Cookies("UserName")=test
Response.Cookies("Password")=test
Response.Redirect "test.asp"
end if

nednilbor 8Mar2008 09:54

Re: Simple Login in ASP using MS Access database
 
do you have any sample code for the signup.asp so that new users could sign up?

carrathanatos 19Jun2008 21:43

Re: Simple Login in ASP using MS Access database
 
Hey, I copy and pasted your code over and created the database with microsoft access, and I keep getting this error:

HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

Technical Information (for support personnel)

* Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/news/verify.asp, line 37

* Browser Type:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0

* Page:
POST 45 bytes to /news/verify.asp

I'm not sure why either...

thanks for your help,

melissa

carrathanatos 19Jun2008 21:50

Re: Simple Login in ASP using MS Access database
 
biztalk:

make an extra field in the DB for each user called something like "redirectPage" or something, and then for the redirect where it says:

Response.Redirect "blah blah blah", replace with:

Set rsStudent = Server.CreateObject("ADODB.Recordset") 'this should go near the top of your code
Response.Redirect rsStudent("redirectPage")

and then at the end be sure to put:

rsStudent.Close
set rsStudent = Nothing

hope that helps! :)

carrathanatos 19Jun2008 21:51

Re: Simple Login in ASP using MS Access database
 
(the ifs are too messy, and it's much easier to just include it in our DB.)

kseanng 3Jul2008 20:38

Re: Simple Login in ASP using MS Access database
 
Hey guys,

I got this error message.

The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Click the Refresh button, or try again later.

Open the fica home page, and then look for links to the information you want.
HTTP 500.100 - Internal Server Error - ASP error
Internet Information Services

--------------------------------------------------------------------------------

Technical Information (for support personnel)

Error Type:
Microsoft JET Database Engine (0x80040E10)
No value given for one or more required parameters.
/verify.asp, line 38


Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)

Page:
POST 36 bytes to /verify.asp

POST Data:
username=????&password=????&B1=LogIn

Time:
Thursday, July 03, 2008, 10:03:38 AM


More information:
Microsoft Support

carrathanatos 3Jul2008 23:07

Re: Simple Login in ASP using MS Access database
 
If you're suffering the same problem as me, the closest I've been able to get to a pseudo-solution is that the actual CDONTS/CDOSYS cannot send the mail out because the port is being blocked by a firewall of some sort, or that the settings on the server won't allow mail to be sent out.

I don't have a system admin because they won't hire one, so I'm kind of stuck in cold water.

I hope you solve yours though....

oh, just to clarify, if you're having the same problem as me, then it's not a code problem, it's a server problem.

XXxxImmortalxxXX 7Jul2008 15:59

Re: Simple Login in ASP using MS Access database
 
got a question im looking for some scripts.

A sql detection script created in asp

a script to do a forgot password link


if any of you guys know one can u please post it thanks

kseanng 7Jul2008 23:05

Re: Simple Login in ASP using MS Access database
 
carrathanatos,

I figured out what was wrong with my code. In access database I named the column wrong. Here's a link. I hope this helps. http://www.adopenstatic.com/faq80040e10.asp


All times are GMT +5.5. The time now is 14:21.