郁闷一晚上,代码实现不了,请各位帮我看看!!!!!!!!
两个页面:login.asp logincheck.asp,前一个是用户登陆,后一个验证登陆!
login.asp:
<%@language="vbscript"%>
<html>
<body>
<form action="logincheck.asp" method="post" enctype="multipart/formdata">
username:<input type=text name=username >
password:<input type=password name=password >
<input type=submit>
<Input type=reset>
</form>
</body>
</html>
<%
dim rs,con,connectionstring,cmd
connectionstring="Provider=SQLOLEDB.1;Integrated Security=SSPI;Initial Catalog=shopcart;Data Source=shawshanke"
set con=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
con.open connectionstring
rs.activeconnection=con
rs.cursorlocation=aduseclient
set cmd=server.createobject("adodb.connection")
%>
logincheck.asp:
<%@language="vbscript"%>
<%
dim rs,con,connectionstring,cmd
connectionstring="Provider=SQLOLEDB;Integrated Security=SSPI;Initial Catalog=shopcart;Data Source=shawshanke;Persist Security Info=False"
set con=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
con.open connectionstring
rs.activeconnection=con
rs.cursorlocation=adUseClient
set cmd=server.createobject("adodb.command")
cmd.activeconnection=connectionstring
username=request.form("username")
password=request.form("password")
sql="select orders.order_id, product.product_name, orders.customer_id,customer.last_name,customer.first_name,customer.customer_id,product.product_id,order_item_detail.quantity,order_item_detail.order_item_status"&_
"from orders,product,customer,order_item_detail"&_
"where customer.customer_id=orders.customer_id and order_item_detail.product_id=product.product_id and orders.order_id=order_item_detail.order_id and"&_
"upper(ltrim(rtrim(customer.user_name)))=" & ucase(username) &_
"and upper(ltrim(rtrim(customer.password)))=" &_
"ucase(password)"
rs.open sql,con,1,1
if not (rs.bof or rs.eof) then
customerid=rs("customer_id")
response.cookies("cartid"=rs("order_id"))
response.cookies("customerid"=rs("customer_id"))
response.cookies("customerid".expires="december 31,2005")
response.write "<b>hello"&rs("first_name")&" "&rs("last_name")&_
"</b><br>"
response.write "here are some details about your previous order/s you"&_
"might be interested in <br><br>"
do while not rs.eof
response.write "product_name:"&" "&rs("product_name")&"<br>"
response.write "quantity:"&" "&rs("quantity")&"<br>"
response.write "status:"&" "&rs("order_item_status")&"<br>"
rs.movenext
loop
rs.close
else
sql="select customer_id from customer where"&_
"upper (ltrim(rtrim(customer.user_name)))="&"'"&ucase(username)&"'"&_
"and upper(ltrim(rtrim(customer.password)))="&"'"&ucase(password)&"'"
rs.open sql,con,adopendynamic
if not (rs.bof or rs.eof) then
customerid=rs("customer_id")
reponse.cookies("customerid")=customerid
reponse.cookies("customerid").expires="december 31,2005"
response.redirect"storefront.asp"
else
response.write"<h2>we could not find your records please"&_
"re-register or contact your sales represetative</h2><br>"
response.write"<h4>or go to the store front to continue shopping"&_
"</h4><br>"
end if
end if
response.write "<hr>"
response.write "<a href=products.asp>continue shopping</a>"
response.write " "
response.write "<a href=storefront.asp>store front</a>"
%>
有错误:说logincheck.asp的rs.open sql,con,1,1的'.'附近有错误!
麻烦帮忙调试调试!