Hello all, I wrote this script so it will check a users username and password before posting to a forum. Can anyone go through it and find errors or what not? Please =)
thanks alot!
#!/usr/bin/perl
&get_form_input;
$message = $FORM{'message'};
$username = $FORM{'username'};
$password = $FORM{'password'};
#############################
#
# This Forum copyright Scott Hedstrom
# No unauthorized Use.
#
#############################
#
# Start of Development: June 15, 2000
# End of Development: TBA
#
#Define These Variables
$forumname="foamFORUM";
#The name of the forum here
$outputfile="foruminput.txt";
#This file is where the script will write to. Use it for an SSI
$sendsite="http://foam.ms/forum/index.shtml";
#The location you want them to be sent after message submition.
# End of Variable Info
#Opens the Output file for input.
open(outfile, ">$outputfile") | | die;
# End of File copying
#Start of file writting.
&check_password
close(outfile); #Closes the file.
# Creates the webpage
print "Content-type: text/html\n\n";
print "<HTML><HEAD><TITLE>$forumname</TITLE></HEAD>
<BODY>Message Submitted by $username :\n $message</BODY></HTML>";
sub get_form_input
{
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@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/<([^>]