Whats wrong with this?

This is a discussion on "Whats wrong with this?" within the Classic ASP section. This forum, and the thread "Whats wrong with this? are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1  
Old May 23rd, 2005, 08:05
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Whats wrong with this?

whats wrong with this .... doesnt seem to redirect to update.asp when its a valid login/password ...

Code: Select all
<%
set myConn = server.createobject("ADODB.connection")
myConn.open "Orderinfo", "IWSDstudent", "assign2"
 
dim strUsername, strPassword, strSQL
strUsername = Request.Form("username") 
strPassword = Request.Form("password") 
strSQL = "SELECT * FROM contact "
strSQL = strSQL & "WHERE contactID = '" & strUsername & "' "
strSQL = strSQL & "AND contactPassword = '" & strPassword & "'"
 
set rs = myConn.Execute(strSQL)
If rs.EOF Then 
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 
 
rs.close
myConn.close
%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old May 23rd, 2005, 08:25
Junior Member
Join Date: May 2005
Location: Manchester, UK
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Code: Select all
Response.redirect "details.asp"
Is it redirecting to the wrong page?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old May 23rd, 2005, 08:40
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Nitesh9999
Code: Select all
Response.redirect "details.asp"
Is it redirecting to the wrong page?

Sorry ... i meant

doesnt seem to redirect to details.asp when its a valid login/password ...

dont know where update.asp came from ...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old May 23rd, 2005, 12:54
Reputable Member
Join Date: Aug 2003
Location: United Kingdom
Posts: 341
Thanks: 0
Thanked 0 Times in 0 Posts
Check that your query actually returns a recordset. Be aware that your code isn't the most secure.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #5  
Old May 24th, 2005, 04:45
New Member
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by D3mon
Check that your query actually returns a recordset. Be aware that your code isn't the most secure.
That isnt much of a concern at the moment ...


Shouldnt have anything to do with the login.asp?

Code: Select all
<?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>


[img]alumi.jpg[/img]</p>


[img]login.jpg[/img]</p>
<form name="form1" id="form1" method="post" action="verify.asp">
  

[img]userpass.jpg[/img]</p>
  


    <input name="username" type="text" maxlength="10" />
<input name="password" type="password" maxlength="12" />
</p>
  

  </p>
  


    <input type="button" name="Login" value="Login" />
    <input type="reset" name="Reset" value="Reset" />
</p>
  

</p>
</form>


[img]by.jpg[/img]</p>
</body>
</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #6  
Old May 26th, 2005, 12:55
Up'n'Coming Member
Join Date: Feb 2004
Location: Woodbridge, UK
Age: 27
Posts: 80
Thanks: 0
Thanked 0 Times in 0 Posts
But is it redirecting to login.asp with your ?message= attached?

First step to debugging this is to figure which part of your If Else is actually firing, and then look at what the actuall running values are for the variables that control that if else block.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
wrong

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats wrong? Bradfordp26 Web Page Design 11 Apr 5th, 2008 10:14
whats wrong with these 2 ? batman13 JavaScript Forum 0 May 11th, 2007 19:29
Whats wrong with this? MaccGaz Other Programming Languages 1 Nov 4th, 2006 21:12
Whats wrong with this? (Ajax) php_coder JavaScript Forum 1 May 24th, 2006 20:48
Whats wrong with tables and why css mrnthere Web Page Design 7 Mar 16th, 2006 23:38


All times are GMT. The time now is 14:33.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42