Here is a perl/cgi small script for you:
#!/usr/bin/perl
# Add your links like this with a comma at the end
#of each EXECPT for the last link
@links = (
"1::http://www.yahoo.com",
"2::http://www.hotmail.com"
);
#To redirect to a link, use your address as:
#http://yoursite.com/cgi-bin/this_script.pl?1
#
#Change "1" to the number of the link above

)
#In this case it will go to Yahoo.
foreach $link (@links)
{
($number,$url) = split (/::/, $link);
if ($ENV{QUERY_STRING} eq "$number")
{
$to = $url;
}
}
print "Location: $to\n\n";
exit;