请教谁用过迅捷的自助网站,他的信息发布为何图片不能上传啊

xiaowuyue 2004-06-30 02:14:03
请高手指教,最好附上修改什么文件,修改后的代码,谢谢!
...全文
257 29 打赏 收藏 转发到动态 举报
写回复
用AI写文章
29 条回复
切换为时间正序
请发表友善的回复…
发表回复
tzgpxl 2004-07-05
  • 打赏
  • 举报
回复
我这边没办法测试,不过从你程序看,你的release.asp页面中的image文本框的名字要改成hasimage才行的,这样改的同时你的上传页面中的代码也要改。
我能看出的问题就是这个了,如果再不行,我看也没办法,
因为你的edit.asp页面中的文本框的name是hasimage,所以edit2.asp中用
if strLength(request.form("hasimage"))>50 then
errmsg=errmsg+"<br>"+"<li>图片路径过长(长度不能大于50)!"
founderr=true
else
hasimage=trim(checkStr((request.form("hasimage"))))
if hasimage="" then hasimage="0"
end if
着段代码可以通过,而且可以得到正确结果,但是你的release.asp与edit.asp不同,所以肯定不能通过的。你试着改一下吧
tzgpxl 2004-07-02
  • 打赏
  • 举报
回复
只要发那几个页面代码就可以了。
tzgpxl 2004-07-02
  • 打赏
  • 举报
回复
我找不到你的hasimage与image的关系,
不知道他们在哪里产生关联。
要不你把代码发给我看看吧。
tzgpxl@yeah.net
xiaowuyue 2004-07-02
  • 打赏
  • 举报
回复
还是不行,我把所有得hasimage得全部统一为image,但是还是不行!
chinull 2004-07-02
  • 打赏
  • 举报
回复
如果是上传文件在一个文件夹中去了,要有文件夹的写权限.iis设置.
或设置虚拟目录也要写权限.
tzgpxl 2004-07-02
  • 打赏
  • 举报
回复
<input type="text" name="image" size="60" maxlength="100">
<br>
可以是图片网址或路径:例如 pic/logo.gif 或 http://www.fjjn.com/logo.gif都可以
你上传的页面是在这里,text的名称叫image,
但是你在接受页面中写的是这样的
request.form("hasimage")你上传页面里面哪里有image这个表单啊。改成reqeust.form("image")试试看?
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
你可以直接进入
http://www.flea8.com/soonweb/supply/index.asp
你发布个信息看一下,多谢了!
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
就是上传以后,在图片的链接里面实现有图片,但是点击发布以后呢,再查看刚才发布的信息,图片链接显示没有图片


但是再编辑刚才发布的信息,把刚才发布的图片的路径拷贝到图片链接以后,点击修改完毕,再看,刚才的图片链接有了!
tzgpxl 2004-07-01
  • 打赏
  • 举报
回复
可以上传啊。你上传会出问题吗???
tzgpxl 2004-07-01
  • 打赏
  • 举报
回复
老大,我找不到你的页面啊,他说我没权限呢。
咋地从页面进入?
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
http://www.flea8.com/soonweb/supply/release.asp?supplytypeid=38&supplytype=工艺品

你看看这页,有上传得按钮
tzgpxl 2004-07-01
  • 打赏
  • 举报
回复
<td class=TD1pxblank align=middle>
<div align="left">
<input type="text" name="image" size="60" maxlength="100">
<br>
可以是图片网址或路径:例如 pic/logo.gif 或 http://www.fjjn.com/logo.gif都可以
<BR><iframe frameborder=0 width=100% height=40 scrolling=no src=ad_upload.asp></iframe>

</div>
</td>
你的这个图片没有上传按牛吗??
没上传的连接你如何将两个页面连接起来?
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
以上是信息发布的代码
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
<!-- #include file="../sys.asp" -->
<!-- #Include File="syssupply.asp" -->
<!-- #include file="nav.asp" -->
<!-- #Include File="../sys/inc/prompt.inc" -->
<%
dim errmsg,state,bclass,bclass2

select case ident
case "20" bclass="锁定会员"
case "21" bclass="游客"
case "22" bclass="正式会员"
case "23" bclass="高级会员"
case "24" bclass="VIP会员"
case "25" bclass="管理员"
case "26" bclass="版主"
end select

select case potence
case "22" bclass2="正式会员"
case "23" bclass2="高级会员"
case "24" bclass2="VIP会员"
case "25" bclass2="管理员"
case "26" bclass2="版主"
end select
'--------chkwriter
if ident < potence then
errmsg=errmsg+"<br>"+"<li>您还没有权限发布供求信息,请联系管理员调整级别后发表!<BR><li>您现在的等级:<font color=red>"&bclass&"</font> 发布信息需要的等级:<font color=red>"&bclass2&"</font>"
call error()
Response.End
end if

state="免费信息发布"
navstate=navstate&"信息发布"
call top
if isnumeric(""&(request("supplytypeid"))&"") and request("supplytypeid")<> "" then
call release
else
call selectsort
end if

sub release()
%>
<BR>
<table class=table1px width=758 cellspacing="0" cellpadding="0" align="center">
<tr>
<td colspan=2 class=TD1pxblue>
<table width="100%" cellSpacing=0 cellPadding=0>
<tr>
<td width=15><IMG SRC="../sys/image/nav1.gif" WIDTH="8" HEIGHT="8"></td>
<td id=whiteword>信息发布: 第二步-填写发布信息</td>
</tr>
</table>
</td>
</tr>

<form method="post" action="release2.asp" name="write">
<script src="../sys/inc/ubbcode.js"></script>
<INPUT TYPE="hidden" name=supplytype value=<%=Request.QueryString ("supplytype")%>>
<tr>
<td class=TD1pxblank>

<table width="100%" cellspacing=0 cellpadding=0 align=center width=758>
<tr>
<td class=TD1pxblank align=middle width="25%">
<div align="right">项目名称:</div>
</td>
<td class=TD1pxblank align=middle width="75%">
<div align="left">
<input name=supplyitem type=text id="supplyitem" size=50 maxlength=50 >
<INPUT TYPE="hidden" name=supplytypeid value=<%=Request("supplytypeid")%>>
<font color="#FF3333">*</font></div>
</td>
</tr>
<tr>
<td class=TD1pxblank align=middle>
<div align="right">发布单位:</div>
</td>
<td class=TD1pxblank align=middle>
<div align="left">
<input name=releasecompany type=text id="releasecompany" size=50 maxlength=50 >
<font color="#FF3333">*</font></div>
</td>
</tr>
<tr>
<td class=TD1pxblank align=middle>
<div align="right">地区:</div>
</td>
<td class=TD1pxblank align=middle>
<div align="left">
<select name=companyarea>
<option value="北 京">北  京</option>
</select>
<font color="#FF3333">*</font></div>
</td>
</tr>
<tr>
<td class=TD1pxblank width="25%" align=middle valign="top" >
<div align="right">项目简介:</div>
</td>
<td class=TD1pxblank align=middle width="75%">
<div align="left">
<input name=itempro type=text id="releasecompany22" size=50 maxlength=50 >
<font color="#FF3333">*</font> 字母或数字</div>
</td>
</tr>
<tr>
<td class=TD1pxblank align=middle>
<div align="right">相关图片链接:</div>
</td>
<td class=TD1pxblank align=middle>
<div align="left">
<input type="text" name="image" size="60" maxlength="100">
<br>
可以是图片网址或路径:例如 pic/logo.gif 或 http://www.fjjn.com/logo.gif都可以
<BR><iframe frameborder=0 width=100% height=40 scrolling=no src=ad_upload.asp></iframe>

</div>
</td>
</tr>
<tr>
<td class=TD1pxblank width="25%" align=middle valign="top" >
<div align="right">详细介绍:</div>
</td>
<td class=TD1pxblank align="center" width="75%">
<!--#include file="../sys/inc/getubb.asp" -->
<textarea name="Content" cols="92" rows="18"></textarea>
</td>
</tr>
<tr>
<td class=TD1pxblank align=middle width="25%">
<div align="right">项目性质:</div>
</td>
<td class=TD1pxblank align=middle width="75%">
<div align="left">
<select name="supsort">
<option value="1供应信息">供应信息</option>
<option value="2求购信息">求购信息</option>
<option value="3代理信息">代理信息</option>
<option value="4合作信息">合作信息</option>
<option value="5转让信息">转让信息</option>
<option value="6求职信息">求职信息</option>
<option value="7招聘信息">招聘信息</option>
</select>
<font color="#FF3333">*</font> </div>
</td>
</tr>
<tr>
<td class=TD1pxblank align="right" width="25%">
有效期:
</td>
<td class=TD1pxblank width="75%">
<SELECT NAME="avialable">
<%
for i=1 to 365
Response.Write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
天 <font color="#FF3333">*</font>
</td>
</tr>
<tr>
<td class=TD1pxblank align="right" width="25%">
联系方式:
</td>
<td class=TD1pxblank width="75%">
<input name=contact type=text size=50 maxlength="50" >
<font color="#FF3333">*</font>
</td>
</tr>
<tr>
<td id=titlefoot colspan="2" Align='center'>
<input type="submit" value="填好了,继续!" name="submit">
</td>
</tr>
</table>
</td></tr>
</form>
</table>


<%
end sub
'-----------------------
sub selectsort
%>
<BR>
<table class=tatd1px width=758 cellspacing="0" cellpadding="1" align="center">
<tr>
<td class=TD1pxblue>
<table width="100%" cellSpacing=0 cellPadding=0>
<tr>
<td width=15><IMG SRC="../sys/image/nav1.gif" WIDTH="8" HEIGHT="8"></td>
<td id=whiteword>第一步:选择信息行业分类</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" cellspacing="2" cellpadding="0">
<tr>
<%
call conned
sql="select supplytype,supplytypeid from supplytype order by supplytypeid"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
total=rs.RecordCount
i=0
do while not rs.eof and i < total
Response.Write "<td id=forum2 width=180>·<a href=release.asp?supplytypeid="&rs("supplytypeid")&"&supplytype="&rs("supplytype")&">"&rs("supplytype")&"</a></td>"
if ((i+1) mod 4)=0 then
Response.Write "</tr><tr>"
end if
rs.movenext
i=i+1
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Write "</tr></tbody></table></td></tr></table>"
end sub

%>
<br>
<table cellspacing=0 cellpadding=0 align=center width=758>
<tr><td ></td>
<td align=right>
<%
'absp
dim showright
showright=cint(right(Second(time),1))
if showright > 7 then
Response.Write "电子商务,信息供求,网站制作!"
elseif showright < 3 then
Response.Write "电子商务,信息供求,网站制作找跳蚤吧!"
end if
%>
 >> <a href=javascript:history.back()>返回上一页</a>
</td></tr></table>

<%
call foot()
%>
tzgpxl 2004-07-01
  • 打赏
  • 举报
回复
<form name="form" method="post" action="ad_upload2.asp" enctype="multipart/form-data" >
<tr>
<td>
<input type="hidden" name="filepath" value="pic">
<input type="file" name="file1">
<input type="hidden" name="fname">
<input type="submit" name="Submit" value="上传" onclick="fname.value=file1.value,parent">
请点击"浏览"找到图片,再点击上传
</td></tr>
</form>
你的这个form应该是弹出的一个一个页面吧。
组件上传里面有一句这样的话你看到没有? response.write "<script>parent.document.forms[0].image.value='"&FileName&"'</script>"
就是说填写image的值。将前一个页面的代码也贴上来吧
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
在edit里面有这样一句是不是这句啊?

<td width="200" align="right" class=TD1pxblank > 相关图片链接: </td>
<td class=TD1pxblank >
<input name=hasimage type=text value="<%=rs("hasimage")%>" size=50 maxlength=50 ><BR>在这里输入图片网址,如:http://www.fjjn.com/logo.gif
</td>
</tr>
<tr>
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
是在pic/ 得下面赋值得,就是文件上传以后就生成了一个自动的文件名称
tzgpxl 2004-07-01
  • 打赏
  • 举报
回复
Rs("hasimage")=hasimage//这行
检查你的hasimage是在哪里赋值的?
xiaowuyue 2004-07-01
  • 打赏
  • 举报
回复
<!-- #Include File="../sys.asp" -->
<!-- #Include File="../sys/inc/char.asp" -->
<!-- #Include File="syssupply.asp" -->
<!-- #Include File="../sys/inc/email.asp" -->
<!-- #Include File="nav.asp" -->
<!-- #Include File="../sys/inc/prompt.inc" -->
<%
dim supplytypeid,supplytype,supplyitem,releasecompany,companyarea,itempro,hasimage,describe,supsort,avialable,company,contact
dim errmsg,mailbody,sendmsg,useremail
dim rs,sql,viewclass
dim supsortid,supsortname,supsortvalue,content
founderr=false
call chkinput ()

if founderr=true then
call error()
else
call saveuserinfo()
if founderr=true then
call error()
else
topic="信息发布成功确认"
call sendmail()
dim successmess
if tempadd="y" then
successmess="信息发布成功,但需经(版主/管理员)审核后才可以查看。"
else
successmess="信息发布成功!"
end if
const backurl="index.asp"
backmsg="正在等待管理员审核,审核通过后才可以查看。<br>"&sendmsg
call success()
end if
end if



'-------------------------------------------------
sub chkinput()
'-------------------------------------------regtime
if not isnull(session("regtime")) or cint(regtime)>0 then
if DateDiff("s",session("regtime"),Now())<cint(RegTime) then
ErrMsg=ErrMsg+"<Br>"+"<li>限制每次发布距离时间为"®time&"秒,请稍后发布!"
FoundErr=True
end if
end if
'--------------------------------------------supplytypeid
if not isnumeric(request.form("supplytypeid")) or len(request("supplytypeid"))>3 then
errmsg=errmsg+"非法提交!"
founderr=true
else
supplytypeid=request.form("supplytypeid")
end if

'--------------------------------------------supplytype
if request.form("supplytype")="" or len(request("supplytype"))>40 then
errmsg=errmsg+"提交类型错误!"
founderr=true
else
supplytype=checkStr(request.form("supplytype"))
end if

'---------------------------------------------supplyitem
if request.form("supplyitem")="" or strLength(request.form("supplyitem"))>50 then
errmsg=errmsg+"<br>"+"<li>请输入项目名称,不能多于50字!"
founderr=true
else
supplyitem=checkStr(request.form("supplyitem"))
end if


'--------------------------------------releasecompany
if request.form("releasecompany")="" or strLength(request.form("releasecompany"))>50 then
errmsg=errmsg+"<br>"+"<li>请输入发布单位名称,不能多于50字!"
founderr=true
else
releasecompany=checkStr(Request.Form("releasecompany"))
end if


'-------------------------------------------companyarea
if request.form("companyarea")="" or strLength(request.form("companyarea"))>20 then
errmsg=errmsg+"<br>"+"<li>请输入地区名称,不能多于20个字!"
founderr=true
else
companyarea=checkStr(request.form("companyarea"))
end if



'----------------------------------itempro
if request.form("itempro")="" or strLength(request.form("itempro"))>50 then
errmsg=errmsg+"<br>"+"<li>请输入项目简介(长度不能大于50)!"
founderr=true
else
itempro=checkStr((request.form("itempro")))
end if


'-----------------------------------------hasimage
if strLength(request.form("hasimage"))>50 then
errmsg=errmsg+"<br>"+"<li>图片路径过长(长度不能大于50)!"
founderr=true
else
hasimage=trim(checkStr((request.form("hasimage"))))
if hasimage="" then hasimage="0"
end if

'-----------------------------------------------describe
if request.form("content")="" or strLength(request.form("content"))>9000 then
errmsg=errmsg+"<br>"+"<li>请输入详细介绍(长度不能大于9000)!"
founderr=true
else
content=checkStr((request.form("content")))
end if

'-----------------------------------------------supsort
if request.form("supsort")="" or strLength(request.form("supsort"))>10 then
errmsg=errmsg+"<br>"+"<li>请输入项目分类!"
founderr=true
else
supsort=checkStr((request.form("supsort")))
end if

if not isnumeric(left(""&supsort&"",1)) then
errmsg=errmsg+"<br>"+"<li>非法提交!"
founderr=true
else
supsortid=cint(left(""&supsort&"",1))
end if

select case supsortid
case 1
supsortname="supply"
supsortvalue="供应信息"
case else
errmsg=errmsg+"<br>"+"<li>非法提交!"
founderr=true
end select

'--------------------------------------------avialable
if not isnumeric(request.form("avialable")) or len(request("avialable"))>3 then
errmsg=errmsg+"<br>"+"<li>请填写有效期或有效期过长!"
founderr=true
else
avialable=request.form("avialable")
end if
'--------------------------------------------
if request.form("contact")="" or strLength(request.form("contact"))>50 then
errmsg=errmsg+"<br>"+"<li>请输入联系方式,字数小余50!"
founderr=true
else
contact=trim(checkStr((request.form("contact"))))
end if
end sub



sub saveuserinfo()
'--------------------------------是否需要审核.
if tempadd ="y" then
viewclass=1 '1 需要,
else
viewclass=0 '0 不需要
end if
'------------------------------------END
dim usersql
call conned()
set rs=server.createobject("adodb.recordset")
rs.open "supply",conn,1,3
rs.addnew
Rs("viewclass")=viewclass
rs("busername")=Session("memberusername")
rs("supplytypeid")=supplytypeid
rs("supplytype")=supplytype
rs("supplyitem")=supplyitem
rs("releasecompany")=releasecompany
rs("companyarea")=companyarea
rs("itempro")=itempro
Rs("hasimage")=hasimage
Rs("content")=content


Rs("supsortid")=supsortid
Rs("supsortname")=supsortname
Rs("supsortvalue")=supsortvalue

rs("avialable")=avialable
rs("contact")=contact
Rs("addtime")=now
rs.update
rs.close
set rs=nothing
set rs = server.CreateObject("ADODB.Recordset")
usersql="select bmail from userinfo where busername='"&Session("memberusername")&"'"
rs.open usersql,conn,1,1
useremail=rs("bmail")
rs.close
set rs=nothing
sql="update supplytype set typecount=typecount+1 where supplytypeid="&supplytypeid
set rs=conn.execute(sql)

conn.close
set conn=nothing

session("regtime")=now()
end sub

sub sendmail()
dim err
err=false
on error resume next
mailbody=mailbody &"尊敬的:"&session("username")&" 您好!"& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &" 您在"&homename&"的信息已经发布成功。"& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"项目名称:"&supplyitem& vbcrlf
mailbody=mailbody &"信息分类:"&supplytype& vbcrlf
mailbody=mailbody &"信息性质:"&supsort& vbcrlf
mailbody=mailbody &"发布单位:"&releasecompany& vbcrlf
mailbody=mailbody &"项目简介:"&itempro& vbcrlf
mailbody=mailbody &"相关图片:"&sendhasimage& vbcrlf
mailbody=mailbody &"有效期:"&avialable& vbcrlf
mailbody=mailbody &"联系方式:"&contact& vbcrlf
mailbody=mailbody &"" & vbcrlf
if tempadd ="y" then mailbody=mailbody &" 本站核实提交内容后,其它网友即可看到您的有关信息,如果由于某些原因不能接受您的信息,请原谅无法及时通知."& vbcrlf
mailbody=mailbody &" 您可以用上面的信息登陆本站修改您发布的信息,查看点击情况,同时也希望给我们多提建议和意见!(本站网址:"&homepage&")"& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &mailsendmessage& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"信息发布服务由:"&homename&"提供("&homepage&")"&vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &mailfoot& vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &"" & vbcrlf
mailbody=mailbody &" "&now& vbcrlf
mailbody=mailbody &""

select case EmailFlag
case 0
sendmsg="系统未开启邮件功能,请记住您的注册信息。"
case 1
call sendour(useremail)
sendmsg="您的注册信息已经发往您的邮箱,请注意查收。"
case 2
call Cdonts(useremail)
sendmsg="您的注册信息已经发往您的邮箱,请注意查收。"
case else
sendmsg="系统未开启邮件功能,请记住您的注册信息"
end select

end sub
%>
tzgpxl 2004-07-01
  • 打赏
  • 举报
回复
你的release2.asp的插入语句写出来看看??
这跟组件上传图片没关系的啊。
加载更多回复(9)

28,391

社区成员

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

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