登录表单asp [英] Login form asp

查看:82
本文介绍了登录表单asp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我被要求为网站创建一个简单的登录表单,由于缺乏知识我很难挣扎,到目前为止我有一个表格将信息发布到check.asp部分

<%@ language =" vbscript"%><%

''#connect to SQL database#''

Dim objConn, objRs,strSQL

设置objConn = Server.CreateObject(" ADODB.Connection")

objConn.Open" dsn = Oracle; uid = user1; pwd = password;

set objRs = objConn.execute(strSQL)

%>


<%


frmuserid = Request.form(" frmuserid")

frmpassword = Request.form(" frmpassword")


strSQL =" SELECT * FROM login WHERE userid =''"& frmUserid&"''AND password =''"& frmpassword&"''"

>
设置objRs = objConn.execute(strSQL)


如果(objRs.BOF)那么

响应e.write(登录不正确,请再试一次。)

Response.Redirect" login.asp"


ELSE


Response.Cookies(" Login")(" frmuserid")= frmuserid

Response.Cookies(" Login")。Expires = Date + 1

Response.Redirect" welcome.asp"


结束如果

%>


< html>

< head>

< title> check< / title>

< / head>

< html>

< head>

< title> check< / title>

< / head>



< body>检查.........< / body>

< ; / html>


现在我应该检查以前的表单数据并检查数据库,但我得到的只是一个uloadable页面。


有什么建议让我走上正轨吗?


干杯

解决方案

< blockquote>


uloadable页面是什么意思?

您是否在进行有效登录后无法重定向到下一页?

请检查您的< form>标签。它应该是这样的:

例如


Login.asp


< Form method =" post" ; action =" Login1.asp">

<输入类型=" text" value ="" Name =" frmuserid">

<输入类型=" text" value =" frmPassword">

< input id =" Submit1"类型= [提交"值= [提交" />

< /表格>


当您提交表格时,您的数据将提交给下一个

页面名为Login1.asp。


Login1.asp

展开 | 选择 | Wrap | 行号


谢谢为了快速响应,我的login.asp页面他的这个表单,我觉得它试图转到下一页,但收到此消息:


res://ieframe.dll /dnserrordiagoff.htm# ftp:// u sername:password@129.110.11.182/check.asp


表格登录.asp

---------- ----------------

展开 | 选择 | Wrap | 行号


搞乱了这几乎所有今天我仍然没有接近,但我100%肯定它不是表格部分的错,它必须是下一步,是代码错了吗?

展开 | 选择 | Wrap | 行号

Hi I have been asked to create a simple login form for a website and due to the lack of knowledge im struggling, so far I have a form which posts the information to the check.asp section

<% @language="vbscript"%><%
''#Connect to SQL database#''
Dim objConn, objRs, strSQL
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "dsn=Oracle;uid=user1;pwd=password;"
set objRs=objConn.execute(strSQL)
%>


<%

frmuserid = Request.form("frmuserid")
frmpassword = Request.form("frmpassword")

strSQL = "SELECT * FROM login WHERE userid = ''"&frmUserid&"'' AND password = ''"&frmpassword&"''"

Set objRs = objConn.execute(strSQL)

If (objRs.BOF) then
response.write ("Incorrect login, please try again.")
Response.Redirect "login.asp"

ELSE

Response.Cookies("Login")("frmuserid") = frmuserid
Response.Cookies("Login").Expires = Date + 1
Response.Redirect "welcome.asp"

End If
%>

<html>
<head>
<title>check</title>
</head>
<html>
<head>
<title>check</title>
</head>



<body>Checking.........</body>
</html>

Now to me that should check the previous forms data and check it against the database but all I get is an uloadable page.

Any suggestions to put me on the right track?

Cheers

解决方案

Hi,

What do you mean by uloadable page?
Are you not able to redirect to the next page after doing valid login?
Please check your <form> tag. It should be like this:
e.g.

Login.asp

<Form method ="post" action ="Login1.asp">
<Input type ="text" value = "" Name ="frmuserid">
<Input type ="text" value = "frmPassword">
<input id="Submit1" type="submit" value="submit" />
</Form>

When you will submit the form your data will be submitted to the next
page called as Login1.asp.

Login1.asp

Expand|Select|Wrap|Line Numbers


Thanks for the quick response, my login.asp page his this form, it seems ok to me it attempts to goto the next page but gets this message:

res://ieframe.dll/dnserrordiagoff.htm#ftp://username:password@129.110.11.182/check.asp

form on login.asp
--------------------------

Expand|Select|Wrap|Line Numbers


After messing about with this nearly all of today im still no closer but im 100% sure its not a fault on the form part, its got to be the next step, is the code wrong?

Expand|Select|Wrap|Line Numbers


这篇关于登录表单asp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆