I use #!/usr/bin/perl $database = "/home/virtual/site6/fst/var/www/html/win/database.txt"; # Get the input read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); # Split the name-value pairs @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; $FORM{$name} = $value; } if ($database ne '') { open (DATABASE,">>$database"); print DATABASE "$FORM{'E-Mail'}-$FORM{'guess'}\n"; close(DATABASE); } if ($FORM{'url'} eq 'mailto:' || $FORM{'url'} !~ /^(f|ht)tp:\/\/\w+\.\w+/) { &no_email; } sub no_email { print "Content-type: text/html\n\n"; print <<EOM; <title>Thanks for entering the contest.</title> <BODY bgcolor="ffffff" TEXT="000000" link="red" vlink="blue"> <H1>Thanks for entering the contest!!</H1></center> PAGE THAT SHOWS UP AFTER ENTERING!!! EOM } Code (perl): $database is where the text file is. print DATABASE "$FORM{'E-Mail'}-$FORM{'guess'}\n"; is what shows up in the text file. At the end you enter the HTML that shows up. <FORM METHOD=POST ACTION="http://www.public-domain-content.com/cgi-bin/contest.cgi">Your E-Mail address: <INPUT TYPE="TEXT" NAME="E-Mail" SIZE=60,1 MAXLENGTH=60><BR> <p> <input type=radio name="guess" value="Game Cube">Game Cube <input type=radio name="guess" value="Game Boy Advance">Game Boy Advance <input type=radio name="guess" value="Nintendo 64">Nintendo 64 <input type=radio name="guess" value="Nintendo DS">Nintendo DS <P> <INPUT TYPE="SUBMIT" VALUE="Enter the contest"></FORM> Code (markup): for an example of the form.
ive changed the look & way www.pocketfund.com works and looking for more reviews if possible. i have also added a forum where the contest will now take place.