程序代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<!--#include file="inc/func.asp"-->
<!--#include file="checklogin.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>活动图片管理</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
}
body,td,th {
font-size: 12px;
}
-->
</style>
<link href="AdminStyle.css" rel="stylesheet" type="text/css">
</head>
<body>
<!--***************************显示所有图片************************************ -->
<table width="85%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr>
<%dim ProType,NewsType
ProType=Trim(Request.QueryString("ProType"))
Select case proType
case "tx"
NewsType="庭馨系列"
case "tk"
NewsType="庭康系列"
case "zt"
NewsType="竹庭系列"
case "mj"
NewsType="美家洁系列"
case else
ProType="tx"
NewsType="庭馨系列"
end Select
%>
<td colspan="5" align="center" class="title"><strong>
<%=NewsType%>产品图片</strong></td>
</tr>
<tr>
<% dim rs,sql,page,i,NewsTitle,cpgg,ProName,NewsTitle2
sql="select ProAddress,ProName,ProType,ID,NewsTitle2,cpgg from jujia_Product where ProName='"&NewsType&"' order by id desc "
Set rs = Server.CreateObject ("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof then
response.write("<tr><td colpan=""4"">暂无图片</td></tr>")
rs.pagesize=15
else
page=Request.QueryString("page")
rs.PageSize = 15
if Not IsEmpty(page) then
if Not IsNumeric(page) then
page=1
else
Page = cint(page)
end if
if Page > rs.PageCount then Page = rs.PageCount
if Page <= 0 then Page = 1
else
Page = 1
end if
rs.AbsolutePage = Page
For i = 1 to rs.PageSize
if rs.EOF then Exit For
%>
<td height="160" align="center" valign="middle">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="tdbg"><img height="100" width="126" border="0" src=<%=rs(0)%>></td>
</tr>
<tr><br>
<tr><td height="20" align="center" >
名称:<input name="NewsTitle2" type="text" value="<%=rs(4)%>" size="15" maxlength="50"></td>
</tr>
<tr><td height="20" align="center" >
规格:<input name="cpgg" type="text" value="<%=rs(5)%>" size="15" maxlength="50"></td>
</tr>
<tr>
<td height="20" align="center">
<input name="Submit2" onClick="if(confirm('确定删除?'))DeleteData(<%=rs(3)%>)" type="button" id="Submit" value="删除" />
<input name="Submit" onClick="if(confirm('确定修改?'))UpdateData(<%=rs(3)%>, <%=i%>)" type="button" id="Submit" value="修改"><input
type="hidden" name="NewsFile" value="0"><input name="IsFile" type="hidden" value="0" /></td>
</tr>
</table>
</td>
<%
if i=5 or i=10 then
response.write("</tr><tr>")
end if
rs.movenext
next
end if
%>
</tr>
<tr>
<td> PAGE: <a href="admin_pic.asp?page=1">1</a><% for i=2 to rs.pagecount %>
| <a href="admin_pic.asp?page=<%=i%>"><%=i%></a>
<% next %></td>
</tr>
</table>
</body>
</html>
<script language="javascript">
function DeleteData(ID)
{
var postInfo = "PostType=Products&Actions=Delete&ID="+ID;
var eZuStudio = new ActiveXObject("Microsoft.XMLHTTP");
eZuStudio.open("POST","PostData.asp",false);
eZuStudio.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
eZuStudio.send(postInfo);
alert(unescape(eZuStudio.responseText));
window.location.reload();
}
</script>
<script language="javascript">
var xhr;
function UpdateData(ID, i)
{
var reData=null;
var NewsTitle2=escape(document.getElementsByName("NewsTitle2")[i-1].value);
var cpgg=escape(document.getElementsByName("cpgg")[i-1].value);
var ProType=escape("<%=ProType%>");
var postInfo = "PostType=Products&Actions=Update";
postInfo=postInfo+"&NewsTitle2="+NewsTitle2+"&cpgg="+cpgg+"&ProType="+ProType;
postInfo=postInfo+"&ID=" + ID;
xhr=new ActiveXObject("Microsoft.XMLHTTP");
xhr.onreadystatechange=alertContents;
xhr.open("POST","PostData.asp",false);
xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
xhr.send(postInfo);
}
function alertContents()
{
if(xhr.readyState==4)
{
if(xhr.status==200)
{
alert(unescape(xhr.responseText));
window.location.reload();
}
}
else
{
//没有接收到数据或出错处理代码
}
}
</script>
按类似的修改一下看看