#!/usr/bin/perl -- # kuller.pl - web-safe color selector; # put your own address in 'eaddr', drop kuller.pl into your cgi-bin, # and give the url to your user; # advise her to enter her own email address in 'From:', # put in a description of the page or section the colors are to be used for, # and pick out the color settings she wants; click 'Send'; # N.B.: there are 3 colors in a full set: frame, background, and foreground; # fore-/background colors will always be sent, but it's not necessary to pick # a frame color if the page doesn't call for one; # the default font is Times-24pt; there is no such thing as a web-safe font list, # although some fonts are safer than others; the list below is just a bunch of # popular fonts, with the ones most common at the top (weight of '2'); # we need a mechanism to tell the user he's picking a 1 or 0; # # to do: kuller.html/kuller.js, so that the selector can be easily dropped into # a page other than the one hard-coded here. # # # this is the address where you want the selection sent; the user can put her own address # in the From: field in the form. # #$eaddr = "slick@hotwheels.com"; (e.g.) $eaddr = ""; ########################################################################################################################## # the values that are recognized by all browsers and servers; # if you want to rearrange the pallette, you can fiddle with the order of these lists, # by reversing or 'mirroring' the intensity values: @redlist = ( "00", "33", "66", "99", "cc", "ff", ); @grnlist = ( "00", "33", "66", "99", "cc", "ff", ); # "ff", "cc", "99", "66", "33", "00", ); @blulist = ( "00", "33", "66", "99", "cc", "ff", ); %fntlist = ( "Courier", 2, "Arial Black", 2, "Verdana", 2, "Comic Sans MS", 2, "Arial", 2, "Courier New", 2, "Impact", 2, "Tahoma", 2, "Trebuchet MS", 2, "Helvetica", 2, "Times", 2, "Arial Narrow", 2, "Georgia", 2, "Century", 2, "Century Gothic", 2, "Times New Roman", 2, "Lucida Console", 1, "Lucida Sans Unicode", 1, "Bookman Oldstyle", 1, "Book Antiqua", 1, "Geneva", 1, "Monaco", 1, "Skia", 1, "Garamond", 1, "Palatino", 1, "Bitstream Vera Sans", 0, "Bitstream Vera Sans Mono", 0, "Bitstream Vera Serif", 0, "Utopia", 0, "New Century Schoolbook", 0, "Fixed", 0, "Fixedsys", 0, "Everson mono terminal", 0, "Nimbus Mono", 0, "Century Schoolbook L", 0, "URW Grotesk T", 0, "WingDings", 0, "Symbol", 0, "Klingon", 0, "Zapf Dingbats", 0, "Ventilate", 0, ); @tmp = (); @spec = (); # starting points only: $selct = "select"; $pfram = "Picture"; $frame = "silver"; $backg = "white"; $foreg = "black"; $gcolrr = "cc"; $gcolrg = "cc"; $gcolrb = "cc"; $bcolrr = "ff"; $bcolrg = "ff"; $bcolrb = "ff"; $fcolrr = "00"; $fcolrg = "00"; $fcolrb = "00"; $kfont = "Times"; $kfsiz = 24; $txt = "Now sleeps the crimson petal, now the white;
#0 oO #1 iI lL"; main: { print "Content-Type: text/html\n\n"; # only vars listed in postable will be read from the form's post %postable = ( "backg", 1, # background "foreg", 1, # foreground "frame", 1, # page(frame) color "selct", 1, # select/frozen toggle "pfram", 1, # picture/frame toggle "kfont", 1, # selected text font "kfsiz", 1, # size of same "eaddr", 1, # email address for recipient "descr", 1, # description of what this color should be used for "euser", 1, # email address of sender (picking the color) "sendb", 1, # 'Send' from the command button ); &postit(); print "
| \n"; print " |
\n$txt"; if ($eaddr eq "") { return; } if (open(SND,"|/usr/sbin/sendmail $eaddr")) { print SND "$txt"; close(SND); } else { print "$txt\n !! sendmail failed ($!)"; } } # my own POST processor, just so i know exactly how strings will be handled; # also, i get advanced warning if the server is vms-based; sub postit { local $cgipost = ""; local $rg = ""; local $ht = ""; local $k = ""; local $v = ""; local $n = 0; local @ht = (); local @kv = (); if (defined $ENV{'QUERY_STRING'}) { $rg .= $ENV{'QUERY_STRING'}; } if (open(CGIPOST,"