Hi, I'm getting an odd error with my script, here's the error:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Could not open dir portals: No such file or directory at e:\0\74\38\237038\user\240783\htdocs\mywebs\ETbyrne\portal\regester.pl line 25.
Ok, the dir "portals" does exist, here's my script:
_______________________________________
You don't know me.
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Could not open dir portals: No such file or directory at e:\0\74\38\237038\user\240783\htdocs\mywebs\ETbyrne\portal\regester.pl line 25.
Ok, the dir "portals" does exist, here's my script:
Code:
#!/usr/bin/perl
use warnings;
use CGI qw(:standard);
use Fcntl qw(:flock :seek);
use strict;
my $author = param('author') or die "You have to enter a Nick Name.";
my $password = param('password') or die "You have to enter a Password.";
my $email = param('email') or die "You have to enter your e-mail.";
open(FILE, ">>./mywebs/ETbyrne/portal/authorlist.txt") or die "Can't open authorlist.txt: $!";
seek(FILE,0,0);
my @file = <FILE>;
chomp(my $key = $author);
foreach my $el (@file)
{
chomp($el);
if ($key eq $el)
{
print "That username allready exist, click back and try a different one\n";
exit;
}
}
chdir "portals" or die "Could not open dir portals: $!";
mkdir $author, 0777;
chdir "$author" or die "Could not open dir portals\/$author";
open(FH, ">>./mywebs/ETbyrne/portal/authorlist.txt") or die "Error opening author list";
flock(FH,LOCK_EX);
seek(FH,0,2);
print FH "$author\n";
close FH;
open(FILE, ">>./mywebs/ETbyrne/portal/$author/password.txt") or die "Error makeing password";
print FILE "$password\n";
close FILE;
open(FILE,">>./mywebs/ETbyrne/portal/$author/email.txt") or die "Could not write email file: $!";
print FILE "$email\n";
close FILE;
print "Content-type: text/html\n\n";
print "<html><head><title>Portal Manager</title></head>\n";
print "<body bgcolor=\"silver\">\n";
print "<h2>Welcome, $author !</h2>\n";
print "<hr>\n";
print "You have completed regestration!<br>\n";
print "<input type=\"hidden\" name=\"password\" value=\"$password\"><input type=\"hidden\" name=\"author\" value=\"$author\">\n";
print "</body></html>\n";
_______________________________________
You don't know me.