Location: PHPKode > projects > phpWebEd > phpwebed/phpwebed/index.php
<?
include "config.inc.php";
include "$phpWebEd_language.inc.php";

if ($submit == "Login") {
	if ($name == $phpWebEd_username && $pass == $phpWebEd_userpass) {
		setcookie("auth", md5($name.$pass), 0, "/");
		if ($ed_type == "ax") setcookie("edtype", "ax", time() + 2592000, "/");
		else setcookie("edtype", "", time() - 100000 , "/");
		if (eregi("Apache", $HTTP_SERVER_VARS["SERVER_SOFTWARE"])) header("Location: index.php?check_cookie=1");
		else echo "<meta http-equiv=\"refresh\" content=\"0;URL=index.php?check_cookie=1\">";
		error_log (date("Y-m-d H:i") . "\t$name\t" . gethostbyaddr($REMOTE_ADDR) . "\r\n", 3, "logins.txt");
		exit();
	}
	else $errstr = $login_fail_str;
}

if ($check_cookie == 1) {
	if ($auth != "") {
		header("Location: $homepage_url");
		exit();
	}
	else $errstr = $cookie_warn_str; 
}
?>
<html>
<head>
<title>Login - phpWebEd v.<? echo $phpWebEd_version;?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
body { margin-left:0px; margin-right:0px; margin-top:0px; margin-bottom:0px }
</style>
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="100%">
  <tr align="center" bgcolor="#DDDDDD"> 
    <td height="30"><font face="Verdana, Arial, Helvetica, sans-serif" size="+1"> 
      <? echo $login_head_str;?>
      </font></td>
  </tr>
  <tr align="center"> 
    <td valign="middle"> 
      <form method="post" action="<? echo $PHP_SELF;?>">
        <table border="0" cellspacing="0" cellpadding="2" bgcolor="#CCCCCC">
          <tr> 
            <td> 
              <table border="0" cellspacing="0" cellpadding="10" bgcolor="#FFFFFF">
                <tr align="center"> 
                  <td colspan="2"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font size="3">Login</font></b></font></td>
                </tr><? if (isset($errstr)) echo "<tr align=\"center\"><td colspan=\"2\">
                   <font face=\"Verdana, Arial, Helvetica, sans-serif\" size=\"2\"><b>$errstr</b></font></td></tr>";?>
                <tr> 
                  <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 
                    <b><? echo $login_user_str;?></b>
                    </font></td>
                  <td><input type="text" name="name"></td>
                </tr>
                <tr> 
                  <td align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2"> 
                    <b><? echo $login_pass_str;?></b>
                    </font></td>
                  <td><input type="password" name="pass"></td>
                </tr>
                <tr align="center"> 
                  <td valign="top" nowrap><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Editor 
                    Type</b></font></td>
                  <td> 
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr valign="top"> 
                        <td><input type="radio" name="ed_type" <? if ($edtype != "ax") echo "checked";?>></td>
                        <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Javascript</font></td>
                      </tr>
                      <tr valign="top"> 
                        <td><input type="radio" name="ed_type" value="ax"<? if ($edtype == "ax") echo "checked";?>></td>
                        <td><font size="2" face="Verdana, Arial, Helvetica, sans-serif">ActiveX<br>
                          <font size="1">(requires <a href="http://www.m-tecs.net/axwebed/" target="_blank">axWebEd</a>)</font></font></td>
                      </tr>
                    </table>
                  </td>
                </tr>
                <tr align="center"> 
                  <td colspan="2"><input type="submit" name="submit" value="Login"></td>
                </tr>
              </table>
            </td>
          </tr>
        </table>
      </form>
    </td>
  </tr>
  <tr bgcolor="#DDDDDD" align="center"> 
    <td height="20"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">phpWebEd 
      <? echo "$phpWebEd_version";?>
      - Copyright &copy; 2001-2002 Holger Mauermann - <a href="http://www.m-tecs.net/">www.m-tecs.net</a></font> 
    </td>
  </tr>
</table>
</body>
</html>
Return current item: phpWebEd