Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<%
x = session("img")
dim images(10)
images(0) = "\puboffsearch\captcha\0.gif"
images(1) = "\puboffsearch\captcha\1.gif"
images(2) = "\puboffsearch\captcha\2.gif"
images(3) = "\puboffsearch\captcha\3.gif"
images(4) = "\puboffsearch\captcha\4.gif"
images(5) = "\puboffsearch\captcha\5.gif"
images(6) = "\puboffsearch\captcha\6.gif"
images(7) = "\puboffsearch\captcha\7.gif"
images(8) = "\puboffsearch\captcha\8.gif"
images(9) = "\puboffsearch\captcha\9.gif"
x = int(x)
file_name = images(x)
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile = server.mappath(file_name)
Response.ContentType = "image/gif"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
<img src="image.asp?i=1">
<img src="image.asp?i=3">
<%
dim i
i = request.QueryString("i")
if i = "" then i = 0
dim images(10)
images(0) = "\puboffsearch\captcha\0.gif"
images(1) = "\puboffsearch\captcha\1.gif"
images(2) = "\puboffsearch\captcha\2.gif"
images(3) = "\puboffsearch\captcha\3.gif"
images(4) = "\puboffsearch\captcha\4.gif"
images(5) = "\puboffsearch\captcha\5.gif"
images(6) = "\puboffsearch\captcha\6.gif"
images(7) = "\puboffsearch\captcha\7.gif"
images(8) = "\puboffsearch\captcha\8.gif"
images(9) = "\puboffsearch\captcha\9.gif"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile = server.mappath( images(i) )
Response.ContentType = "image/gif"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
<%session("img") = "7.jpg"%>
<td><img src="img.asp"></img></td>
<%response.flush%>
<%session("img") = "9.jpg" %>
<td><img src="img.asp"></img></td>
<%response.flush%>
<%session("img") = "8.jpg" %>
<td><img src="img.asp"></img></td>
<%response.flush%>
image_file = session("img")
Dim objStream
Set objStream = Server.CreateObject("ADODB.Stream")
'Open a GIF file
objStream.Type = 1
objStream.Open
objStream.LoadFromFile server.mappath(image_file)
Response.ContentType = "image/gif"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
session("img") = ""
response.end
<img src="img.asp?id=1" />
<img src="img.asp?id=2" />
<%
with response
.CacheControl = "no-cache"
.AddHeader "Pragma", "no-cache"
.ContentType = "image/gif"
.Buffer = true
end with
' get image id
img_id = request.querystring("id")
select case img_id
case 1: img_name = "\mypath\myImg.gif"
case 2: img_name = "\mypath\myNextImg.gif"
end select
dim objStream
set objStream = server.createObject("ADODB.Stream")
objStream.type = 1
objStream.open
objStream.loadFromFile server.mapPath(img_name)
response.binaryWrite objStream.read
objStream.close
set objStream = nothing
%>
by using a session variable.another way is to call image.asp with a parameter, eg image.asp?id=1 and then (in image.asp) search a table for the folder/file name if there is a very limited and fixed number of images you can do it with IF TEHN ELSE/ SELECT CASE block (eg when you have a Yes and No image)
<% session("img1") = 1 %>
<img src="image.asp" >
<% session("img2") = 2 %>
<img src="image2.asp" >
<%
file_name = session("img1") & ".gif"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile = server.mappath(file_name)
Response.ContentType = "image/gif"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
<%
file_name = session("img2") & ".gif"
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadFromFile = server.mappath(file_name)
Response.ContentType = "image/gif"
Response.BinaryWrite objStream.Read
objStream.Close
Set objStream = Nothing
%>
displaying multiple gif's is going ok now.
the only problem right now is that the id is showing up on the html source code. i wonder if session variable can do the trick?
<img src="img.asp?id=1" />
thanks.
<form action="mypage.asp" method="post">
<input type="text" id="tbx" name="tbx" />
<input type="text" id="captcha" name="captcha" value="" />
<input type="submit" />
</form>
<%
' what to name this var will be defined in the documentation
captcha_entered = request.form("captcha")
<!--#include file="location\captcha_verification_file.asp" -->
' the above will return a variable called something like "captcha_verified"
if not captcha_verified then
' error on captcha value entered
response.write "INVALID SECURITY CODE!"
response.end
else
tbx = request.form("tbx")
'continue processing
end if
%>
thanks vicvirk.
is this include file:
<!--#include file="location\captcha_verification_file.asp" -->
related to any of the links that you posted above? i could not find it in any of those links after downloading them. can you please post which captcha this inlude file belongs to?
thanks.
i meant to say:i have to put this "demo" captcha page code in front of my page1.asp