472,142 Members | 1,264 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,142 software developers and data experts.

ASP Code needs help! ! !

Hi guys, i need help with the following code. It didnot give me any error, but it just doesnot go to the verify function.Since i am a newbie, i need help with it.


*********************************************Messa geBoard.asp*************************
<% @Language=VBScript %>
<% Option Explicit %>


<body bgcolor="#6666CC">
<%
dim strThisPage
strThisPage = "MessageBoard.asp"
%>

<form action="<%=strThisPage%>?action=verify" method="post"><br>
Your Topic:<br>
<input type="text" SIZE="75" name="topic">
<BR>
<br />

Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Password :<br />

<input type="name" name="username" />

<input type="password" name="password" />
<br />
<br />




Your Message: <br>
<TEXTAREA name="message" rows=20 cols=60></TEXTAREA>
<br>
<input type="reset" name="rest" value="Reset" />
<input type="submit" name="post" value="Post"/>
</form>




<%
Sub verify()
%>
<!--#include file="connection.asp"-->


<%
Dim username, password, foundIt, RS

username=trim(request.form("username"))
password=trim(request.form("password"))

If username = "" or password = "" then
response.redirect ("login.asp?error=3")
End If

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Login", objConn

foundIt=False
Do Until RS.EOF OR foundIt
If (StrComp(RS("username"), username, vbTextCompare) = 0) Then
foundIt=True
Else
RS.MoveNext
End If
Loop

If Not foundIt Then
RS.Close
Set RS = Nothing
objConn.Close
Set objConn = Nothing
response.redirect("login.asp?error=1")
End If

If Not (StrComp(RS("password"), password, vbBinaryCompare) = 0) Then
RS.Close
Set RS = Nothing
objConn.Close
Set objConn = Nothing
Response.Redirect("login.asp?error=2")

Else Session("Valid") = Request("username")
Response.Redirect("newphoto.asp")
End If
end sub
%>
*****************************************connectio n.asp*****************************

<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=C:\Inetpub\wwwroot\FanWeb\ADO\Fan\DataBase\my db.mdb"
objConn.open
%>
************************************************** *****************************************
Feb 20 '07 #1
2 1786
Hi guys, i need help with the following code. It didnot give me any error, but it just doesnot go to the verify function.Since i am a newbie, i need help with it.


*********************************************Messa geBoard.asp*************************
<% @Language=VBScript %>
<% Option Explicit %>


<body bgcolor="#6666CC">
<%
dim strThisPage
strThisPage = "MessageBoard.asp"
%>

<form action="<%=strThisPage%>?action=verify" method="post"><br>
Your Topic:<br>
<input type="text" SIZE="75" name="topic">
<BR>
<br />

Name:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Password :<br />

<input type="name" name="username" />

<input type="password" name="password" />
<br />
<br />




Your Message: <br>
<TEXTAREA name="message" rows=20 cols=60></TEXTAREA>
<br>
<input type="reset" name="rest" value="Reset" />
<input type="submit" name="post" value="Post"/>
</form>




<%
Sub verify()
%>
<!--#include file="connection.asp"-->


<%
Dim username, password, foundIt, RS

username=trim(request.form("username"))
password=trim(request.form("password"))

If username = "" or password = "" then
response.redirect ("login.asp?error=3")
End If

Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "Login", objConn

foundIt=False
Do Until RS.EOF OR foundIt
If (StrComp(RS("username"), username, vbTextCompare) = 0) Then
foundIt=True
Else
RS.MoveNext
End If
Loop

If Not foundIt Then
RS.Close
Set RS = Nothing
objConn.Close
Set objConn = Nothing
response.redirect("login.asp?error=1")
End If

If Not (StrComp(RS("password"), password, vbBinaryCompare) = 0) Then
RS.Close
Set RS = Nothing
objConn.Close
Set objConn = Nothing
Response.Redirect("login.asp?error=2")

Else Session("Valid") = Request("username")
Response.Redirect("newphoto.asp")
End If
end sub
%>
*****************************************connectio n.asp*****************************

<%
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=C:\Inetpub\wwwroot\FanWeb\ADO\Fan\DataBase\my db.mdb"
objConn.open
%>
************************************************** *****************************************
please help me
Feb 20 '07 #2
Solved!@.@
Feb 20 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

5 posts views Thread by Darren Grant | last post: by
15 posts views Thread by Dan M | last post: by
4 posts views Thread by ITnerd | last post: by
88 posts views Thread by Peter Olcott | last post: by
5 posts views Thread by rdemyan via AccessMonster.com | last post: by
Chrisjc
1 post views Thread by Chrisjc | last post: by
11 posts views Thread by Daniel Norden | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.