473,464 Members | 1,476 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 1815
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

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

Similar topics

5
by: Darren Grant | last post by:
Hi there, I've attempted to implement an Angle class. An Angle is a subset of an integer, where the range is [0,360). All other operations should be permitted. The code works, I think......
15
by: Dan M | last post by:
Can anyone help me with this code? This is the section and it comes up with a warning C4518: 'int' : storage-class or type specifier(s) unexpected here; ignored on line 3 int replace (char...
65
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
4
by: ITnerd | last post by:
In the interest of code re-use, I would like to place some code in a utility class to be used by other classes. The problem is that this code requires the following snippet: for(i=0; i <...
88
by: Peter Olcott | last post by:
Cab you write code directly in the Common Intermediate language? I need to optimize a critical real-time function.
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
16
by: Rex | last post by:
Hi All - I have a question that I think MIGHT be of interest to a number of us developers. I am somewhat new to VIsual Studio 2005 but not new to VB. I am looking for ideas about quick and...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
1
Chrisjc
by: Chrisjc | last post by:
I am hoping someone can help me out here. I am trying to make one drop down box pull from a database the DB name is “dealerlocater” the column it needs to pull in this drop down is called “state”...
11
by: Daniel Norden | last post by:
Hello. Can you give me some feedback on my code layout? I have everything organized in an object, "NRL", that's used as a namespace, and there are other subobjects/modules below that, for...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.