Location: PHPKode > scripts > PHPhotoalbum > phphotoalbum/login.php
<?
/*************************************************
 * PHPhotoalbum v0.5
 * by: Henning Støverud
 * e-mail: hide@address.com
 * URL: http://www.stoverud.com/PHPhotoalbum/
 *************************************************/

session_start(); 

include("config.inc.php");
include("auth.inc.php");




// Try login if U & P provided
if($_POST[submitted] && $_POST[username] && $_POST[password])
{
  $login = login($_POST[username], $_POST[password]);
  if($login == true)
  {
    $_SESSION['logged_in'] = $login;
	header("Location: admin.php"); // Sends user to admin.php if login = true
  }
}	

include("functions.php");
pageheader("Login"); ?>
<? navmenu(450); ?>


<!-- 1px BORDER -->
<table width="450" align="center">
 <td bgcolor="#000000">
<!-- 1px BORDER -->

<!-- MAIN TABLE -->
	<table bgcolor="#ffe7c6" width="448">
	  <tr>
		<td>
<!-- MAIN TABLE SECTION -->

<? if($_POST[submitted] && $_SESSION['logged_in'])
	 echo "You are now logged in.";
   else if($_SESSION['logged_in'])
     echo "You are already logged in..";
   else { ?>

		<table width="100" align="center" bgcolor="<? echo $config['color_main']; ?>">
		  <tr>
		  	<td colspan="2" bgcolor="<? echo $config['color_comment_heading']; ?>">
			<b>Login &gt;&gt;</b>
			</td>
		  </tr>
		<? if($_POST[submitted]){ ?>
		  <tr>
		  	<td colspan="2">
			<font size="1" color="red">** Couldn't log in. Try again..</font>
			</td>
		  </tr>
		<? } ?>
		  <tr>
		    <form action="login.php" method="post">
			<td>Username</td><td><input type="text" name="username"></td>
		  </tr>
		  <tr>
		  	<td>Password</td><td><input type="password" name="password"></td>
		  </tr>
		  <tr>
		    <td></td><td align="right"><input name="submitted" type="submit" value="Login"></td>
		  </tr>
		</table>
<?   } // End else?>

<!-- /MAIN TABLE SECTION -->
		</td>
      </tr>
	</table>
<!-- /MAIN TABLE SECTION -->


<!-- /1px BORDER -->
 </td>
</table>
<!-- /1px BORDER -->

<? pagefooter(450); ?>

Return current item: PHPhotoalbum