#!/usr/bin/perl -w use strict; use CGI; use GD; my $cgi=new CGI; my $cgi_size=$cgi->param('size') || '50'; print "Content-type: image/gif\n\n"; my $gd=new GD::Image($cgi_size,$cgi_size); my $blue=$gd->colorAllocate(0,0,255); $gd->fill(0,0,$blue); binmode STDOUT; #just in case we're on NT print $gd->gif; #### #!/usr/bin/perl -w use CGI::Carp qw(fatalsToBrowser); use CGI qw(:standard :cgi-lib); ReadParse(\%in); if ((defined($in{img}) && $in{img} != 1) || !defined($in{img})) { $image_file = qq~/home/user/home_dir/graphics/banners/FRHWeb_366_x_60.gif~; open(IMG,"$image_file") or die "could not read image: $!"; binmode IMG; $image_file_code = ; close(IMG); print "Content-type:image/gif\n\n"; print $image_file_code; exit; } else { $image_file = qq~/home/user/home_dir/graphics/banners/FRHWeb_212_x_60.gif~; open(IMG,"$image_file") or die "could not read image: $!"; binmode IMG; $image_file_code = ; close(IMG); print "Content-type:image/gif\n\n"; print $image_file_code; exit; }