问题如下:
我做了一个网页的提交表单add.html,文字提交到数据库中,显示(显示页面xx_qcnews.asp)都没有问题!
现在我想把这个表单做成可以上传图片的,我想要的做法就是类似论坛发帖这样的,在表单中写上图片地址http://www.xxxxxx.xx.gif,点提交后在显示页面就可以显示出图片,而不是图片的地址!!
如下图:
新闻标题 [__大家帮忙做做啊______________]
新闻内容 ______________________________
| 产品展示 |
| |
| http://www.xxxxx.xx.jpg |
| |
| 产品介绍 |
| 很多文字XXXXXXXX |
| http://www.xxxxx.xx.Gif |
| |
| |
|_____________________________|
提交 重置
点击 提交后 表里的图片地址在 显示详细页面(xx_qcnews.asp)中以图片的形式显示,具体该怎么做呢!!!
具体代码:我的显示页面代码 xx_qcnews.asp
<!--#include file="conn.asp"-->
<link href="css/font.css" rel="stylesheet" type="text/css" />
<%
Function HTMLcode(fString)
If Not IsNull(fString) Then
fString = replace(fString, ">", ">")
fString = replace(fString, "<", "<")
fString = replace(fString, "&#", "<I>&#</I>")
fString = Replace(fString, CHR(32), "<I></I> ")
fString = Replace(fString, CHR(9), " ")
fString = Replace(fString, CHR(34), """)
fString = Replace(fString, CHR(39), "'")
fString = Replace(fString, CHR(13), "")
fString = Replace(fString, CHR(10) & CHR(10), "</P><P> ")
fString = Replace(fString, CHR(10), "<BR> ")
HTMLcode = fString
End if
End Function
%>
<%
exec="select * from qcnews where qc_id=" + xid
set rs=server.createobject("adodb.recordset")
rs.open exec,conn,1,1
%>
<table width="790" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="788"><!--#include file="top.html"--></td>
<td width="2" background="images/bgline.GIF"><img src="images/bgline.GIF" width="2" height="2" /></td>
</tr>
</table>
<table width="790" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><b><%=HTMLcode(rs("qcnews_head"))%></b></td>
<td><%=HTMLcode(rs("qcnews_body")) %></td>
</tr>
<tr>
<td> </td>
</tr>
</table></td>
<td width="2" background="images/bgline.GIF"><img src="images/bgline.GIF" width="2" height="2" /></td>
</tr>
</table>
<table width="790" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="788"><!--#include file="end.html"--></td>
<td width="2" background="images/bgline.GIF"><img src="images/bgline.GIF" width="2" height="2" /></td>
</tr>
</table>
我的提交页面 add.html
<form name="form1" method="post" action="add_save.asp" onsubmit="return checkform()">
<table width="600" border="0" align="center" cellspacing="3">
<tr>
<td width="133">新闻标题</td>
<td width="451" colspan="2"><input name="qcnews_head" type="text" id="qcnews_head" size="60"></td>
</tr>
<tr>
<td valign="top">新闻内容</td>
<td colspan="2"><textarea name="qcnews_body" cols="60" rows="30" id="qcnews_body"></textarea></td>
</tr>
<tr>
<td> </td>
<td colspan="2"> </td>
</tr>
<tr align="center">
<td> </td>
<td width="10">
<input type="submit" name="Submit" value="提交">
</td>
<td width="100">
<input type="reset" name="Submit2" value="重置">
</td>
</tr>
<input type="hidden" name="x" value="1">
</table>
</form>