做的asp验证码图片不显示

来源:百度知道 编辑:UC知道 时间:2024/07/14 19:56:45
下面是表单代码:
</p>
<form name="form1" method="post" action="">
验证码:
<label>
<input name="textarea" type="text" value="" size="8">
<img src=GetCode.asp> </label>
'这里是放验证码图片的
<p>
<input type="submit" name="Submit" value="提交">
</p>
</form>

下面是GetCode.asp文件里面的代码:
<%
Option Explicit
Response.buffer=true
NumCode
Function NumCode()
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "cache-ctrol","no-cache"
dim zNum,i,j
dim Ados,Ados1
Randomize timer
zNum = cint(8999*Rnd+1000)
Session("GetCode") = zNum
dim zimg(4),NStr
NStr=cstr(zNum)
For i=0 to 3
zimg(i)=cint(mid(NStr,i+1,1

GetCode.asp 里面的Server.mappath 路径不能够乱改的。

body.Fix和head.fix 的路径是相对GetCode.asp 来确定的。

就像是插入文件include file 一样的方法。

路径错误:
Server.mappath("images/body.Fix")
......
Server.mappath("images/head.fix")

绝对路径修改为:(注意:Images文件夹在站点根目录下面)
Server.mappath("/images/body.Fix")
Server.mappath("/images/head.fix")

或者相对路径可以修改为:(注意:Images文件夹在站点根目录下面)
Server.mappath("../images/body.Fix")
Server.mappath("../images/head.fix")

补充:
--------------------------------------------------
请先在网上下载body.Fix、head.fix这2个文件确定可以显示了,再使用自己制作的文件,若还没有办法显示,那可能你做的这个文件是错误的。