这页中横线所夹范围内的代码为什么这样写?POST及GET方法提交数据的格式是什么?

MeXP 2001-10-29 04:53:53
图片提交页photoinput.asp:
<form enctype="multipart/form-data" method="POST"
action="photo_save.asp">
<div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="55%">
<tr>
<td width="100%" height="30">选择图片(*.jpg格式):</td>
</tr>
<tr>
<td width="100%" height="30"><input type="file" name="filename" size="40"></td>
</tr>
<tr>
<td width="100%" align="right" height="30"><input type="submit" value="Submit"></td>
</tr>
</table>
</center></div>
</form>


存储到数据库中photo_save.asp:
response.buffer = true
action = request.querystring("action")
formsize = Request.TotalBytes
formdata = Request.BinaryRead(formsize)
_______________________________________________________________
bncrlf = chrB(13) & chrB(10)
divider = leftB(formdata,clng(instrB(formdata,bncrlf))-1)
datastart = instrB(formdata,bncrlf & bncrlf)+4
dataend = instrB(datastart+1,formdata,divider) - datastart
mydata = midB(formdata,datastart,dataend)
_______________________________________________________________
set rec = server.createobject("adodb.recordset")
rec.open "photo_news",conn,1,3
conn.begintrans
rec.addnew
rec("photo").appendchunk mydata
rec.update
这页中横线所夹范围内的代码为什么这样写?POST及GET方法提交数据的格式是什么?
...全文
148 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
MeXP 2001-10-30
  • 打赏
  • 举报
回复
我想问的是怎样给回帖加分?
MeXP 2001-10-30
  • 打赏
  • 举报
回复
<form enctype="multipart/form-data" method="POST"
action="photo_save.asp">
<div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="55%">
<tr>
<td width="100%" height="30">选择图片(*.jpg格式):</td>
</tr>
<tr>
<td width="100%" height="30"><input type="text" name="txt" size="40"></td>
</tr>

<tr>
<td width="100%" height="30"><input type="file" name="filename" size="40"></td>
</tr>
<tr>
<td width="100%" align="right" height="30"><input type="submit" value="Submit"></td>
</tr>
</table>
</center></div>
</form>

"所有命令最后一行后边要加两个回车","命令"指什么?
那么有<input type="file" name="filename">表单采用POST方法提交还是p1=value1&p2=value2&p3=value3....这种形式吗?
如果将photoinput.asp的表单中加入文本框,photo_save.asp应怎么写?
非常感谢julyclyde(Clyde)!
请教散分的方法?
julyclyde 2001-10-29
  • 打赏
  • 举报
回复
GET /default.asp HTTP/1.1
Host: www.??.com
Referer: http://上一页的地址
User-Agent: 浏览器
以上为GET的格式(http/1.1及1.0)
GET http://www.??.com/default.asp
以上为HTTP/0.9

POST /formproc.asp HTTP/1.1
Host: www.??.com
Referer:
User-Agent:
p1=value1&p2=value2&p3=value3....
以上为POST(http/1.1)格式

所有命令最后一行后边要加两个回车。

28,391

社区成员

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

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