hey.
similar post to my one below (same error neway).
But I managed to get that script to work.
However I have no-idea what's wrong with this scipt?:
-----------------------------------------------------
#!c:\perl\bin\perl
use CGI qwstandard);
$object = new CGI;
$username = $object -> param('user');
$password = $object -> param('pword');
chomp($username);
open (USERS, "< c:/users.dat" || die;
@users = <USERS>;
close(USERS);
$size = $#users;
if ($username gt $users[$#users]) {
open (USERS, ">> C:/users.dat" || die;
print USERS $username, "#", $#users + 1, "\n";
close(USERS);
}
else {
$x = 0;
until ($username le $users[$x]) {
$x++;
}
@half = (splice(@users, $x));
$username .= "#"; $username .= $size + 1; $username .= "\n";
push (@users, $username);
push (@users, @half);
open (USERS, "> c:/users.dat" || die;
print USERS @users;
close(USERS);
}
$val = int(rand(59));
chomp($password);
$len = (length($password));
$z = 0;
open (PASS, ">> c:/passwords.dat" || die;
until ($z == $len) {
$letter = substr($password, $z, 1);
$letter2 = $val * (ord($letter));
$z++;
print PASS $letter2, "#";
}
print PASS $val, "\n";
close(PASS);
print header;
print "
<html>
<body>
<center>
<font size = 20>username is $username <br> password is $pword"</font>
</center>
</body>
</html>
";
---------------------------------------------
im not too familiar with the protocol differences between cgi and perl, but I have the "print header" before any HTML etc... Is it maybe the opening of the files? or the CGIobject?
any and all suggestions are welcome!!
thankyou all!
JoE
we are all of us living in the gutter.
But some of us are looking at the stars.
similar post to my one below (same error neway).
But I managed to get that script to work.
However I have no-idea what's wrong with this scipt?:
-----------------------------------------------------
#!c:\perl\bin\perl
use CGI qwstandard);
$object = new CGI;
$username = $object -> param('user');
$password = $object -> param('pword');
chomp($username);
open (USERS, "< c:/users.dat" || die;
@users = <USERS>;
close(USERS);
$size = $#users;
if ($username gt $users[$#users]) {
open (USERS, ">> C:/users.dat" || die;
print USERS $username, "#", $#users + 1, "\n";
close(USERS);
}
else {
$x = 0;
until ($username le $users[$x]) {
$x++;
}
@half = (splice(@users, $x));
$username .= "#"; $username .= $size + 1; $username .= "\n";
push (@users, $username);
push (@users, @half);
open (USERS, "> c:/users.dat" || die;
print USERS @users;
close(USERS);
}
$val = int(rand(59));
chomp($password);
$len = (length($password));
$z = 0;
open (PASS, ">> c:/passwords.dat" || die;
until ($z == $len) {
$letter = substr($password, $z, 1);
$letter2 = $val * (ord($letter));
$z++;
print PASS $letter2, "#";
}
print PASS $val, "\n";
close(PASS);
print header;
print "
<html>
<body>
<center>
<font size = 20>username is $username <br> password is $pword"</font>
</center>
</body>
</html>
";
---------------------------------------------
im not too familiar with the protocol differences between cgi and perl, but I have the "print header" before any HTML etc... Is it maybe the opening of the files? or the CGIobject?
any and all suggestions are welcome!!
thankyou all!
JoE
we are all of us living in the gutter.
But some of us are looking at the stars.