well here is all the code i have to date , it works fine when i take the image out :confused:=
#!/usr/bin/perl
###########################################
###################################################
use CGI::Carp qw(fatalsToBrowser);
print "Content-type:text/html\n\n";
print "<html><head><title>CBSForums</title></head>\n\n";
print "<body>\n";
print "<p><H1><center>CBSBoard</center></H1><H4><center>Out of chaos , comes a community...</center></H4></p>\n";
$file = 'data.txt' ; # Name the file
open(INFO, "<$file" ) ; # Open the file
@lines = <INFO> ; # Read it into an array
close(INFO) ; # Close the file
print " <BODY>\n" ;
foreach $line (@lines) # assign @lines to $line, one at a time
{ # braces {} are required, bracket code
print "\n <P> $line </P>" ; # print formatted lines to screen
}
##################################################################################
$correctUsername = "*****";
$correctPassword = "*****";
#################
# Form Data Parsing
if ($ENV{'REQUEST_METHOD'} eq 'GET') { $buffer = $ENV{'QUERY_STRING'}; }
else { 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;
$FORM{$name} = $value;
}
################
# Comparison
#Use a nested if/else statement like the one below to make debugging
#much easier
if ($FORM{'username'} eq $correctUsername) {
if($FORM{'password'} eq $correctPassword) { print "You've passed the test!\n"; }
else { print "Password Incorrect.\n"; }
}
else { print "Username Incorrect.\n"; }
######################
<P ALIGN="CENTER"><A HREF="http://www.chaoticrealities.com/cgi-bin/cbsboard/cbsboard.cgi"><IMG SRC="http://www.chaoticrealities.com/cbs.gif" ALIGN="TOP" WIDTH="300" HEIGHT="100"></A></P>