Expand|Select|Wrap|Line Numbers
- #!c:/perl/bin/perl.exe
- $basedir="c:/program files/apache software foundation/apache2.2/cgi-bin";
- $datafile="regstr.txt";
- $name=$in{'login'};
- $passwd=$in{'passwd'};
- open(FH1,"+>>regstr.txt");
- @input=<FH1>;
- print(@input);
- @input=($login,$password);
- close(FH1);
- print "Content-type: text/plain; charset=iso-8859-1\n\n";
- {
- chop();
- if($arr[1] eq $login)
- {
- if($arr[3] eq $password)
- {
- print "<HTML>";
- print "<HEAD>";
- print "<SCRIPT>";
- print "function back(form){history.back();}";
- print "</SCRIPT>";
- print "</HEAD>";
- print "<BODY text=green>";
- print "<BR><BR><BR>";
- print "<CENTER><H1>Thanks your registeration is saved".$name."</H1><FORM><BR>";
- print "<FORM>";
- print "<BR><A HREF='http://10.199.44.116/cgi-bin/latest.html'></A><BR><BR>";
- print "</FORM>";
- print "</BODY>";
- print "</HTML>";
- flag=1;
- }
- }
- }
- if($flag=!1)
- {
- print "<HTML>";
- print "<HEAD>";
- print "<SCRIPT>";
- print "<function home(form){history.back()}";
- print "</SCRIPT>";
- print "</HEAD>";
- print "<BODY text=green>";
- print "<BR><BR><BR>";
- print "<H1><CENTER>Sorry your login and password does not exist.</H1><BR>";
- print "</FORM>";
- print "</BODY>";
- print "</HTML>";
- }
[HTML]<HTML>
<HEAD>
<TITLE>Welcome to the website login page</TITLE>
<SCRIPT Language = "JavaScript">
function verify(form)
{
for(i = 0; i <= 3; i++)
{
if(document.forms[0].elements[i].value == "")
{
alert("Please Fill In Your " + document.forms[0].elements[i].name);
document.forms[0].elements[i].focus( );
return(false);
}
}
document.forms[0].submit();
}
</SCRIPT>
</HEAD>
<CENTER>
<TABLE Border = "4">
</TABLE>
<BR><BR><BR>
<FORM ACTION= "http://10.199.44.116/cgi-bin/login.pl" METHOD="POST">
<TABLE align=center border=5 cellPadding=5 cellSpacing=5 Size="800">
<TR>
<TD Colspan = "1" Width="40%">
<FONT Id = spl Color="Green" Size= "5">
<B>Login :</B>
</FONT>
</TD>
<TD>
<INPUT Name = "login" Size="35" Type = "Text">
</TD>
</TR>
<TR>
<TD Colspan = "1" Width="40%">
<FONT Id = spl Color="Green" Size="5">
<B>Password :</B>
</FONT>
</TD>
<TD>
<INPUT Name = "passwd" Size = "35" Type = "Password">
</TD>
</TR>
<TR>
<TD Colspan = "1" Width="40%">
<FONT Id = spl Color = "Green" Size= "5">
<B>Confirm Password :</B>
</FONT>
</TD>
<TD>
<INPUT Name = "confirm passwd" Size = "35" Type = "Password">
</TD>
</TR>
</TABLE>
<BR><BR>
<TABLE Align = "Center" Border = "0" Width = "40%">
<TR>
<TD Align = "Center" Width = "50%">
<INPUT Type = "Button" Value = "SUBMIT" onClick = "verify(this.form)">
</TD>
<TD Align = "Center" Width = "50%">
<INPUT Type = "Reset" Value = "RESET">
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>[/HTML]