logon.asp and validate .asp problems
This is the validation code below but it does not work
it comes up with the following
HTTP Error 405
405 method not allowed
This method specified in the request line is not allowed for the resource identified by the request............
please send me a logon.asp,validate.asp,logout.asp,and a blank default.asp so i can try it out.
'The following three lines of code are used to ensure that this page is not cached on the client.
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
'Assign the UserID, which the user supplies, to this variable.
'Check whether userid is an empty string. If it is empty, redirect to Logon.asp.
'If it is not empty, connect to the database, and validate the user.
if userid <> "" then
pwd = Request.Form("passwd")
'Specify the connection string to access the database.
'Remember to change the following connection string parameters to reflect the correct values
'for your SQL server.
StrConnect = "Provider=SQLOLEDB.1;User ID=sa;Password=;Initial Catalog=tolu;Network Library=dbmssocn;Data Source=nodoubt"
Set Cn = Server.CreateObject("ADODB.Connection")
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "Select * from Users where uid='" & userid & "'",Cn
'Check to see if this userID exists in your database.
If Not Rs.EOF then
If strcomp( pwd, Rs.Fields("password").value , 1) = 0 then
'Password is correct. Set a session variable, and redirect the user to a Default.asp page
'or the main page in your application.
Session("UID") = userid
'Password is incorrect. Redirect the user to the logon page.
'If the user is not in your database, point him or her to the Register.asp page
'so that he or she can register at your Web site.