| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 296 人关注过本帖
标题:求助 上传、显示图片的问题
只看楼主 加入收藏
gklm
Rank: 2
等 级:论坛游民
帖 子:4
专家分:10
注 册:2011-5-17
收藏
 问题点数:0 回复次数:0 
求助 上传、显示图片的问题
关于我这个图片上传和显示的问题。我都搞大了,我是新手,都弄了N多天,都没有搞好,也看了很多资料,由于自学,所以学得不慢。所以上来麻烦各位哥哥能帮忙一下。小弟在些先多谢了。
红色部份是图片上传和更换图片的位置,我曾插入代码,是可以上传图片了,可是在数据库里,另换了一行数据,不对位。麻烦大家帮忙一下,谢谢了!

<!--#include file="inc/right.asp"-->
<!--#include file="inc/conn.asp"-->
<%
IF Request("wor")="del" Then
sql="delete from Information where id="&Request("id")
Conn.execute(sql)
Response.Redirect "?action=list"
End IF
%>

<%
action=Request("action")
id=Request("id")
if action="yes" Then
 set rs=server.createobject("adodb.recordset")
if id="" then
   set rsCheck = conn.execute("select dabh from Information where dabh='" & trim(Request.Form("dabh")) & "'")
     if not (rsCheck.bof and rsCheck.eof) then
      response.write "<script language='javascript'>alert('档案编号 " & trim(Request.Form("dabh")) & " 已存在,请检查!');history.back(-1);</script>"
      response.end
     end if
   set rsCheck=nothing
   sql="select * from Information"
   rs.open sql,conn,3,3
   rs.addnew         '添加记录到数据表末端
else
   sql="select * from Information where id="&id&""
   rs.open sql,conn,1,2
end if
rs("dabh")=Request("dabh")
rs("spec")=Request("spec")
rs("bpic")=Request("bpic")
rs("name")=Request("name")
rs("name1")=Request("name1")
rs("mz")=Request("mz")
rs("sfz")=Request("sfz")
rs("lxfs")=Request("lxfs")
rs("fzlx")=Request("fzlx")
rs("lf")=Request("lf")
rs("fjdz")=Request("fjdz")
rs("xjzdz")=Request("xjzdz")
rs("flws")=Request("flws")
rs("xlbm")=Request("xlbm")
rs("zzfx")=Request("zzfx")
rs("fxcs")=Request("fxcs")
rs("sqkf")=Request("sqkf")
rs("wf")=Request("wf")
rs("addtime")=Request("addtime")
 rs.update         '更新数据表记录
 rs.close
set rs=nothing
 Response.Redirect "?action=list"
end if
%>
<html>
<head>
<title>XXXXXX社区管理系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="images/main.css" rel="stylesheet" type="text/css">
<script language=JavaScript>
<!--
function DoEmpty(params)
{
if (confirm("真的要删除这条记录吗?删除后此记录里的所有内容都将被删除并且无法恢复!"))
window.location = params ;
}

function check()
{

  if (document.add.dabh.value=="")
     {
      alert("请填写档案编号!")
      document.add.dabh.focus()
      document.add.dabh.select()
      return
     }
     
  if (document.add.name.value=="")
     {
      alert("请填写姓名!")
      document.add.name.focus()
      document.add.name.select()
      return
     }
     
  if (document.add.name1.value=="")
     {
      alert("请填写别名!")
      document.add.name1.focus()
      document.add.name1.select()
      return
     }
     
       if (document.add.mz.value=="")
     {
      alert("请填写民族!")
      document.add.mz.focus()
      document.add.mz.select()
      return
     }
       if (document.add.sfz.value=="")
     {
      alert("请填写身份证!")
      document.add.sfz.focus()
      document.add.sfz.select()
      return
     }
       if (document.add.lxfs.value=="")
     {
      alert("请填写联系方式!")
      document.add.lxfs.focus()
      document.add.lxfs.select()
      return
     }
       if (document.add.fzlx.value=="")
     {
      alert("请填写犯罪类型!")
      document.add.fzlx.focus()
      document.add.fzlx.select()
      return
     }
       if (document.add.lf.value=="")
     {
      alert("请填写是否累犯!")
      document.add.lf.focus()
      document.add.lf.select()
      return
     }
       if (document.add.fjdz.value=="")
     {
      alert("请填写户籍地址!")
      document.add.fjdz.focus()
      document.add.fjdz.select()
      return
     }
       if (document.add.xjzdz.value=="")
     {
      alert("请填写现居住地址!")
      document.add.xjzdz.focus()
      document.add.xjzdz.select()
      return
     }
        if (document.add.flws.value=="")
     {
      alert("请填写法律文书!")
      document.add.flws.focus()
      document.add.flws.select()
      return
     }
       if (document.add.xlbm.value=="")
     {
      alert("请填写下落不明!")
      document.add.xlbm.focus()
      document.add.xlbm.select()
      return
     }
       if (document.add.zzfx.value=="")
     {
      alert("请填写正在服刑!")
      document.add.zzfx.focus()
      document.add.zzfx.select()
      return
     }
       if (document.add.fxcs.value=="")
     {
      alert("请填写服刑场所!")
      document.add.fxcs.focus()
      document.add.fxcs.select()
      return
     }
       if (document.add.sqkf.value=="")
     {
      alert("请填写社区康复!")
      document.add.sqkf.focus()
      document.add.sqkf.select()
      return
     }
       if (document.add.wf.value=="")
     {
      alert("请填写违法犯罪事实!")
      document.add.wf.focus()
      document.add.wf.select()
      return
     }
     
  if (document.add.addtime.value=="")
     {
      alert("请填写录取时间!")
      document.add.addtime.focus()
      document.add.addtime.select()
      return
     }
     
     document.add.submit()
}

 function changeN()
 {
  add.spec.disabled=true;
 }
 function changeY()
 {
  add.spec.disabled=false;
 }
 function next()
 {
  if(event.keyCode==13)event.keyCode=9;
 }
-->
</script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td bgcolor="#FFFFFF">
    <%if action="add" then%><BR>
        <table width="96%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
        <form name="add" method="post" action="Information.asp">
        <tr align="center" bgcolor="#F2FDFF">
          <td colspan="2"  class="optiontitle"> 添加信息 </td>
        </tr>
        <tr align="center" bgcolor="#F2FDFF">
          <td width="15%" align="right">档案编号:</td>
          <td width="85%" align="left"><input name="dabh" type="text" id="dabh" onKeyDown="next()" >
          按回车\TAB键即可输入下一选项</td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td rowspan="2" align='right' bgcolor="#FFFFFF">照片:</td>
          <td align='left'><input name="bpic" type="text" class="ct_box1" id="bpic" size="80" /></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='left'><iframe frmAnnounce='ad' frameborder=0 width='80%' height=24 scrolling=no src='sm_upload.asp?action=bpic'></iframe></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">姓名:</td>
          <td align='left'><input name="name" type="text" id="name" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">别名:</td>
          <td align='left'><input name="name1" type="text" id="name1" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">民族:</td>
          <td align='left'><input name="mz" type="text" id="mz" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">身份证:</td>
          <td align='left'><input name="sfz" type="text" id="sfz" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">法律文书:</td>
          <td align='left'><input name="flws" type="text" id="flws" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">联系方式:</td>
          <td align='left'><input name="lxfs" type="text" id="lxfs" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF"> 犯罪类型:</td>
          <td align='left'>
            <input type="radio" name="fzlx" value="未犯罪" onClick="changeN()">
            未犯罪
            <input type="radio" name="fzlx" value="犯罪" onClick="changeY()" checked="checked">
            犯罪
            <%
              Set rsspec = Server.CreateObject("ADODB.Recordset")
            rsspec.open "select * from Specialty",Conn,1,2
            if rsspec.eof and rsspec.bof then
            response.write "请先添加犯罪类型"
            else
          %>
            <select name="spec" id="spec">
              <option value="">请选择犯罪类型</option>
          <%
            do while not rsspec.eof
          %>
             <option value="<%=rsspec("title")%>"><%=rsspec("title")%></option>
          <%
            rsspec.movenext
            loop
            end if
            rsspec.close
            set rsspec=nothing
          %>
            </select>
          </td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">是否累犯:</td>
          <td align='left'><input name="lf" type="text" id="lf" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">下落不明:</td>
          <td align='left'><input name="xlbm" type="text" id="xlbm" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">正在服刑:</td>
          <td align='left'><input name="zzfx" type="text" id="zzfx" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">服刑场所:</td>
          <td align='left'><input name="fxcs" type="text" id="fxcs" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">社区康复:</td>
          <td align='left'><input name="sqkf" type="text" id="sqkf" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">户籍地址:</td>
          <td align='left'><input name="fjdz" type="text" id="fjdz" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">现居住地址:</td>
          <td align='left'><input name="xjzdz" type="text" id="xjzdz" onKeyDown="next()" ></td>
        </tr>
                <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">违法犯罪事实:</td>
          <td align='left'><input name="wf" type="text" id="wf" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF"> 录取时间:</td>
          <td align='left'><input name="addtime" type="text" id="addtime" value="<%response.write now()%>" onKeyDown="next()" ></td>
        </tr>
        <tr align="center" bgcolor="#ebf0f7">
          <td  colspan="2" >
             <INPUT TYPE="hidden" name="action" value="yes">
            <input type="button" name="Submit" value="提交" onClick="check()">
              <input type="button" name="Submit2" value="返回" onClick="history.back(-1)"></td>
        </tr>
        </FORM>
      </table>
<%end if%>
<br>
<%if action="list" then%>
      <table width="96%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
        <tr align="center" bgcolor="#F2FDFF">
          <td colspan="6"  class="optiontitle">查询信息</td>
        </tr>
        <tr align="center">
          <td bgcolor="#ebf0f7" width="12%">档案编号</td>
          <td bgcolor="#ebf0f7" width="6%">姓名</td>
          <td bgcolor="#ebf0f7" width="15%">身份证</td>
          <td bgcolor="#ebf0f7" width="10%">联系电话</td>
          <td bgcolor="#ebf0f7" width="10%">法律文书</td>
          <td bgcolor="#ebf0f7" width="15%">犯罪类型</td>
          <td bgcolor="#ebf0f7" width="12%">点击修改</td>
        </tr>
        
<%
sql="select * from Information order by id desc"
 set rs=server.createobject("adodb.recordset")
 rs.open sql,conn,1,1
 if not rs.eof then
 proCount=rs.recordcount
    rs.PageSize=20                      '定义显示数目
     if not IsEmpty(Request("ToPage")) then
        ToPage=CInt(Request("ToPage"))
        if ToPage>rs.PageCount then
           rs.AbsolutePage=rs.PageCount
           intCurPage=rs.PageCount
        elseif ToPage<=0 then
           rs.AbsolutePage=1
           intCurPage=1
        else
           rs.AbsolutePage=ToPage
           intCurPage=ToPage
        end if
     else
        rs.AbsolutePage=1
        intCurPage=1
     end if
     intCurPage=CInt(intCurPage)
     For i = 1 to rs.PageSize
     if rs.eof then     
     Exit For
     end if '利用for next 循环依次读出记录
%>
        <tr align='center' bgcolor='#FFFFFF' onmouseover='this.style.background="#F2FDFF"' onmouseout='this.style.background="#FFFFFF"'>
          <td><%=rs("dabh")%></td>
          <td><%=rs("name")%></td>
          <td><%=rs("sfz")%></td>
          <td><%=rs("lxfs")%></td>
          <td><%=rs("flws")%></td>
          <td><%=rs("fzlx")%></td>
          <td><IMG src="images/edit.gif" align="absmiddle"><a href="?action=edit&id=<%=rs("id")%>">修改</a> | <IMG src="images/drop.gif" align="absmiddle"><a href="javascript:DoEmpty('?wor=del&id=<%=rs("id")%>&action=list&ToPage=<%=intCurPage%>')">删除</a></td>
        </tr>
<%
rs.movenext
next
%>
        <tr align="center" bgcolor="#ebf0f7">
          <td colspan="6"> 总共:<font color="#ff0000"><%=rs.PageCount%></font>页, <font color="#ff0000"><%=proCount%></font>位考生信息, 当前页:<font color="#ff0000"><%=intCurPage%> </font><%if intCurPage<>1 then%><a href="?action=list">首页</a>|<a href="?action=list&ToPage=<%=intCurPage-1%>">上一页</a>|<% end if
if intCurPage<>rs.PageCount then %><a href="?action=list&ToPage=<%=intCurPage+1%>">下一页</a>|<a href="?action=list&ToPage=<%=rs.PageCount%>"> 最后页</a><% end if%></span></td>
        </tr>
<%
else
%>
        <tr align="center" bgcolor="#ffffff">
          <td colspan="6">对不起!目前数据库中还没有添加录取考生信息!</td>
        </tr>
<%
rs.close
set rs=nothing
end if
%>
      </table>
      <br>
<%end if%>
<%if action="edit" then
set rs=server.createobject("adodb.recordset")
sql="select * from Information where id="&Request("id")
rs.open sql,conn,1,1
if not rs.eof Then
%>
<br>
      <table width="96%"  border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#aec3de">
       <form name="add" method="post" action="Information.asp">
        <tr align="center" bgcolor="#F2FDFF">
          <td colspan=2  class="optiontitle"> 考试信息 </td>
        </tr>
        <tr align="center" bgcolor="#F2FDFF">
          <td width="18%" align="right"> 档案编号:</td>
          <td width="82%" align="left"><input name="dabh" type="text" id="dabh" value="<%=rs("dabh")%>" onKeyDown="next()" >
            按回车\TAB键即可输入下一选项</td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td rowspan="3" align='right' bgcolor="#FFFFFF">照片:</td>
          <td align='left'><img src="<%=rs("bpic")%>"></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='left'><input name="bpic" type="text" class="ct_box1" id="bpic" value="<%=rs("bpic")%>" size="80" /></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='left'>&nbsp;<iframe name='ad' frameborder=0 width='80%' height=24 scrolling=no src='sm_upload.asp?action=bpic'></iframe></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF"> 姓名:</td>
          <td align='left'><input name="name" type="text" id="name" value="<%=rs("name")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">别名:</td>
          <td align='left'><input name="name1" type="text" id="name1" value="<%=rs("name1")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF"> 民族:</td>
          <td align='left'><input name="mz" type="text" id="mz" value="<%=rs("mz")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">身份证:</td>
          <td align='left'><input name="sfz" type="text" id="sfz" value="<%=rs("sfz")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">法律文书:</td>
          <td align='left'><input name="flws" type="text" id="flws" value="<%=rs("flws")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">联系电话:</td>
          <td align='left'><input name="lxfs" type="text" id="lxfs" value="<%=rs("lxfs")%>" onKeyDown="next()" ></td>
         </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF"> 是否录取:</td>
          <td align='left'>
            <input type="radio" name="fzlx" value="吸毒人员" onClick="changeN()" <% if rs("fzlx")="吸毒人员" then response.Write("checked") end if%>>未犯罪
            <input type="radio" name="fzlx" value="重点人口" onClick="changeY()" <% if rs("fzlx")="重点人口" then response.Write("checked") end if%>>犯罪
            <%
              Set rsspec = Server.CreateObject("ADODB.Recordset")
            rsspec.open "select * from Specialty",Conn,1,2
            if rsspec.eof and rsspec.bof then
            response.write "请先添加专业"
            else
          %>
            <select name="spec" id="spec" disabled>
              <option value="">请选择专业</option>
          <%
            do while not rsspec.eof
          %>
           <option value="<%=rsspec("title")%>" selected <% if rs("spec")=rsspec("title") then response.write("selected") end if%>><%=rsspec("title")%></option>
          <%
            rsspec.movenext
            loop
            end if
            rsspec.close
            set rsspec=nothing
          %>
            </select>         
          </td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">是否累犯:</td>
          <td align='left'><input name="lf" type="text" id="lf" value="<%=rs("lf")%>" onKeyDown="next()" ></td>
        </tr><tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">下落不明:</td>
          <td align='left'><input name="xlbm" type="text" id="xlbm" value="<%=rs("xlbm")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">正在服刑:</td>
          <td align='left'><input name="zzfx" type="text" id="zzfx" value="<%=rs("zzfx")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">服刑场所:</td>
          <td align='left'><input name="fxcs" type="text" id="fxcs" value="<%=rs("fxcs")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">社区康复:</td>
          <td align='left'><input name="sqkf" type="text" id="sqkf" value="<%=rs("sqkf")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">户籍地址:</td>
          <td align='left'><input name="fjdz" type="text" id="fjdz" value="<%=rs("fjdz")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">现居住地址:</td>
          <td align='left'><input name="xjzdz" type="text" id="xjzdz" value="<%=rs("xjzdz")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF">违法犯罪事实:</td>
          <td align='left'><input name="wf" type="text" id="wf" value="<%=rs("wf")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align='center' bgcolor='#FFFFFF'>
          <td align='right' bgcolor="#FFFFFF"> 录取时间:</td>
          <td align='left'><input name="addtime" type="text" id="addtime" value="<%=rs("addtime")%>" onKeyDown="next()" ></td>
        </tr>
        <tr align="center" bgcolor="#ebf0f7">
          <td colspan="2">
          <input type="hidden" name="action" value="yes">
          <input type="button" name="Submit2" value="提交" onClick="check()">
          <input type="button" name="Submit2" value="返回" onClick="history.back(-1)">
          <input name="id" type="hidden" id="id" value="<%=rs("id")%>">          </td>
        </tr>
          </FORM>
      </table>
<%
end if
end if
%>   
    </td>
  </tr>
</table>
</body>
</html>
搜索更多相关主题的帖子: Request include 数据库 where 图片 
2011-05-17 18:55
快速回复:求助 上传、显示图片的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030492 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved