[ic] text as image/img src element

Michael Neilly mneilly at yahoo.com
Wed Jun 2 14:41:32 EDT 2004

I would like to create a "text as image" usertag that I can use on my
various pages as a security measure against automated scripts
forms. I see this on lots of pages these days where a random code is
presented as an image and the user must enter that code to submit the

I would like to use the scratch space to store my parameters and code
to be used to generate the image... easy enough but.... is there a way
to make a reference through interchange that will execute tags but not
output its own header/html so I can use it as the src element in an img

<img src="/cgi-bin/mystore/text2image">

Where text2image wants to be something like the following:

[perl interpolate=1]

use GD;

my $img = new GD::Image(200,80);

my $white = $img->colorAllocate(255,255,255);
my $black = $img->colorAllocate(0,0,0);
my $red   = $img->colorAllocate(255,0,0);


$img->string(gdSmallFont,10,10,"Text Test",$black);

print header('image/png');
print $img->png;


thanks in advance!

More information about the interchange-users mailing list