J
janet
hI ...
I am newbie to ASP ... i am trying to write a code to
accept login and passwor from a user and verify through a
table created in MySQL.
I am just trying to write a code on my own seeking help
from code here and there and from my understanding. I am
completely zapped :-(((
here is my code:-
DIM SQL
DIM RSA
DIM QUERY1
ConnString = "Driver={MySQL ODBC 3.51 Driver};"
ConnString = ConnString & "Port=3306; "
ConnString = ConnString & "DATABASE=test; "
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString
<FORM ACTION="login.asp" METHOD="post">
<TABLE BORDER=0>
<TR>
<TD ALIGN="right">LOGIN:</TD>
<TD><INPUT TYPE="text"
NAME="txtID"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right">PASSWORD:</TD>
<TD><INPUT TYPE="password"
NAME="txtPASSWORD"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"></TD>
<TD><INPUT TYPE="submit"
VALUE="Login"></INPUT>
<INPUT TYPE="reset"
VALUE="Reset"></INPUT>
</TD>
</TR>
</TABLE>
</FORM>
QUERY1 = "SELECT stUDENT_ID,STUDENT_PASSWORD from
STUDENT_INFO"
SET RSA = = Server.CreateObject("ADODB.Recordset")
Set RSA = conn.Execute(QUERY1,,adCmdText)
if RSA.EOF then
response.Write("NO MATCH")
else
if ([QUERY1.STUDENT_ID] = [txtID]) AND
([QUERY1.STUDENT_PASSWORD] = [txtPASSWORD]) then
response.write "<p>" & "<center>" & "U CAN " & "</center>"
& "</p>"
else
response.write "No ID FOUND"
end if
Set rs = Nothing
Set conn = Nothing
%>
I know my code is not at all written nicely! Can anyone
help me with a sample code for user-id verification? I
want to know how to write a code using ASP (MYSQL). I dont
even know where to put the % sign and whether html comes
before select query...i am all so frustrated and confused !
any sample code help would vbe highly appreciated!
thanks!!!
I am newbie to ASP ... i am trying to write a code to
accept login and passwor from a user and verify through a
table created in MySQL.
I am just trying to write a code on my own seeking help
from code here and there and from my understanding. I am
completely zapped :-(((
here is my code:-
DIM SQL
DIM RSA
DIM QUERY1
ConnString = "Driver={MySQL ODBC 3.51 Driver};"
ConnString = ConnString & "Port=3306; "
ConnString = ConnString & "DATABASE=test; "
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConnString
<FORM ACTION="login.asp" METHOD="post">
<TABLE BORDER=0>
<TR>
<TD ALIGN="right">LOGIN:</TD>
<TD><INPUT TYPE="text"
NAME="txtID"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right">PASSWORD:</TD>
<TD><INPUT TYPE="password"
NAME="txtPASSWORD"></INPUT></TD>
</TR>
<TR>
<TD ALIGN="right"></TD>
<TD><INPUT TYPE="submit"
VALUE="Login"></INPUT>
<INPUT TYPE="reset"
VALUE="Reset"></INPUT>
</TD>
</TR>
</TABLE>
</FORM>
QUERY1 = "SELECT stUDENT_ID,STUDENT_PASSWORD from
STUDENT_INFO"
SET RSA = = Server.CreateObject("ADODB.Recordset")
Set RSA = conn.Execute(QUERY1,,adCmdText)
if RSA.EOF then
response.Write("NO MATCH")
else
if ([QUERY1.STUDENT_ID] = [txtID]) AND
([QUERY1.STUDENT_PASSWORD] = [txtPASSWORD]) then
response.write "<p>" & "<center>" & "U CAN " & "</center>"
& "</p>"
else
response.write "No ID FOUND"
end if
Set rs = Nothing
Set conn = Nothing
%>
I know my code is not at all written nicely! Can anyone
help me with a sample code for user-id verification? I
want to know how to write a code using ASP (MYSQL). I dont
even know where to put the % sign and whether html comes
before select query...i am all so frustrated and confused !
any sample code help would vbe highly appreciated!
thanks!!!