| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 758 人关注过本帖
标题:怎样在下面3个页面中加入控制图片上传总数量的程序?[问题已解决,感谢wang ...
只看楼主 加入收藏
tepnidh
Rank: 2
等 级:论坛游民
帖 子:192
专家分:24
注 册:2009-8-2
结帖率:87.5%
收藏
已结贴  问题点数:20 回复次数:8 
怎样在下面3个页面中加入控制图片上传总数量的程序?[问题已解决,感谢wangjy500老师]
后编辑页面(cp-hbj.asp):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp" -->
<!--#include file="../wzjs/glyfw.js" -->
<%
Set ad = Server.CreateObject ("ADODB.Recordset")
sql = "Select * from cpzs  ORDER BY id DESC"
ad.Open sql,conn,1,1
%>
<!--#include file="hbjymfy.js" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE2 {
 font-size: 24px;
 font-weight: bold;
 color: #0000FF;
}
.STYLE3 {font-size: 12px}
a:link {
 text-decoration: none;
}
a:visited {
 text-decoration: none;
}
a:hover {
 text-decoration: none;
}
a:active {
 text-decoration: none;
}
.STYLE5 {font-size: 16px}
-->
</style>
<style type="text/css">
<!--
.cf {
 float: left;
}
.STYLE6 {color: #FF0000}
.STYLE7 {color: #FFFFFF}
-->
</style>
</head>
<body>
<table width="780" border="1" cellspacing="0" cellpadding="0">
  <tr>
   <td height="40" colspan="2" align="center" bgcolor="#00FFFF"><span class="STYLE2">产 品 展 示  后 台 编 辑 <span class="STYLE5 STYLE7">&nbsp;&nbsp;&nbsp; <a href="http://pic. target="_blank">图片在线处理</a></span></span></td>
  </tr>
  <tr>
    <td width="580" height="30" align="center" class="STYLE5">[
     <%
        if not ad.eof then%>
           <a href="cp-htj.asp?id=<% =ad("id")%>"><strong>添&nbsp; 加</strong></a>
        <%else%>
           <a href="cp-htj.asp"><strong>添&nbsp; 加</strong></a>
      <% end if%>
    ] </td>
    <td width="200" align="center" class="STYLE5"><span class="STYLE3">当前共有<span class="STYLE6">&nbsp; <%=ad.recordcount%>&nbsp;</span> 张产品图片 </span></td>
  </tr>
  <tr>
    <td height="25" colspan="2" align="left">
 <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="11" height="580" valign="top" background="images/aa.jpg"></td>
          <td align="center" valign="top"><p><span class="STYLE25"><span class="px16"></span></span></p>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
            </table>
   <%
if ad.EOF and ad.BOF then
response.write"暂时图片"
else
Dim iPage
For iPage=1 To ad.Pagesize %><!分页循环代码开始>
            <table width="140" height="150" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC" class="cf">
            
  <tr>
                <td height="90" colspan="2" align="center">
<img src=<%=ad("pic")%>  width="90" height="120" border="0" style="cursor:pointer;BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 8px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 8px; PADDING-BOTTOM: 8px; BORDER-LEFT: #cccccc 1px solid; PADDING-TOP: 8px; BORDER-BOTTOM: #cccccc 1px solid;"></td>
          </tr>
        <tr>
          <td  height="30" colspan="2" align="center"><%=ad("bt")%></td>
           </tr>
        <tr>
                <td width="70"  height="25" align="center" class="STYLE3"><span class="STYLE1"><a href="cp-hxg.asp?id=<%= ad ("id") %>">修&nbsp; 改</a></span></td>
                <td width="70" align="center" class="STYLE3"><a href="cp-hsc.asp?id=<%= ad ("id") %>">删&nbsp; 除</a></td>
        </tr>
            </table>  
   
<% ad.MoveNext
   if ad.eof then exit for
Next
end if
%><!分页循环代码结束>
            
            <p><!--#include file="hbjfyxs.js" -->
</p>
          </table ></td>
  </tr>
</table>
</td>
  </tr>
</table>
</body>
</html>
<% conn.close            '关闭连接,
set conn=nothing      '释放内存  这两句很重要,不然会占用大量服务器资源
%>
后添加页面(cp-htj.asp):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp" -->
<!--#include file="../wzjs/glyfw.js" -->
 
<% '栏目内容查询
Set rs= Server.CreateObject ("ADODB.Recordset")
sql = "Select * from  cpzs"
rs.Open sql,conn,1,1
%>
<style type="text/css">
<!--
.STYLE1 {
 font-size: 24px;
 color: #0000FF;
}
.STYLE3 {
 color: #FF0000;
 font-weight: bold;
 font-size: 12px;
}
.STYLE8 {color: #999999; font-size: 12px; }
-->
</style>
<form action="cp-htjzx.asp" method="post" name="form1" target="_self">
  <table width="780" border="1" cellspacing="0" cellpadding="0">
    <tr>
      <td height="40" colspan="2" align="center" bgcolor="#00FFFF"><span class="STYLE1">产 品 图 片 添 加</span></td>
    </tr>
    <tr>
      <td width="200" height="30" align="right">图片标题:</td>
      <td>&nbsp; <input name="bt" type="text" id="bt" size="50">
      &nbsp; <span class="STYLE3">※ 必填! </span></td>
    </tr>
    <tr>
      <td height="30" align="right">链接网址:</td>
      <td>&nbsp;
          <input name="url" type="text" id="url" size="50">
          &nbsp; <span class="STYLE8">※</span> <span class="STYLE8">选填</span> </td>
    </tr>
    <tr >
      <td height="30" align="right">图片上传路径:</td>
      <td>&nbsp; <input name="pic" type="text" id="pic" size="50">
      &nbsp; <span class="STYLE8">※ 不用填,由上传时自动获得!</span></td>
    </tr>
    <tr >
      <td width="200" height="30" align="right">上传图片:</td>
      <td valign="middle">&nbsp; <iframe src="bjq.asp?action=swf_Pic" width="300" marginwidth="0" height="25" marginheight="0" align="middle" scrolling="no" frameborder="0"></iframe>
      <span class="STYLE3">※ </span><span class="STYLE8">先点击&quot;浏览&quot;,然后&quot;上传&quot;,最后点&quot;添加&quot;. </span></td>
    </tr>
    <tr>
      <td height="40" colspan="2" align="center" bgcolor="#FFFFFF"><input type="submit" name="Submit" value="添      加"></td>
    </tr>
  </table>
</form>
<%
conn.close            '关闭连接,
set conn=nothing      '释放内存  这两句很重要,不然会占用大量服务器资源
%>
后添加执行页面(cp-htjzx.asp):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../conn.asp" -->
<!--#include file="../wzjs/glyfw.js" -->
<%
bt=request("bt")
pic=request("pic")
url=request("url")

      if bt="" then
     response.write("<script>alert('标题不能空');window.history.back();</script>")
  response.end()  '结束运行
  end if
  
  if pic="" then
     response.write("<script>alert('请上传图片!');window.history.back();</script>")
  response.end()  '结束运行
  end if
       conn.execute("insert into cpzs([bt],[pic],[url]) values('"&bt&"','"&pic&"','"&url&"')")
 '添加到数据库注册完成,yhgl_pwd是ACCESS中的保留关键字。
 response.write("<script>alert('添加成功!');location.href='cp-hbj.asp'</script>")
conn.close            '关闭连接,
set conn=nothing      '释放内存  这两句很重要,不然会占用大量服务器资源。
%>
 



[ 本帖最后由 tepnidh 于 2012-2-25 17:58 编辑 ]
搜索更多相关主题的帖子: html sql content include style 
2012-02-23 16:35
tepnidh
Rank: 2
等 级:论坛游民
帖 子:192
专家分:24
注 册:2009-8-2
收藏
得分:0 
自己顶吧!请各位老师帮忙啊!叩谢!
2012-02-24 18:35
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:20 
可以用Session来记数

QQ:63572063
2012-02-24 19:50
tepnidh
Rank: 2
等 级:论坛游民
帖 子:192
专家分:24
注 册:2009-8-2
收藏
得分:0 
回复 3楼 wangjy500
谢谢老师!您知道我是太菜鸟鸟啦,能不能具体一些?
2012-02-24 20:53
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:0 
你的总数量是什么意思呢?

QQ:63572063
2012-02-24 21:04
tepnidh
Rank: 2
等 级:论坛游民
帖 子:192
专家分:24
注 册:2009-8-2
收藏
得分:0 
回复 5楼 wangjy500
就是最多上传图片的数量,不分上传几次。比如,最多上传20张,当满20张以后,就不允许上传了,可以提示:您上传的图片已满20张,停止上传!呵~~不知我说清楚了没有?这么晚了,还在打扰您,不好意啦!
2012-02-24 21:08
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:0 
是限制一个人的上传数量,还是限制整个站点上传的数量呢?

QQ:63572063
2012-02-24 21:13
tepnidh
Rank: 2
等 级:论坛游民
帖 子:192
专家分:24
注 册:2009-8-2
收藏
得分:0 
回复 7楼 wangjy500
呵~~~,不好意思,刚才有点事离开一会儿。不是限制一个人,也不是整个站点,是限制某一个频道,比如,在一个网站里,有“产品展示”,“店面形像”,“公司形像”频道等,这些频道上传的图片需要限制,是对某个频道限制。比如,产品展示这个频道可能限制在20张以内,店面形像这个频道可能限制在15张以内。我就想请您以“产品展示”这个频道为例帮帮我,谢谢!
2012-02-24 21:47
wangjy500
Rank: 11Rank: 11Rank: 11Rank: 11
等 级:贵宾
威 望:13
帖 子:457
专家分:2569
注 册:2010-7-11
收藏
得分:0 
加我QQ好

QQ:63572063
2012-02-24 22:24
快速回复:怎样在下面3个页面中加入控制图片上传总数量的程序?[问题已解决,感谢 ...
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025542 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved