<a href="javascript: addshopcart('<%=id%>');">放入购物车<a>

宝宝妈妈2023-05-16  75

楼上说的有一点错误,<%=id%>不是jsp小脚本,而是是java的写法,目的是当你点击这个超连接的时候得到这个商品的id。

说的通俗一点就是 : 你在页面上会看到“放入购物车”几个字,这是个超连接,当你点击的时候会调用一个javascript的方法,这个方法名是addshopcart,需要的参数是商品的id。

我做过这样的网站

在会员表加个flag字段值为1和2(2表示登陆,1表示未登陆)

登陆的时候在判断flag的值如果等于2就不能登陆,等于1就登陆并且把1改为2

退出的时候要把2改为1

1。验证帐号密码通过

2。检测是否登陆,logind字段是记录登陆时间的

if (datediff("s",rs("logind"),now)/60)>2 or rs("flag")=1 then

rs("logind")=now()

rs("flag")=2

3.记录cookies response.cookies("xxx")=rs("xxx")

4.登陆成功

else

response.Write "<script>alert('您已经登陆')history.go(-1)</script>"

end if

这是我们网站的你参靠下

<!--#include file="conn.asp"-->

<!--#include file="fun.asp"-->

<%

'

'结束

dim rs,sql

dim uID,pwd

uID=replace(request.form("uID"),"''","''")

pwd=replace(request.form("pwd"),"''","''")

if uID="" or pwd="" then

response.Write "<script>alert('请输入用户名密码')history.go(-1)</script>"

response.End

end if

set rs=Server.CreateObject("Adodb.Recordset")

sql="select * from member where uID='"&uID&"'and pwd='"&pwd&"' "

rs.open sql,conn,1,3

If rs.eof Then

response.write "<script>alert('用户名密码不正确,请重新输入')history.back()</Script>"

response.end

else

if rs("shenhe")<>"0" then

response.write "<script>alert('您的帐号审核后才能登录本系统!请与网站管理员联系,联系电话:0797-8373956。经网站管理员审核后会及时为您开通!')history.back()</Script>"

response.end

end if

if datediff("d",now,rs("enddate"))<=0 then

response.Write"验证失败!您的账号已超期 <font color='ff0000'>"+cstr(datediff("d",rs("enddate"),now))+"</font>天! 请您联系<br>"

response.write "单位:赣州物流信息网<br>负责人:陈冬幼<br>联系电话:13807971052<br><br>"

response.Write(" <a href=default.asp>返回</a>")

response.end

else

if (datediff("s",rs("logind"),now)/60)>2 or rs("flag")=1 then

rs("times")=rs("times")+1

fabu=rs("fabu")

address=rs("user_province")

times=rs("times")

rs("logind")=now()

rs("flag")=2

response.cookies("offtel")=rs("user_office_phone")

response.cookies("biaoshi")=rs("id")

response.cookies("com")=rs("gsname")

response.cookies("rname")=rs("rname")

response.cookies("daping")=rs("daping")

'response.cookies("daping")="yes"

response.cookies("mob")=rs("user_mobile_phone")

if rs("shoufei")="0" then

response.Cookies("shoufei")=rs("shoufei")

end if

rs.update

'xiaoe add

username = request.Form ("uid")

session("myid")=uid

Response.cookies("member")="true"

Response.cookies("uID")=uID

Response.cookies("pwd")=pwd

session("username")=uid

session("password")=pwd

Response.cookies("times")=times

Response.cookies("fabu")=fabu

response.Cookies("user_province")=address

response.Cookies ("user_count")=usercount

response.cookies("sd")="nsd"

if datediff("d",now,rs("enddate"))>0 and datediff("d",now,rs("enddate"))<=15 then

response.Write "<script>alert('您好,您的帐号还有"&datediff("d",now,rs("enddate"))&"天到期,提醒您请及时续费!以免影响您的正常业务。若不便来公司缴款,可采取银行汇款方式(详细请点击首页“入网方式”栏)。')this.location.href='default.asp'</script>"

else

response.Redirect "default.asp"

end if

rs.close

set rs=nothing

conn.close

set conn=nothing

else

response.Write "<script>alert('如果您刚刚关掉本网,那么您未点击左侧退出,请您在2分钟后重新登陆如果您2分钟前没有使用本网请注意您的帐号可能被盗用,请2分钟后重试,并且尽快修改密码!')history.go(-1)</script>" '"您已经在计算机[" &getLoginIP(username) &"]上登录!"

response.End

end if

end if

end if

%>


转载请注明原文地址:https://54852.com/read/671281.html