还是关于asp参数传递问题
我现在有两个页面,一个叫add_picture_info.asp,一个叫upload_picture.asp
add_picture_info.asp是输入图片的基本信息的,有三个字段:图片名称,图片来源,图片提供者
upload_picture.asp是保存图片的基本信息的,要对数据库进行操作,add_picture_info.asp把从它获得三个字段的信息传递给upload_picture.asp.
具体的源代码如下:
文件一:
conn_db.asp
<%
'连接数据源
dim conn, admin_user, admin_type
admin_user =session("admin_user")
admin_type =session("admin_type")
login_id=session("login_id")
cur_url2233 =request("url")
if isnull(login_id) or login_id="" then
response.redirect "/admin/login.asp?purl="&request("url")
end if
Set conn=Server.CreateObject("ADODB.Connection")
conn.ConnectionString="Provider=SqlOleDb;Data Source=192.168.0.105;Initial CataLog=sms;User ID=sms;PASSWORD=111111"
conn.Open
if admin_type <> "0" and instr(cur_url2233, "efault.asp")=0 and instr(cur_url2233, "common") =0 then
set rs2233=conn.execute("select * from admin_user_auth where login_id='" & login_id & "' and charindex(sub_url, '" & cur_url2233 & "') >0")
if rs2233.eof then
response.write "您没有权力访问此功能. <a href=javascript:history.back(1)>返回</a>"
rs2233.close
conn.close
response.end
end if
rs2233.close
end if
%>
文件二:
add_picture_info.asp
<HTML><HEAD><TITLE>添加图片</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE>.big {
FONT-FAMILY: Arial, Helvetica, 宋体; FONT-SIZE: 13pt; FONT-WEIGHT: bold
}
.cur {
COLOR: #ff0000; FONT-FAMILY: 宋体; FONT-SIZE: 9pt
}
.chn {
FONT-FAMILY: 宋体; FONT-SIZE: 9pt
}
.dir {
FONT-FAMILY: 宋体; FONT-SIZE: 11pt; FONT-WEIGHT: bold
}
.sub {
FONT-FAMILY: 宋体; FONT-SIZE: 9pt
}
.hdr {
FONT-FAMILY: 宋体; FONT-SIZE: 9pt; FONT-WEIGHT: bold
}
.itm {
FONT-FAMILY: 宋体; FONT-SIZE: 11pt
}
.eng {
FONT-FAMILY: Arial, Helvetica, 宋体; FONT-SIZE: 9pt
}
.con {
FONT-FAMILY: 宋体; FONT-SIZE: 10pt
}
A.hover {
COLOR: red
}
td {
FONT-SIZE: 9pt
; line-height: 19px
}
</STYLE>
</HEAD>
<BODY>
<!-- #include file="../conn_db.asp" -->
<%
name=request.form("name")
provider=request.form("provider")
%>
<CENTER>
<table border=0 cellpadding=2 cellspacing=0 width=468 style="border-collapse: collapse" bordercolor="#111111">
<tbody>
<tr>
<td width="628" align="center">
添加图片</td>
</tr>
</tbody>
</table>
<div align="center">
<center>
<table border=0 cellpadding=0 cellspacing=0 width=468 class=itm style="border-collapse: collapse" bordercolor="#111111"
height="206">
<tr>
<td colspan="2"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFCC00" width="100%" height="20"> 填写信息:</td>
</tr>
<tr>
<td bgcolor="#000000" width="59%" height="1"></td>
</tr>
</table></td>
</tr>
<form action="images/upload_picture.asp?name=<%="name"%>&provider=<%="provider"%>" method="post" enctype="multipart/form-data">
<tr>
<td align=right width=119 bgcolor="#EEEEEE" height="26">图片名称: </td>
<td bgcolor="#EEEEEE" height="26" width="349"> <input type=text name="name" size=36>
</td>
</tr>
<tr>
<td align=right bgcolor="#EEEEEE" height="32">图片来源: </td>
<td bgcolor="#EEEEEE" height="32"><input name="picture" size=36 type="file">
</td>
</tr>
<tr>
<td align=right width=119 bgcolor="#EEEEEE" height="32">提供者: </td>
<td bgcolor="#EEEEEE" height="32" width="349"> <input type=text name="provider" size=28 maxlength=50>
</td>
</tr>
<tr>
<td colspan=2 align=center height="32"> <input type=submit value="添 加" id=submit2 name=send >
<input type=reSet value="清 除" id=reSet2 name=clear2>
</form></td></tr>
<tr>
<td colspan=2 height="45"> </td>
</tr>
<tr>
<td colspan=2 height="45"></td>
</tr>
</table>
</center>
</div>
<SCRIPT language=javascript>
</SCRIPT>
<HR noShade SIZE=1 width=468>
<p style="line-height: 150%"><small>版权所有:
制作与维护:<br>
<br>
</p>
</CENTER>
</small>
<!-- #include file="../close_db.asp" -->
</BODY>
</HTML>
文件三:
upload_picture.asp
<%
Server.ScriptTimeOut = 500
%>
<!-- #include file="../conn_db.asp" -->
<%
name=request("name")
provider=request("provider")
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>图片上传</title>
</head>
<body>
<p align="center">图片上传</p>
<%
dim IronUpload,path,File
dim startTime, EndTime
StartTime = Timer()
set IronUpload=Server.createobject("Ironsoft.UpLoad")
path=server.mappath(".")
response.write "<br>编码数据大小: " & IronUpload.TotalByte
response.write "<br>文件保存路径: " & path
response.write "<br>数据域长度: " & IronUpload.FormLength
response.write "<br>文件域长度: " & IronUpload.FileFormLength
set File = IronUpload.IronFileForm("picture")
'Save File
if not File.IsEmpty then
response.write "<br>文件1: 文件名:" & File.FileName & ", 文件类型:" &File.FileType & ", 文件大小:" & File.FileSize & ", 扩展名:" & File.ExeName
File.SaveAsFile Server.mappath(File.FileName)
end if
set ob=nothing
EndTime = Timer()
response.write "<br>用时:" & EndTime - StartTime & "s"
'Save the File Path to the Database.
Dim FullPath
FullPath=path&"\"&File.FileName
Response.Write "<br>数据库中存放的路径值:" &FullPath
conn.Execute "insert into picture_info(name,PROVIDER,cur_time,down_count,picture_path) values ('"&name&"','"&provider&"',getdate(),'0','"&FullPath&"')"
Response.Write "<br>" & "Upload OK!"
conn.Close
Set conn=nothing
%>
</body>
</html>
问题很简单,就是如何把在add_picture_info.asp这个页面中获得的name和provider两个变量值传递给下一个页面upload_picture.asp
各位都给点建议吧