Hello
I have a simple log-in form with four fields and the server gives me the following error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: '[string: "maria"]'
/schoolsReg/Login.asp, line 23
'maria' refers to my chosen password.
Line 23 is this:
if username = "" or password or fullname or strEmail = "" thenstrEmail corresponds to the email column in my MS Access 2003 database.
The rest of my code looks like this:
<%
username = ""
password = ""
ErrorMessage = ""
strEmail = ""
fullname = ""
if request.form <> "" then
username = Request.Form("username")
password = Request.Form("password")
fullname = Request.Form("fullname")
strEmail = Request.Form("strEmail")
if username = "" or password or fullname or strEmail = "" then [color=red]<---- where the error occurs[/color]
ErrorMessage = "You must specify a username, password, your full name and email address."
else
set conn = Server.CreateObject("ADODB.Connection")
conn.Provider = "Microsoft.Jet.OLEDB.4.0"
conn.Open("E:\myDatabase.mdb")
set rs = Server.CreateObject("ADODB.recordset")
rs.Open "Select * FROM Users WHERE strEmail = '" & username & "'" & fullname & "'", conn
if rs.EOF = false then
if rs.fields("password") = password then
Response.Redirect("Default.asp")
end if
end if
ErrorMessage = "Login failed"
end if
end if
if ErrorMessage <> "" then
response.write("<p>" & ErrorMessage & "</p>")
response.write("<p>Please correct the errors and try again.</p>")
end if
%>
<h1>Login</h1>
<form method="post" action="">
<fieldset>
<legend>Log In to Your Account</legend>
<ol>
<li>
<label>Username:</label>
<input type="text" id="username" name="username" />
</li>
<li>
<label>Password:</label>
<input type="password" id="password" name="password" />
</li>
<li>
<label>Full name:</label>
<input type="text" id="fullname" name="fullname" />
</li>
<li>
<label>Email:</label>
<input type="text" id="strEmail" name="strEmail" />
</li>
<li>
<p><input type="submit" value="Login" /></p>
</li>
</ol>
</fieldset>
</form>
</div>
</body>
</html>
What am I doing wrong, please?
High1