求一段ASP复选框写入数据库并取出的代码
最近很困惑,要写一段复选框写入数据库然后取出的代码一直没能写出来,只好求助下各位高手了,其实应该是比较容易一段代码,具体要求如下:1.客户端代码reg.asp(六个复选框...
最近很困惑,要写一段复选框写入数据库然后取出的代码一直没能写出来,只好求助下各位高手了,其实应该是比较容易一段代码,具体要求如下:
1.客户端代码reg.asp(六个复选框,会员选择之后按提交写入数据库)
2.数据写入数据库代码(afterreg.asp)
3.会员登录后台显示注册时选择的复选框选项,并可以修改,重新写入数据库
以上三个代码请各位高手帮忙指导下,因为分数只剩12了,不多,我全部奉上了,以示感谢! 展开
1.客户端代码reg.asp(六个复选框,会员选择之后按提交写入数据库)
2.数据写入数据库代码(afterreg.asp)
3.会员登录后台显示注册时选择的复选框选项,并可以修改,重新写入数据库
以上三个代码请各位高手帮忙指导下,因为分数只剩12了,不多,我全部奉上了,以示感谢! 展开
展开全部
呵呵,修改了一下1楼的:
>>>>>>>>>>>reg.html
<form action="afterreg.asp" method="POST">
<input type="checkbox" name="vip" value="1">
<input type="checkbox" name="vip" value="2">
<input type="checkbox" name="vip" value="3">
<input type="submit" name="提交" >
</form>
>>>>>>>>>>>afterreg.asp
vip=request.form("vip")
conn.execute("insert into usertable(checkbox) values("vip"))
>>>>>>>>>>>>>>>>>>edit.asp
<%
chVal=conn.execute("select checkbox from usertable where userid=uid")(0)
if chVal="" then
chVal="0,0,0"
end if
%>
<form action="afterreg.asp" method="POST">
<input type="checkbox" name="vip" value="1" <%if split(chVal,",")(0)=1 then Response.Write("checked")%> >
<input type="checkbox" name="vip" value="2" <%if split(chVal,",")(1)=1 then Response.Write("checked")%>>
<input type="checkbox" name="vip" value="3" <%if split(chVal,",")(2)=1 then Response.Write("checked")%>>
<input type="submit" name="提交" >
</form>
>>>>>>>>>>>reg.html
<form action="afterreg.asp" method="POST">
<input type="checkbox" name="vip" value="1">
<input type="checkbox" name="vip" value="2">
<input type="checkbox" name="vip" value="3">
<input type="submit" name="提交" >
</form>
>>>>>>>>>>>afterreg.asp
vip=request.form("vip")
conn.execute("insert into usertable(checkbox) values("vip"))
>>>>>>>>>>>>>>>>>>edit.asp
<%
chVal=conn.execute("select checkbox from usertable where userid=uid")(0)
if chVal="" then
chVal="0,0,0"
end if
%>
<form action="afterreg.asp" method="POST">
<input type="checkbox" name="vip" value="1" <%if split(chVal,",")(0)=1 then Response.Write("checked")%> >
<input type="checkbox" name="vip" value="2" <%if split(chVal,",")(1)=1 then Response.Write("checked")%>>
<input type="checkbox" name="vip" value="3" <%if split(chVal,",")(2)=1 then Response.Write("checked")%>>
<input type="submit" name="提交" >
</form>
展开全部
>>>>>>>>>>>reg.html
<form action="afterreg.asp" method="POST">
<input type="checkbox" name="vip[]">
<input type="checkbox" name="vip[]">
<input type="checkbox" name="vip[]">
<input type="submit" name="提交">
</form>
>>>>>>>>>>>afterreg.asp
vip=request.form("vip")
conn.execute("insert into usertable(checkbox) values("vip"))
>>>>>>after.html
<%
conn.execute("select checkbox from usertable where userid=uid")
while not rs.eof
response.write(rs.checkbox)
wend
%>
<form action="afterreg.asp" method="POST">
<input type="checkbox" name="vip[]">
<input type="checkbox" name="vip[]">
<input type="checkbox" name="vip[]">
<input type="submit" name="提交">
</form>
>>>>>>>>>>>afterreg.asp
vip=request.form("vip")
conn.execute("insert into usertable(checkbox) values("vip"))
>>>>>>after.html
<%
conn.execute("select checkbox from usertable where userid=uid")
while not rs.eof
response.write(rs.checkbox)
wend
%>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询