Location: PHPKode > projects > GWAAU > login.php
<?php

require_once('lib/main.php');

if (user_isloggedin()) {
        user_logout();
        $user_name='';
}

if ($_REQUEST["submit"]) {
	user_login($_REQUEST["user_name"],$_REQUEST["password"]);
}

if ($feedback) {
	echo '<FONT COLOR="RED"><H2>'.$feedback.'</H2></FONT>';
}

$output="";

$output.= '<H3>Login</H3>
	<P>
	Indtast brugernavn og kodeord for at logge ind.
	<P>
	<FORM ACTION="'. $PHP_SELF .'" METHOD="POST">
	<B>Brugernavn:</B><BR>
	<INPUT TYPE="TEXT" NAME="user_name" VALUE="" SIZE="10" MAXLENGTH="15">
	<P>
	<B>Kodeord:</B><BR>
	<INPUT TYPE="password" NAME="password" VALUE="" SIZE="10" MAXLENGTH="15">
	<P>
	<INPUT TYPE="SUBMIT" NAME="submit" VALUE="Login">
	</FORM><hr/><a href="register.php">Opret bruger</a>';

print content_forside($output);

function gettop_forside()
{
	
	return "
			<table cellpadding='0' cellspacing='0' width='100%'>
				<tr>
					<td style='padding-left:10px'><img src='graphics/logo.png' border='0'></a></td>
				</tr>
			</table>
			";
}

//henter header
function getheader_forside($title="GW login")
{
	return "
	<html>
	<head>
	<link rel='stylesheet' href='css/css.css'>
	<title>$title</title>
	</head>
	<body>
	<table cellpadding='0' cellspacing='0' class='maintable'>
		<tr>
			<td class='headerrow' colspan='2'>".gettop_forside()."</td>
		</tr>
		<tr>
			<td class='menurow' colspan='2'>&nbsp;
			</td>
		</tr>
		<tr>
			<td class='submenu'>&nbsp;
			</td>
			<td class='body'>
	
	";
}

function getbottom_forside()
{
	return "</td></tr></table></body></html>";
}

function content_forside($input)
{
	global $feedback;
	$output = getheader_forside();
	if ($feedback) {
		$output .= "<h1>$feedback</h1>";
	}
	$output .=	"
					<table>
					<tr>
						<td class='content'>".$input."</td>					
					</tr>
					</table>
					";

	$output .= getbottom_forside();
	return $output;					
}

?>
Return current item: GWAAU