View Single Post
  #5 (permalink)  
Old April 25th, 2004, 01:13 PM
andy11983 andy11983 is offline
Registered User
 
Join Date: Apr 2004
Location: stoke, staffs, United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi its me again,

Thanks for your advice again. Ive made the alterations and now another error has appeared. I cannot give you more information on the error at this time because 1ASP host has decided to put a bandwith on so that you can only access your site a certain number of times.

However before it went pear-shaped it said it was something to do with line(s)36 which is the bolded bit in the code.

[CODE
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
</head>
<body>
<%

'Function to see what the user has entered
Function ChkString(string)
If String = "" Then String = " "
ChkString = replace(String, "'", " ")
End Function

dim username, conn
strconn = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("db/cds.mdb")
set conn = server.createobject("adodb.connection")
conn.open strconn

username = ChkString(request.form("login"))

SQLQuery = "SELECT * FROM users WHERE username = '"
sqlquery = sqlquery & username & "'"
Set RSuser = conn.Execute(SQLQuery)

if NOT RSuser.eof then
dim oldpassword, newpassword1, newpassword2

oldpassword = ChkString(request.form("oldpassword"))
newpassword = ChkString(request.form("newpassword1"))
newpassword2 = ChkString(request.form("newpassword2"))
%>

<%

SQLQuery2 = "UPDATE users SET newpassword2 = '" & newpassword2 & "' WHERE username = '" & username & "'"
Set RSuser = conn.Execute(SQLQuery2)


session("sesusername") = username
locreturn=session("sesslocation")&"success.asp"
session("sesslocation") = ""
%>
<%Else%>

<div align="center">Sorry have entered your username incorrectly </div>

<%End If%>

</body>
</html>
[/CODE]

Thanks again people, i really appreciate your help

Andy

Andy
Reply With Quote