[CODE=asp]<script language="javas cript">
function log_Varify()
{
if(document.frm _index.txt_id.v alue=="")
{
alert("Enter your Login Id")
frm_index.txt_i d.focus()
}
else if(document.frm _index.txt_pwd. value=="")
{
alert("Enter your Password")
frm_index.txt_p wd.focus()
}
else
{
frm_index.metho d="post"
frm_index.actio n="Login_amit.a sp?mode=login"
frm_index.submi t()
}
}
</script>
<%
if(request.quer yString("mode") ="login") then
logId=Request.F orm("txt_id")
pass=Request.Fo rm("txt_pwd")
Dim conn, rs
strconn = "DRIVER={SQ L Server};SERVER= 127.0.0.1; DATABASE=sql175 29_db_shoppersm anual;UID=ad175 29; PWD=shoppers"
set rs=Server.Creat eObject("ADODB. Recordset")
str="prc_userlo gin '"&logId&"','"& pass&"' "
'select * from userlogin where userId = '"'&logId&'" and password= '"'&pass&'"
rs.Open str,strconn
if(not rs.EOF) then
Response.Cookie s("Usrlgn")=log Id
Response.Cookie s("Pass")=pas s
response.redire ct("index.asp" )
else
rs.Close
Response.write "<strong><f ont color='#FF0000' size='2' face='Verdana, Arial, Helvetica, sans-serif'>Invalid User </font>"
end if
end if
%>
[/CODE]
Hello All,
This was my javascript+ASP code for login ,onclick of a button(i am calling javascript function)its validating but its not submitting.As far as i know database connections are perfect i used it in another form.
Please help me....
function log_Varify()
{
if(document.frm _index.txt_id.v alue=="")
{
alert("Enter your Login Id")
frm_index.txt_i d.focus()
}
else if(document.frm _index.txt_pwd. value=="")
{
alert("Enter your Password")
frm_index.txt_p wd.focus()
}
else
{
frm_index.metho d="post"
frm_index.actio n="Login_amit.a sp?mode=login"
frm_index.submi t()
}
}
</script>
<%
if(request.quer yString("mode") ="login") then
logId=Request.F orm("txt_id")
pass=Request.Fo rm("txt_pwd")
Dim conn, rs
strconn = "DRIVER={SQ L Server};SERVER= 127.0.0.1; DATABASE=sql175 29_db_shoppersm anual;UID=ad175 29; PWD=shoppers"
set rs=Server.Creat eObject("ADODB. Recordset")
str="prc_userlo gin '"&logId&"','"& pass&"' "
'select * from userlogin where userId = '"'&logId&'" and password= '"'&pass&'"
rs.Open str,strconn
if(not rs.EOF) then
Response.Cookie s("Usrlgn")=log Id
Response.Cookie s("Pass")=pas s
response.redire ct("index.asp" )
else
rs.Close
Response.write "<strong><f ont color='#FF0000' size='2' face='Verdana, Arial, Helvetica, sans-serif'>Invalid User </font>"
end if
end if
%>
[/CODE]
Hello All,
This was my javascript+ASP code for login ,onclick of a button(i am calling javascript function)its validating but its not submitting.As far as i know database connections are perfect i used it in another form.
Please help me....
Comment