回 帖 发 新 帖 刷新版面

主题:新手跪求各位大侠帮忙!!网上下了一个商城的asp源码,添加商品进购物车时,要提示注册,我不想让用户注

我在网上下了一个商城的asp源码,添加商品进购物车时,要提示注册,我不想让用户注册就能实现购物下订单?


<!--#include virtual="/conn.asp"-->
<!--#include virtual="/function/fd_function.asp"-->
<!--#include virtual="/db.asp"-->
<%
set cn=fd_cn(cn)

pro_id=trim(T(request("pro_id")))
user_id=session("user_id")
if user_id="" then
response.Redirect"../reg/user_login.asp"
end if
是不是这儿改下session定义?跪求高手指点一下!!!

'会员种类
sql="select * from chinammc_user where mmc_id="&user_id&""
set rs=fd_rs(cn,sql)
user_flag=rs("mmc_flag")
fd_free(rs)



if T(request.QueryString("action"))="add" then                    '查找是否又同以产品在购物车,并添加!
'商品价格
sql="select * from chinammc_product where pro_id="&pro_id&""
set rs=fd_rs(cn,sql)
if user_flag=1 then
mmc_oneprice=rs("pro_price_vip")
else
mmc_oneprice=rs("pro_price")
end if
fd_free(rs)

sql="select * from chinammc_shopcart where mmc_userid="&user_id&" and mmc_proid="&pro_id&" and mmc_state=0"
set rs=fd_rs(cn,sql)
if not (rs.bof and rs.eof) then         '如果又的话
rs("mmc_count")=rs("mmc_count")+1
rs("mmc_oneprice")=mmc_oneprice
rs("mmc_price")=mmc_oneprice*(rs("mmc_count")+1)
else
rs.addnew
rs("mmc_userid")=user_id
rs("mmc_proid")=pro_id
rs("mmc_count")=1
rs("mmc_oneprice")=mmc_oneprice
rs("mmc_price")=mmc_oneprice
rs("mmc_ip")=Request.ServerVariables("REMOTE_ADDR")
rs("mmc_adddate")=date()
end if
rs.update
fd_free(rs)

response.Redirect("shopping.asp")
response.End()
end if

if T(request.QueryString("action"))="edit" then                               '数量修改
mmc_id=T(request.QueryString("mmc_id"))
mmc_count=T(request.Form("mmc_count"))
sql="select * from chinammc_shopcart where mmc_id="&mmc_id&""
set rs=fd_rs(cn,sql)
rs("mmc_count")=mmc_count
rs("mmc_price")=rs("mmc_oneprice")*mmc_count
rs.update
fd_free(rs)
response.Redirect("shopping.asp")
response.End()
end if

if T(request.QueryString("action"))="del" then
mmc_id=T(request.QueryString("mmc_id"))
if mmc_id<>"" then
cn.execute "delete from chinammc_shopcart where mmc_id="&mmc_id&""
end if
response.Redirect("shopping.asp")
response.End()
end if

'提取购物车商品
sql="select *,(select pro_name from chinammc_product where pro_id=chinammc_shopcart.mmc_proid) as pro_name,(select pro_guige from chinammc_product where pro_id=chinammc_shopcart.mmc_proid) as pro_guige from chinammc_shopcart where mmc_userid="&user_id&" and mmc_state=0"
set rs=fd_rs(cn,sql)
if not (rs.bof and rs.eof) then
shop=""
do until rs.eof
shop=shop&"<form name=form"&rs("mmc_id")&" action=shopping.asp?action=edit&mmc_id="&rs("mmc_id")&" method=post>"
shop=shop&"                 <tr>"
shop=shop&"              <td height=40 class=bai>"&rs("mmc_proid")&"</td>"
shop=shop&"              <td class=bai><img src=../images/s_ico_3.gif widtd=4 height=7 /> "&rs("pro_name")&"</td>"
shop=shop&"              <td class=bai>"&rs("pro_guige")&"</td>"
shop=shop&"              <td class=bai><input name=mmc_count type=text size=4 value="&rs("mmc_count")&" /></td>"
shop=shop&"              <td class=bai>"&rs("mmc_oneprice")&"</td>"
shop=shop&"              <td class=bai>"&rs("mmc_price")&"</td>"
shop=shop&"              <td class=bai><div align=center><input type=submit name=Submit value=修改 class=anniu />"
shop=shop&"                            <input type=button name=Submit2 value=删除 onclick=del("&rs("mmc_id")&") class=anniu /></div></td>"
shop=shop&"              </tr>"
shop=shop&"</form>"
rs.movenext
loop
end if
fd_free(rs)

'购物车商品总金额
set rs=cn.execute("SELECT sum(mmc_price) FROM chinammc_shopcart where mmc_userid="&user_id&" and mmc_state=0")
    mmc_proprice=rs(0)
fd_Free(rs)

if shop="" then
shop="您还没有购买任何商品!"
end if

fd_free(cn)
%>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<link href="../images/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.anniu{ background-color:#CCCCCC;height:18px;}
</style>
<script language=javascript>
function del(mmc_id)
{
window.location="shopping.asp?action=del&mmc_id="+mmc_id;
}
</script>

<%
set cn=fd_cn(cn)
sql="select * from chinammc_webconfig"
set rs=fd_rs(cn,sql)
sc_name=rs("sc_name")
fd_free(rs)
fd_free(cn)
%>
<title>购物车-<%=sc_name%></title>
</head>

<body>
<div id="contant">
<!--#include file="../include/head.asp"-->
<!--头部结束-->
<div id="webbody"><!--定义页面主体-->
<!--#include file="../include/user_center.asp"-->
<!--页面主体开始==============================================================-->
<div id="rightbar">
<table width="760" height="150" cellpadding="0" cellspacing="0">
    <tr>
    <td>
        <table width="760" height="45" cellpadding="0" cellspacing="0" >
        <tr>
        <td width="22">&nbsp;</td>
        <td  class="heise">
                结算步骤:01 登录/注册 <span class="ahongse">&gt;&gt; 02 结算中心 &gt;&gt; </span>03 填写核对订单信息   &gt;&gt; 04 提交订单</td>
        </tr>
        </table>
    </td>
    </tr>
    <tr>
    <td style="padding-left:5px;"><img src="../images/gouwuche.gif" widtd="88" height="16" /></td>
    </tr>
    <tr>
    <td height="57" >
        <table height="53" cellpadding="0" cellspacing="0">
        <tr>
        <td class="bai" height="35" style="padding-left:15px;">您已选购以下商品</td>
        </tr>
        <tr>
        <td>
        
        
        <table width="760" cellpadding="0" cellspacing="0" >
        <tr>
        <td>
              <table cellpadding="0" cellspacing="0">
              <tr>
              <td width="95" height="35" bgcolor="#999999" class="abaise">编号</td>
              <td width="268" bgcolor="#999999" class="abaise" >商品名称</td>
              <td width="120" bgcolor="#999999" class="abaise" >规格</td>
              <td width="66" bgcolor="#999999" class="abaise" >数量</td>
              <td width="65" bgcolor="#999999" class="abaise" >单价</td>
              <td width="50" bgcolor="#999999" class="abaise" >小计</td>
              <td width="92" bgcolor="#999999" class="abaise" style="text-align:center">操作</td>
              </tr>

             <%=shop%>
              
              <tr>
              <td height="27" colspan="7" bgcolor="#DFDFDF">
                    <table width="741" height="18" cellpadding="0" cellspacing="0" >
                    <tr>
                    <td style="text-align:right" class="bai">合计总金额:<span class="hong"><%=mmc_proprice%>.0</span>元</td>
                    </tr>
                    </table>
             </td>
             </tr>
             </table>
       </td>
       </tr>
       </table>
       </td>
       </tr>
       </table>
    </td>
    </tr>
</table>
<br><br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="60%">&nbsp;</td>
<td width="16%"><a href="/index.asp"><img src="../images/goon.jpg" widtd="124" height="32" border="0" /></a></td>
<td width="8%">&nbsp;</td>
<td width="16%"><a href="makesure.asp"><img src="../images/jixujie.gif" widtd="124" height="32" border="0" /></a></td>
</tr>
</table>
<br><br>

</div><!--rightbar结束,页面主题结束==========================================-->

</div><!--webbody-->
<!--#include file="../include/end.asp"-->
</div><!--contant-->
</body>
</html>

回复列表 (共1个回复)

沙发

哈,一种盗窃的思维.不记名就允许拿东西走啊

我来回复

您尚未登录,请登录后再回复。点此登录或注册