Problem mit Parameterübergabe und Formular

Friesi

Erfahrenes Mitglied
Ich habe Problem mit einem Perlscript.
Sobald ich dieses Ausführe komme ich zur Loginseite "Page = 1"
Doch sobald ich auf den "submit" Button klicke, wird zwar die "Page = 2" aufgerufen aber nix ausgegeben. Wenn ich aber Page = 2 direkt aufrufe gehts.

Woran könnte das Liegen?

Script URL:
http://test.friesi.net/cgi-bin/gac.pl?page=1
http://test.friesi.net/cgi-bin/gac.pl?page=2 (direkter Aufruf geht)


Code:
#!/usr/bin/perl
use strict;
use CGI qw(:standard);

my $Page = param('page');
if (!defined($Page)) { $Page = 1; }
print "Content-type: text/html\n\n";

print qq~
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Gameserver Administrations Center (GAC) || code by friesi.net</title>
<style type="text/css">
<!--
body {
        background-color: #253546;
}
.Stil7 {font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-weight: bold; color: #FFFFFF; }
-->
</style></head>

<body>
~;

if ($Page eq 1)
{
print qq~
 <div align="center">
  <p>&nbsp;</p>
  <table width="25%" border="0" align="center">
    <tr>
      <td><form name="form1" method="post" action="gac.pl?page=2">
        <table width="42%"  border="0">
          <tr>
            <td width="17%"><span class="Stil7">Benutzername: </span></td>
            <td width="83%"><input type="text" name="username"></td>
          </tr>
          <tr>
            <td><span class="Stil7">Passwort: </span></td>
            <td><input type="password" name="password"></td>
          </tr>
        </table>
        <p align="center"><input type="submit" name="Submit" value="Senden">
          </p>
        </form></td>
    </tr>
  </table>
  <p>&nbsp;</p>
</div>
~;
}

if ($Page eq 2)
{
 my $pw = lc (param ('password'));
 if ($pw eq '123')
 {
  print ("<span class=\"Stil7\">Access allow...</span>");
 }
 else
 {
  print ("<span class=\"Stil7\">Access denied!</span>");
 }
}

print ("</body></html>");
 
statt:
Code:
      <td><form name="form1" method="post" action="gac.pl?page=2">
        <table width="42%"  border="0">
          <tr>
            <td width="17%"><span class="Stil7">Benutzername: </span></td>
            <td width="83%"><input type="text" name="username"></td>
          </tr>
          <tr>
            <td><span class="Stil7">Passwort: </span></td>
            <td><input type="password" name="password"></td>
          </tr>
        </table>
        <p align="center"><input type="submit" name="Submit" value="Senden">
          </p>
        </form></td>

das hier verwenden:
Code:
      <td><form name="form1" method="post" action="gac.pl">
        <table width="42%"  border="0">
          <tr>
            <td width="17%"><span class="Stil7">Benutzername: </span></td>
            <td width="83%"><input type="text" name="username"></td>
          </tr>
          <tr>
            <td><span class="Stil7">Passwort: </span></td>
            <td><input type="password" name="password"></td>
          </tr>
        </table>
        <p align="center"><input type="submit" name="Submit" value="Senden">
          <input type="hidden" name="page" value="2">
          </p>
        </form></td>
 
Zurück