这样的图片如何调用嵌入到其他网页里去???????请高手帮忙。(不要iframe)
这样的图片如何调用嵌入到其他网页里去???????请高手帮忙。(人在可马上给分!)
这段代码所在文件是:pic.asp,图片访问方式为:pic.asp?id=1
id是图片的序号,我想在另一个页面中(注:这个页是asp页)中调用该图片(注:不想用iframe调用),请问高手如何实现,目前这样试过:<script src="pic.asp?id=1"></script>,失败!
<%
function readbinfile(path)
dim objstream,bin
set objstream = server.createobject("adodb.stream")
objstream.open
objstream.type = 1
objstream.loadfromfile path
bin = objstream.read
objstream.close
readbinfile = bin
end function
dim id:id = trim(request("id"))
dim rs,sql
if id = "" or not isnumeric(id) then
response.redirect("index.asp")
end if
set rs = server.createobject("adodb.recordset")
sql = "select * from photo where pid=" & id
rs.open sql,conn,1,1
if rs.eof then
response.write("<script>alert(""非常抱歉!暂时还没有图片!"");this.location.href=""index.asp"";</script>")
else
dim filepath,path,bin
filepath = rs("filepath")
path = server.mappath("" & filepath & "")
bin = readbinfile(path)
response.contenttype = "image/jpeg"
response.binarywrite(bin)
rs.close
set rs = nothing
end if
%>