Just to help you pose the question better, are your images being generated by a cgi script? Or can you just send out a simple form with ckickable buttons? You probably should read "perldoc CGI" and search for CREATING A CLICKABLE IMAGE BUTTON So is this all going to be handled by a single cgi script? Or do you have a multiple cgi scripts handing everything? The very basic thing you could do is send out a form, with 3 images, that upon clicking return different params to a cgi script.
#Here is some UNTESTED PSEUDOCODE to show the idea. There are 2 basi
+c functions. One is send out the form, the second is to receive a res
+ponse from the form and process it. My cgi is rusty, so anyone who ca
+n fix the errors, please do.
#!/usr/bin/perl
use warnings;
use strict;
use CGI;
my( $q ) = new CGI;
print $q->header;
print $q->start_html( -title=>"Test" );
print $q->start_form(-action=>'this_script.cgi);
# Add images
# image_button() produces a clickable image. When its clicked on the
# position of the click is returned to your script as "button_name.x"
+ and
# "button_name.y", where "button_name" is the name youve assigned to i
+t.
print $q->image_button(button_name1, /path/source/URL, MIDDLE);
print $q->image_button(button_name2, /path/source/URL, MIDDLE);
print $q->image_button(button_name3, /path/source/URL, MIDDLE);
print $q->submit( -name=>'Choose Action', -label=>'Start Test' );
print $q->br;
print $q->end_form;
print $q->end_html;
# this is where you detect which button is pressed
if ( $q->param() ) {
my $button = $query->param();
#probably need better param checking
#use
#@params=$query->param;
#gets a list of all the names of the parameters passed to the script
print "@params\n";
if ($button eq 'button_name1'){'do something'}
if ($button eq 'button_name2'){'do something'}
if ($button eq 'button_name3'){'do something'}
}
|