首页 新闻 会员 周边

悲剧,页面传值失败

0
[已解决问题] 解决于 2010-12-08 15:55

如下,是该页面的代码:

--------------------------------------------------------------------------------------

<%@ Language=VBScript %>
<!--#include file="../sysparam.asp" -->
<!--#include FILE="./upload_5xsoft.inc"-->

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
</head>

<body>
<form name="frm1" action="ExtraServiceMmsAdd_ftpput.asp" method="post">


<!--附件上传代码---------------------------start--->
<%
set upload=new upload_5xsoft
set file=upload.file("mmsupfile")

if file.fileSize<1 then
   response.write"<script language=javascript>alert('请选择文件!');history.back()</script>"
   response.end
end if

if file.fileSize<10 or file.fileSize>500*1024 then '修改默认的数值 100 单位(KB)
 response.write "<br><br><br><br><br>错误:上传的文件大小超过了500k限制! <a href='javascript:history.go(-1)'>退回上一步</a>"
 response.end
end If

upfilename = split(file.FileName,".")
upfileext = upfilename(Ubound(upfilename))

if upfileext<>"rar" and upfileext<>"zip" and upfileext<>"txt" and upfileext<>"doc" and upfileext<>"RAR" and upfileext<>"ZIP"  and upfileext<>"TXT" and upfileext<>"JPG" and upfileext<>"jpg" And upfileext<>"bmp" And upfileext<>"gif" And upfileext<>"png" then
 response.write "<br><br><br><br><br>错误:上传的文件格式不对! <a href='javascript:history.go(-1)'>退回上一步</a>"
 response.end
end if

ufp=Year(now)&Month(now)&Day(now)&Hour(now)&Minute(now)&Second(now)&"."&upfilename(UBound(upfilename))
file.saveas Server.mappath("../mmssendtemp/"&ufp)
tempfile=Server.mappath("../mmssendtemp/"&ufp)

 

If trim(upload.Form("mmssubject"))<>"" Then mmssubject=trim(upload.Form("mmssubject")) End If
If trim(upload.Form("priority"))<>"" Then priority=trim(upload.Form("priority")) End If
If trim(upload.Form("mmscontent"))<>"" Then mmscontent=trim(upload.Form("mmscontent")) End If
If Trim(upload.Form("remark"))<>"" Then Remark=Trim(upload.Form("remark")) End If

mmsfilepath="D:\MMS Attachment\send\"&ufp
mmsfilepath=Trim(mmsfilepath)

set file=nothing
set upload=nothing

Dim AppealNum,AppealCount
AppealNum=30 '页面60秒打开网页次数的限制
AppealCount=Request.Cookies("AppealCount")
If AppealCount="" Then
response.Cookies("AppealCount")=1
AppealCount=1
response.cookies("AppealCount").expires=dateadd("s",60,now())                                        
Else
response.Cookies("AppealCount")=AppealCount+1
response.cookies("AppealCount").expires=dateadd("s",60,now())
End If
if int(AppealCount)>int(AppealNum) then
response.write "为防止恶意上传文件,请您等待60秒后再上传文件.<br>为您带来不便,请谅解!"
response.end
End If
%>

<script language="Javascript">
    function minipic(smileface) {
        window.opener.document.form1.minipic.value = smileface;
    }
    function pic(smileface) {
        window.opener.document.form1.pic.value = smileface;
    }
</script>
<!--附件上传代码---------------------------end----->


<%
response.Write(mmssubject&"----"&mmscontent&"----"&priority&"----"&Remark&"----"&tempfile&"----"&mmsfilepath&"----"&ufp)
'response.End
%>

</form>

<script type="text/javascript">
    frm1.submit();
</script>

</body>
</html>

 

--------------------------------------------------------------------------------------

在页面“ExtraServiceMmsAdd_ftpput.asp” 用“request.form("mmssubject")”怎么也获取不到这个值,之前能使用的,悲剧啊,各位帮忙找找原因啊,我要喷血了··

 

 

 

 

问题补充: <%@ Language=VBScript %> <!--#include file="../sysparam.asp" --> <!--#include FILE="./upload_5xsoft.inc"--> <html> <head> <link href="../elite.css" style="text/css" rel="stylesheet"> <meta http-equiv="Content-Type" content="text/html;charset=gb2312"> <% upfilename = split(file.FileName,".") upfileext = upfilename(Ubound(upfilename)) ufp=Year(now)&Month(now)&Day(now)&Hour(now)&Minute(now)&Second(now)&"."&upfilename(UBound(upfilename)) file.saveas Server.mappath("../mmssendtemp/"&ufp) tempfile=Server.mappath("../mmssendtemp/"&ufp) If trim(upload.Form("mmssubject"))<>"" Then mmstitle=trim(upload.Form("mmssubject")) End If If trim(upload.Form("priority"))<>"" Then priority=trim(upload.Form("priority")) End If If trim(upload.Form("mmscontent"))<>"" Then mmscontent=trim(upload.Form("mmscontent")) End If If Trim(upload.Form("remark"))<>"" Then Remark=Trim(upload.Form("remark")) End If mmsfilepath="D:\MMS Attachment\send\"&ufp mmsfilepath=Trim(mmsfilepath) %> </head> <body> <form name="frm1" id="frm1" action="ExtraServiceMmsAdd_ftpput.asp?&mmssubject=<%=mmstitle%>&mmscontent=<%=mmscontent%>&priority=<%=priority%>&mmsfilepath=<%=mmsfilepath%>&tempfile=<%=tempfile%>&ufp=<%=ufp%>" method="post"> <script language="javascript"> frm1.submit() </script> </body> </html> 我将“《%%》”里的代码做了省略,这里只是写出了大致的意思,大家不要管<body>标签之前的代码就可以了, 强调下【在<body>之前我用response.write()的方法能够查看到各参数的值了】,然后将参数传到别的页面就传不过去,注意下:是我传值的写法不对?还是哪里原因呢?
soarymz的主页 soarymz | 初学一级 | 园豆:0
提问于:2010-12-08 12:00
< >
分享
最佳答案
0

代码太长。

顾晓北 | 专家六级 |园豆:10844 | 2010-12-08 14:22
代码已简化,请再次查看
soarymz | 园豆:0 (初学一级) | 2010-12-08 14:38
你的意思是现在你response。write()可以获取到提交的值是么?
顾晓北 | 园豆:10844 (专家六级) | 2010-12-08 15:13
已经解决了,谢谢,是这么个情况,A传到B,B再传到c,上面的代码在b上,B页面的工作就是接受A传过来的参数,然后转给c
soarymz | 园豆:0 (初学一级) | 2010-12-08 15:37
其他回答(1)
0

提交过去了没有,asp的哦,乱。

Astar | 园豆:40805 (高人七级) | 2010-12-08 13:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册