<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="conn.asp"-->
<%
dim da
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from tupian",conn,1,1
da=trim(rs("Pictures"))
rs.close
set rs=nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head><body>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<div align="center">查看新闻&nbsp;&nbsp;&nbsp;<a href="">查看图片</a></div>
<div align="right">
<%
if session("Membername") ="" then
%>
<a href="huiyuan.asp">会员登陆</a>&nbsp;&nbsp;&nbsp;<a href="zhuceHY.asp">注册</a>
<%else%>
<%=session("Membername")%>&nbsp;&nbsp;&nbsp;<a href="zhuxiao.asp">注销</a>
<%end if%>
</div>
<table width="200" border="1">
  <tr>
    <td><%
if da<>"" then
if datype=1 then
response.write "<img src="&da&" border=""0"">"
else
response.write da
         end if
end if
%></td>
  </tr>
</table>
</body>
</html>

解决方案 »

  1.   

    在出错的图片上点击右键(或者查看浏览器源代码),查看 SRC值是什么.
      

  2.   

    地址都对 了,内容都能读出来,但就是不显示出图片,显示的是数据库中的图片地址:img/sco.jpg显示的就是这
      

  3.   

    response.write "<img src=\"&da&\" alt=\"error\" border=\"0\"/>"
      

  4.   

    <%
             if da<>"" then  
                     response.write "<img src="&da&" border=""0"">"
             end if
     %>我改成这,显示出来的图片变“X”了,但是地址和图片名称都对的,右键图片地址也正确
      

  5.   

    不应该啊.
    难道页面直接显示
    <img src=img/aaa.jpg /> ?
      

  6.   

    网页右键查看源代码,SRC值就是图片的位置
      

  7.   

    用litral空间吧,
    this.litral.text="<img src=img/aaa.jpg />";
      

  8.   

    lz,在你给定的路径里有没有指定名字的图片。而且web程序,图片位置要在web程序下,不能直接指定硬盘地址
      

  9.   

    你看你这段代码:if datype=1 then
    response.write "<img src="&da&" border=""0"">"
    else
    response.write da  end if输出图片地址肯定是上面的判断问题了;因为datype !=1  
    所以才会输出图片地址
      

  10.   

    如果你当前的asp不在根目录下,那肯定就不会显示图片的.
      

  11.   

    如果你是把asp改了目录,或者把图片改了目录,那就大可不必.直接用绝对路径或相对路径就行了.
    如  /img/aa.jpg
    或者 ../img/aa.jpg(asp在根目录的下级子目录)
    或者../../img.aa.jpg(asp在根目录下级的下级目录)