Location: PHPKode > projects > MyMail Webmail > index.php
<?

/* MyMail Webmail 3.0
   Author: Brian Clark <hide@address.com>
   License: GPL

*/

#Show login box
if (!$submit)
{
?>
<? include('global.php'); ?>
<html>
<head>
<title>MyMail :: Login</title>
<script type="text/javascript" language="JavaScript1.2" src="stm31.js"></script>
<style type="text/css">
<!--
.dir A:link {color: #142E56; text-decoration: underline;}
.dir A:visited {color: #142E56; text-decoration: underline;}
.dir A:active {color: #142E56; text-decoration: underline;}
.dir A:hover {background-color: #CCCCCC; text-decoration: underline;}

.top A:link {color: #FFFFFF; text-decoration: none;}
.top A:visited {color: #FFFFFF; text-decoration: none;}
.top A:active {color: #FFFFFF; text-decoration: none;}
.top A:hover {color: #FFD400; text-decoration: underline;}
-->
</style>
</head>
<body bgcolor=#FFFFFF text=#000000 link=#142E56 alink=#142E56 vlink=#142E56 marginwidth=0 marginheight=0 leftmargin=0 rightmargin=0 bottommargin=0 topmargin=0">
<table width=100% cellpadding=0 cellspacing=0 border=0>
  <tr width=100% height=124>
    <td width=100% height=124 background="./bg_top.gif">
      <table width=100% height=124 border=0 cellpadding=0 cellspacing=0>
        <tr width=100% height=124>
          <td width=99% height=124 valign=top align=left background="">
            <!-- left segment -->
            <table width=100% height=124 border=0 cellpadding=0 cellspacing=0>
              <tr width=100% height=66>
                <td width=100% height=66 valign=middle align=left>
                  <table border=0 height=66 cellpadding=0 cellspacing=0  width=100%>
                    <tr>
                      <td valign=middle height=66><br>
                      <nobr></nobr></td>
                      <td valign=middle height=66><br>
                      </td>
                      <td valign=middle height=66 width=100% align=center></td>
                    </tr>
                  </table>
                </td>
              </tr>
              <tr width=100% height=21>
                <td width=100% height=21 valign=middle align=right>&nbsp;</td>
              </tr>
              <tr width=100% height=17>
                <td width=100% height=17 valign=middle align=right background=""> <font face="Verdana,arial,helvetica,sans-serif" size=2> <font face="arial, helvetica" size=1 color=white>
                  <center>
                <strong>Please Log-In</strong>                                      </center>
                </font></td>
              </tr>
              <tr width=100% height=20>
                <td width=100% height=20 valign=middle align=left background="">&nbsp;</td>
              </tr>
            </table>
          </td>
          <!-- right segment -->
          <td width=1% valign=top align=right height=124>&nbsp;</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr width=100% height=100%>
    <td width=100% height=100% background="">
      <table width="974" border=0 cellpadding=0 cellspacing=0>
        <tr width=150>
          <td valign=top align=center>
            <table width=95% height="320" border=0 cellpadding=15 cellspacing=0>
              <tr width=100%>
                <td width=100% valign=top align=left class="dir"><p align="center"><form name="login" method="POST" action="<? echo $PHP_SELF; ?>">
                  <table width="358" border="0" align="center" cellpadding="5" cellspacing="5" valign="middle">
<tr>
<td align="right"><font size="-1" face="Verdana">Username</font></td>
<td align="left"><input type=text name=email size=26></td>
</tr>
<tr>
<td align="right"><font face="Verdana" size="-1">Password</font></td>
<td align="left"><input type=password name=pass size=26></td>
</tr>
<td colspan="2" align="middle"><div align="center">
  <input name="submit" type="submit" value="Login">
</div></td>
</tr>
</table>
                </form></p>
                <p align="center">&nbsp;</p>
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <td align=center> <font color=#666666 face="arial, helvetica, sans-serif" size=1>&copy; 2003
              Resiware, Inc.</font> <font color="#666666" size="1" face="Geneva, Arial, Helvetica, sans-serif">MyMail Version 3.0</font></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<?
}
else
{
	// form submitted
	
	include("global.php");
	
	if (!$email || !$pass || !validate_email($email))	
	{
	header("Location: error.php?ec=1");
	exit;
	}
		
	// separate email address into username and hostname
	// by splitting on @ symbol
	$arr = explode('@', $email);
	$user = trim(stripslashes($arr[0]));
	$host = trim(stripslashes($arr[1]));
	$pass = trim(stripslashes($pass));
	
	// store the details in session variables
	session_start();
	session_register("SESSION");
	session_register("SESSION_USER_NAME");
	session_register("SESSION_USER_PASS");
	session_register("SESSION_MAIL_HOST");
	
	// assign values to the session variables
	$SESSION_USER_NAME = $user;
	$SESSION_USER_PASS = $pass;
	$SESSION_MAIL_HOST = $host;
	
	// redirect user to the list page
	header("Location: list.php");
	}
?>
Return current item: MyMail Webmail