#!/usr/bin/perl $freelocation = "http://cavalcade-whimsey.com/addlinks.html"; $freepath = "/usr/home/shpank/public_html/addlinks.html"; $cgilocation = "http://cavalcade-whimsey.com/shpank/free.pl"; # DO NOT EDIT BELOW THIS LINE!!!! ##################################################################### # Receive Info From Free Link read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Process Info From Free Link @pairs = split(/&/, $buffer); foreach $pair (@pairs) { ($name, $value) = split(/=/, $pair); $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s///g; $value =~ s/<([^>]|\n)*>//g; $FORM{$name} = $value;} # Give Error Messages &no_url unless $FORM{'url'}; &no_title unless $FORM{'title'}; # Set Up Free Link Page open (FILE, "$freepath"); @LINES=; close(FILE); $SIZE=@LINES; # Write To Free Link Page open (FREE,">$freepath"); for ($i=0;$i<=$SIZE;$i++) { $_=$LINES[$i]; if (//) { print FREE "\n"; print FREE "$FORM{'title'} - $FORM{'description'}
\n"; } else { print FREE $_; } } close (FREE); &follow; # Error Pages sub no_url { print "Content-type: text/html\n\n"; print "No URL\n"; print "

URL appears to be blank

\n"; print "You didn't add your URL so your entry to the Free Link Page was not added.\n"; print "Please add your url below.
\n"; print "
\n"; print "Page URL: \n"; print "

\n"; print "

\n"; print "
\n"; print " \n"; exit; } sub no_title { print "Content-type: text/html\n\n"; print "No Title\n"; print "

Title appears to be blank

\n"; print "You didn't add your Title so your entry to the Free Link Page was not added.\n"; print "Please add your url below.
\n"; print "\n"; print "Page Title: \n"; print "

\n"; print "

\n"; print "
\n"; print "\n"; exit; } sub follow { print "Content-type: text/html\n\n"; print "Thank You\n"; print "

Thank You For Adding a Link

\n"; print "Here's what you added:

\n"; print "Page URL: $FORM{'url'}
\n"; print "Page Title: $FORM{'title'}
\n"; print "I really appreciate you adding your URL.
\n"; print "Click here to go back to The Free Links Page.
\n "; print "If you do not see your entry, hit RELOAD
\n"; print "\n"; } exit;