Hi, I'm getting a pretty un-helpfull error from my a registration script I made. Here's the error:
Here's the script:
Thanks for all help! ^_^
_______________________________________
You don't know me.
Code:
CGI Error
The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are:
Error
1
Here's the script:
Code:
#!/usr/bin/perl -w
use strict;
use CGI qw(:standard);
use Fcntl qw(:flock :seek);
my $name = param('name') or &error('You have to enter a nickname!');
my $password = param('password') or &error('You have to enter a password!');
my $path = "./mywebs/ETbyrne/rerss/users";
my $shortpath = "./mywebs/ETbyrne/rerss/setup";
open(USER,"<$path/users.pl") or die "could not open users.txt: $!"; #pl extention for security reasons.
my @user_file = <USER>;
close(USER);
foreach my $i (@user_file)
{
my ($username,$pass) = split(/\|/,$i);
if($i eq $username)
{
&dienice;
}
}
#+------------------+#
#| Setup Info Files |#
#+------------------+#
# Directory #
mkdir "$users/$name", 0777;
# Password FILE #
open(PASSFILE,">$path/$name/password.pl") or die "Could not create password file: $!";
print PASSFILE "$password\n";
close(PASSFILE);
# Feeds File #
open(FEEDS,"<$shortpath/feeds.txt") or die "Could not create password file: $!";
my @setup_feeds = <FEEDS>;
close(FEEDS);
open(FEEDS,">$path/$name/feeds.txt") or die "Could not create password file: $!";
print FEEDS "@setup_feeds\n";
close(FEEDS);
# List File #
open(LIST,">$path/$name/list.txt") or die "Could not create list file: $!";
close(LIST);
#+----------------------------------+#
#| Setup perl Files and shtml Files |#
#+----------------------------------+#
# index.pl #
open(INDEX,"<$shortpath/index.pl") or die "Could not create index file: $!";
my @setup_index = <INDEX>;
close(INDEX);
open(INDEX,">$path/$name/index.pl") or die "Could not create index file: $!";
print INDEX "@setup_index\n";
close(INDEX);
# add_feed.shtml #
open(ADD,"<$shortpath/add_feed.shtml") or die "Could not create add_feed file: $!";
my @setup_add = <ADD>;
close(ADD);
open(ADD,">$path/$name/add_feed.shtml") or die "Could not create add_feed file: $!";
print ADD "@setup_add\n";
print ADD "<input type=\"hidden\" name=\"author\" value=\"$name\"><\/form><\/body><\/html>\n";
close(ADD);
# delete_feed.shtml #
open(DEL,"<$shortpath/delete_feed.shtml") or die "Could not create delete_feed file: $!";
my @setup_del = <DEL>;
close(DEL);
open(DEL,">$path/$name/delete_feed.shtml") or die "Could not create delete_feed file: $!";
print DEL "@setup_del\n";
print DEL "<input type=\"hidden\" name=\"author\" value=\"$name\"><\/form><\/body><\/html>\n";
close(DEL);
# top.shtml #
open(TOP,"<$shortpath/top.shtml") or die "Could not create top file: $!";
my @setup_top_one = <TOP>;
close(TOP);
open(TOP,">$path/$name/top.shtml") or die "Could not create top file: $!";
print TOP "@setup_top_one\n";
print TOP "<input type=\"hidden\" name=\"author\" value=\"$name\"><\/form><\/body><\/html>\n";
close(TOP);
# top2.shtml #
open(TOP,"<$shortpath/top2.shtml") or die "Could not create top2 file: $!";
my @setup_top_two = <TOP>;
close(TOP);
open(TOP,">$path/$name/top2.shtml") or die "Could not create top2 file: $!";
print TOP "@setup_top_two\n";
print TOP "<input type=\"hidden\" name=\"author\" value=\"$name\"><\/form><\/body><\/html>\n";
close(TOP);
#+--------------+#
#| End of Setup |#
#+--------------+#
print "Location: [URL unfurl="true"]http://www.mywebsfree.com/ETbyrne/rerss/login.shtml\n\n";[/URL]
#+-------------+#
#| Subroutines |#
#+-------------+#
sub dienice{
print "<html><head><link rel=\"stylesheet\" href=\"[URL unfurl="true"]http://www.mywebsfree.com/ETbyrne/rerss/my.css\"[/URL] type=\"text/css\"><\/head><body>\n";
print "<h2>Error<\/h2>\n";
print "That username is already in use. Go back and try another.<\/body><\/html>\n";
exit;
}
sub error{
my $msg = @_;
print "<html><head><link rel=\"stylesheet\" href=\"[URL unfurl="true"]http://www.mywebsfree.com/ETbyrne/rerss/my.css\"[/URL] type=\"text/css\"><\/head><body>\n";
print "<h2>Error<\/h2>\n";
print "$msg <\/body><\/html>\n";
exit;
}
Thanks for all help! ^_^
_______________________________________
You don't know me.