请多多指教!100分送上!!

xiong_r 2002-08-19 06:06:43
唉!这阵问题多多,敬请一一指教。
1、我在程序中想用一个按纽提交两个FORM,第一个FORM名为SUBTXT,第二个FORM名为SUBPICform,我在SUBTXT_ONSubmit事件中写了第二个FORM的提交事件,不知为何第二个FORM提交不上去?
2、我在服务器端的变量(通过REQUEST获得),现在想在客户端用这个变量来控制提交事件,不知如何来做?
3、我的图形提交页面能将图形提交到ACCESS数据库,但却显示不出来,程序见SHOWIMG.ASP,哦,能显示个0出来。
<SCRIPT ID=clientEventHandlersVBS LANGUAGE=vbscript>
<!--

Sub subtxt_onsubmit
stype=session("subtype")
if ((stype=3) or (stype=4)) then
if (document.subtxt.subpicture.checked=true) then
document.subpicform.submit
end if
end if
if (stype=4) then
if (document.subtxt.anspicture.checked=true) then
document.anspicform.submit
end if
end if

End Sub

-->
</SCRIPT>
<body background="image/fawall.gif">
<%
subtype=request("r1")
subtype=int(subtype)
session("subtype")=subtype

%>
<form method="POST" name="subtxt" action="papertxtin.asp" language=vbscript>
.......

<%
if (subtype=3) or (subtype=4) then
%>
<td width="50%" height="12" colspan="4">
<p align="center">
<input type="checkbox" name="SubHavePic" value="ON" id="subpicture" onclick="showsubpic()"><span id="subhave">试题有图片
</td>
<%
end if
if (subtype=4) then
%>
<td width="50%" height="12" colspan="4">
<p align="center">
<input type="checkbox" name="AnsHavePic" value="ON" id="anspicture" onclick="showanspic()"><span id="anshave">答案有图片
</td>
<%end if%>

<input name="B1" type="submit" value="提交"></td>

<input name="B2" type="reset" value="重写"></td>
</form>
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="47">
<tr>
<td width="50%" height="47">
<form method="POST" name="subpicform" enctype="multipart/form-data" action="subpicin.asp" style="display:none">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="0">
<p align="center"><input type="file" name="F1" size="9"></p>
</form>
</td>
<td width="50%" height="47">
<form method="POST" name="anspicform" enctype="multipart/form-data" action="anspicin.asp" style="display:none">
<input TYPE="hidden" NAME="VTI-GROUP" VALUE="1">
<p align="center"><input type="file" name="F1" size="9"></p>
</form>
</td>
</tr>
</body>

showimg.asp
<%@ Language=VBScript%>
<%
chapterid=request("cid")
subid=request("sid")
set conn=server.createobject("adodb.connection")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("paper.mdb")
set rs=server.createobject("adodb.recordset")
strsql="select * from submattergraph where chapterid=" & chapterid & " and subid=" & subid
rs.open strsql,conn,1,3
response.ContentType="image/gif"

response.BinaryWrite rs.fields("subgraph")

rs.close
set rs=nothing
set conn=nothing
%>

程序不多,麻烦看看!!
...全文
47 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
chxtcsxr 2002-08-22
  • 打赏
  • 举报
回复
还是看看我的把,给你发到邮箱中去了。。。
xiong_r 2002-08-21
  • 打赏
  • 举报
回复
我的rs.fields("subgraph")是因为rs("subgraph")也不行才改的,subgraph的类型是"OLE 对象"
lly1111 2002-08-20
  • 打赏
  • 举报
回复
将response.BinaryWrite rs.fields("subgraph")
改为response.BinaryWrite rs("subgraph")试试
另外字段subgraph的类型是否为"OLE 对象"
xiong_r 2002-08-20
  • 打赏
  • 举报
回复
混合提交方式,图片与数据分开太复杂,分开提交后台处理程序简单多了!
图片数据是不是指微软的ASP关于大数据的奇偶位问题,如是这个,我也校验了。能不能多给些帮助啊!!我快要发疯了!!!
yonghengdizhen 2002-08-19
  • 打赏
  • 举报
回复
首先建议使用混合提交方式,数据库处理要容易多了.
第二在显示处理前,你验证了图片数据的正确性吗?(比如说字节数)

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧