首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

ASP有关问题

2012-03-08 
在线等ASP问题!--#includefile util.asp --!--#includefile conn.inc --%dzrequest.QueryStri

在线等ASP问题
<!--#include   file= "util.asp "   -->
<!--#include   file= "conn.inc "   -->
<%
dz=request.QueryString( "dz ")
strCpbm   =   Request( "cpbm ")
if   ((len(trim(strCpbm))   =   0)   or   (strCpbm   =   "undefined "))   then
strCheck   =   "no "
end   if

ProductList   =   Session( "ProductList ")
Products   =   Split(Request( "cpbm "),   ",   ")
For   I=0   To   UBound(Products)
      PutToShopBag   Products(I),   ProductList
Next
Session( "ProductList ")   =   ProductList


Head= "以下是您所选购的物品清单 "
ProductList   =   Session( "ProductList ")
If   Len(ProductList)   =0   Then
  Response.Redirect   "nothing.asp "
  response.end
end   if

If   Request( "MySelf ")   =   "Yes "   Then
      ProductList   =   " "
      Products   =   Split(Request( "cpbm "),   ",   ")
      For   I=0   To   UBound(Products)
            PutToShopBag   Products(I),   ProductList
      Next
      Session( "ProductList ")   =   ProductList
End   If    
If   Len(ProductList)   =   0     Then
  Response.Redirect   "nothing.asp "
  response.end
end   if
set   rs=server.createobject( "adodb.recordset ")
sql   =   "Select   *   From   [product]   where   pn   in( "&ProductList& ") "  
rs.open   sql,conn,1,1,1
'%>


<html>        

<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 以下是您所选购的物品清单 </title>
</head>
<script   language= "Javascript ">

function   fucCheckNUM(NUM)
{
var   i,j,strTemp;
strTemp= "0123456789 ";
if   (   NUM.length==   0)
return   0
for   (i=0;i <NUM.length;i++)
{
j=strTemp.indexOf(NUM.charAt(i));
if   (j==-1)
{
return   0;
}
}
return   1;
}

function   clean()
  {  
    window.location.href= "clear.asp "
    }
</script>

<body   topmargin= "5 ">
<center>

<div   align= "center ">

<center>

<table   width= "80% "   border= "0 "   cellspacing= "0 ">
    <tr>
        <td   width= "80% "   valign= "top "> <p   align= "center ">
  </p>
            <p   align= "center ">
<font   color= "#FF0000 "   > <%=Head%> </font> </p>
            <!--webbot   BOT= "GeneratedScript "   PREVIEW= "   "   startspan   --> <script   Language= "JavaScript "> <!--


function   FrontPage_Form1_Validator(theForm)
{

    var   checkOK   =   "0123456789- ";
    var   checkStr   =   theForm.= "Q_ "   &   rs( "id ").value;
    var   allValid   =   true;
    var   decPoints   =   0;
    var   allNum   =   " ";
    for   (i   =   0;     i   <   checkStr.length;     i++)
    {
        ch   =   checkStr.charAt(i);
        for   (j   =   0;     j   <   checkOK.length;     j++)
            if   (ch   ==   checkOK.charAt(j))
                break;
        if   (j   ==   checkOK.length)
        {
            allValid   =   false;
            break;
        }
        allNum   +=   ch;
    }
    if   (!allValid)
    {
        alert( "在   请输入正确的商品数量!   域中,只能输入   数字   个字符。 ");
        theForm.= "Q_ "   &   rs( "Product_Id ").focus();
        return   (false);
    }
    return   (true);
}
//--> </script> <!--webbot   BOT= "GeneratedScript "   endspan   --> <form   Action= "eshop.asp "   Method= "POST "   onSubmit= "return   FrontPage_Form1_Validator(this) "   name= "FrontPage_Form1 ">
            <input   type= "hidden "   name= "MySelf "   value= "Yes ">
<div   align= "center "> <center>
<table   border= "0 "   cellspacing= "1 "   width= "550 "   class=main   bgcolor= "6699CC ">
                <tr   bgcolor= "#E6F7FF ">
                    <td   width= "170 "     height= "22 "   align= "center "> <span   class= "style1 "> 商品编号 </span> </td>
                    <td   width= "170 "     height= "22 "   align= "center "   bgcolor= "#E6F7FF "> <span   class= "style1 "> 商品名称 </span> </td>
                    <td   width= "76 "   height= "22 "   align= "center "> <span   class= "style1 "> 商品价格 </span> </td>
                    <td   width= "76 "     height= "22 "   align= "center "> <span   class= "style1 "> 商品数量 </span> </td>
    <td   width= "76 "     height= "22 "   align= "center "> dz </td>
                    <td   width= "60 "     height= "22 "   align= "center "> <span   class= "style1 "> 购买 </span> </td>


                    <td   width= "72 "     height= "22 "   align= "center "> <span   class= "style1 "> 总价 </span> </td>
                </tr>
<%
      Sum   =   0
      While   Not   rs.EOF
          Quatity   =   CInt(   Request(   "Q_ "   &   rs( "pn "))   )
          If   Quatity   <=   0   Then  
                Quatity   =   CInt(   Session(rs( "pn "))   )
                If   Quatity   <=   0   Then   Quatity   =   1
  End   If
          Session(rs( "pn "))   =   Quatity
if   session( "class ")= "vip "   then  
          Sum   =   Sum   +   ccur(rs( "Price "))   *   Quatity*dz*0.1
  else
  Sum   =   Sum   +   ccur(rs( "Price "))   *   Quatity
  end   if
%>
                <tr   bgcolor= "#FFFFFF ">
                    <td   width= "82 "   align= "center "> <%=rs( "pn ")%> </td>
                    <td   width= "170 "   align= "center "> <%=rs( "Name ")%> </td>
                    <td   width= "76 "   align= "center "> <%=rs( "Price ")%> </td>
                    <td   width= "76 "   align= "center "> <!--webbot
                        bot= "Validation "   S-Display-Name= "请输入正确的商品数量! "
                        S-Data-Type= "Integer "   S-Number-Separators= "x "   --> <input   Name= " <%= "Q_ "   &   rs( "pn ")%> "   Value= " <%=Quatity%> "   Size= "3 "> </td>
<td   width= "76 "   align= "center ">
<%if   session( "class ")= "vip "   then  
response.Write(dz)
else
response.Write( "&nbsp; ")
end   if
%> </td>
                    <td   width= "60 "   Align= "center "> <input   Type= "CheckBox "   Name= "cpbm "   Value= " <%=rs( "pn ")%> "   Checked> </td>
                    <td   width= "72 "   Align= "center "> <%if   session( "class ")= "vip "   then  
    dim   a,b
    b=dz/10


    a=ccur(rs( "Price "))*Quatity*b
    response.Write(a)
    else
    a=ccur(rs( "price "))*quatity
    response.Write(a)
    end   if%> .00元 </td>
                </tr>
<%             rs.MoveNext
     
      wend
     
%>
                <tr   bgcolor= "#FFFFFF ">
            <td   Align= "Right "   ColSpan= "7 "   width= "546 "> <font   Color= "Red "> 总价格=人民币   <%=Sum%> .00元 </font> </td>                    
                </tr>                
            </table>                
            </center> </div> <blockquote>                
                <p   align= "center ">
                    <input   name= "B1 "   type= "submit "   class= "smallInput "   style= "font-size:   9pt "   value= "更改数量 ">
                    &nbsp;&nbsp;&nbsp;    
                <input   name= "B2 "   type= "button "   class= "smallInput "   style= "font-size:   9pt "   onClick= "window.close(); "   value= "继续购物 ">
                &nbsp;&nbsp;&nbsp;                    
                <input   name= "B3 "   type= "button "   class= "smallInput "   style= "font-size:   9pt "   OnClick= "clean() "   value= "订单取消 ">
                &nbsp;&nbsp;&nbsp;    
                <input   name= "b4 "   type= "button "   class= "smallInput "   onClick= "window.open( '../page/ment1.asp ') "   value= "去收银台 ">            
                <p   align= "center "> <font   color= "#FF0000 "> 注意:改变“商品数量需按“更改数量” </font>             </blockquote>            
        </form> </td>
    </tr> </table>
</center>            
</div>          
<%            
rs.close            
conn.close            
%>            


           
</body>            
</html>            
           
  我在更改数量的时候   点更改数量的时候   不能更新数据。
请问是什么原因


[解决办法]
Action= "eshop.asp "

你提交到数据库的处理页在eshop.asp,看这个是看不出来为什么没更新的

热点排行