Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 05-23-2005, 08:20 PM   #1 (permalink)
TheShadow
Registered User
 
Join Date: May 2005
Posts: 4
TheShadow is on a distinguished road
Whats wrong with this?

Code:
<%

Set myConn = server.createObject("ADODB.Connection")
myConn.open "Orderinfo","IWSDstudent","assign2"

Set Login = server.createobject("ADODB.Recordset")
Login.open "SELECT * FROM contact WHERE contactID = '" & Request.form("username") "' AND contactPassword = '" & Request.Form("password") & "'", myConn, 2, 2

if login.eof then

login.close
connection.close

response.redirect("login.asp?message=" & Server.URLEncode("Invalid login name and/or password")

else

Session("username") = rs("username")
Session.Timeout=30
Response.redirect "details.asp"

end if

%>
Code:
Error: Access is Denied. 
Microsoft VBScript compilation error '800a0401' 

Expected end of statement 

/iwsd/iwsd019/assignment2/verify.asp, line 18 

Login.open "SELECT * FROM contact WHERE contactID = '" & Request.form("username") "' AND contactPassword = '" & Request.Form("password") & "'", myConn, 2, 2
----------------------------------------------------------------------------------^
TheShadow is offline   Reply With Quote
Old 05-23-2005, 09:48 PM   #2 (permalink)
TheShadow
Registered User
 
Join Date: May 2005
Posts: 4
TheShadow is on a distinguished road
I got rid of the issue above, yet still problem with not being able to login ...

Code:
<%

Set myConn = server.createObject("ADODB.Connection")
myConn.open "Orderinfo","IWSDstudent","assign2"

Set Login = server.createobject("ADODB.Recordset")
dim strSQL
strSQL = "SELECT * FROM contact "
strSQL = strSQL & "WHERE contactID = '" & Request.form("username") & "' "
strSQL = strSQL & "AND contactPassword = '" & Request.Form("password") & "'"

Login.open strSQL, myConn, 2, 2

if Login.eof then

Login.close
myConn.close

response.redirect("login.asp?message=" & Server.URLEncode("Invalid login name and/or password"))

else

Session("username") = rs("username")
Session.Timeout=30
Response.redirect "details.asp"

end if

%>
Shouldnt have anything to do with the login.asp?

Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
	<title>Login</title>
	<link rel="stylesheet" type="text/css" href="Assign2.css">
<body>
<%
response.write cstr(request("message")) 
session.Abandon
set rs = nothing
%>
<p>&nbsp;</p>
<p><img src="alumi.jpg" width="450" height="250" /></p>
<p><img src="login.jpg" width="300" height="150" /></p>
<form name="form1" id="form1" method="post" action="verify.asp">
  <p><img src="userpass.jpg" width="300" height="100" /></p>
  <p>
    <input name="username" type="text" maxlength="10" />
&nbsp;&nbsp;&nbsp;&nbsp;<input name="password" type="password" maxlength="12" />
</p>
  <p>&nbsp;  </p>
  <p>
    <input type="button" name="Login" value="Login" />&nbsp;
    <input type="reset" name="Reset" value="Reset" />
</p>
  <p>&nbsp;</p>
</form>
<p><img src="by.jpg" width="300" height="100" /></p>
</body>
</html>
TheShadow is offline   Reply With Quote
Old 05-23-2005, 10:10 PM   #3 (permalink)
TheShadow
Registered User
 
Join Date: May 2005
Posts: 4
TheShadow is on a distinguished road
How do i get out of this without looking like a complete fool ...

<input type="button" name="Login" value="Login" />

button should be submit
TheShadow is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie, can't not work out what's wrong with this code harker Platform/API C++ 5 12-13-2004 04:21 AM
Is there anyting wrong with this? Androto Standard C, C++ 9 10-12-2004 11:44 PM
Something wrong with the view script redhead Lounge 1 10-11-2004 02:58 PM
whats wrong with this code trevor PHP 7 04-01-2003 07:00 PM
ok, what is wrong with this code? trevor PHP 3 02-04-2003 11:09 PM


All times are GMT -8. The time now is 06:41 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting