Location: PHPKode > projects > top serious project > bco/login.php
<?php

/***************************************************************************
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 ***************************************************************************/

include("include.php");

if ((isset($_POST)) && ($_POST['submit'] == "login")) {
    if (bco_login($_POST)) {
		header("Location: " . $GLOBALS['base_url'] . urldecode($_POST['refer']));
		exit;
	} else {
		exit("This is bad.");	
	}
}

if ((!isset($_GET['back'])) || ($_GET['back'] == "")) {
	$back = "index.php";
} else {
	$back = urlencode($_GET['back']);
}

bco_html_header("Login - " . BOARD_TITLE);

bco_index_menu("Login");

echo <<< END
\n
<a href="reset_password.php">Forgot your password?</a>
<form method="post" action="$PHP_SELF">
<table width="100%" cellpadding="2" cellspacing="0" class="replytable">
    <tr>
        <td width="100" align="right">username:</td>
        <td align="left"><input type="text" name="username" maxlength="25" size="18" class="textfield" /></td>
    </tr>
    <tr>
        <td width="100" align="right">password:</td>
        <td align="left"><input type="password" name="password" maxlength="25" size="18" class="textfield" /></td>
    </tr>
    <tr>
        <td width="100" align="right">length:</td>
        <td align="left">
        <input type="radio" name="time" value="session" checked="checked" />session
        <input type="radio" name="time" value="day" />day
        <input type="radio" name="time" value="month" />month
        <input type="radio" name="time" value="year" />year
        </td>
    </tr>
    <tr>
        <td width="100" align="right">&nbsp;</td>
        <td align="left"><input type="submit" name="submit" value="login" class="button" /></td>
    </tr>
</table>
<input type="hidden" name="refer" value="$back" />
</form>
END;

bco_html_footer();

?>
Return current item: top serious project