Location: PHPKode > projects > Dominant Creature RPG > login.php
<?

session_start();

include "database.php";

if (isset($_POST['prijava'])) {



	$u = mysql_real_escape_string($_POST['user']);

	$p = mysql_real_escape_string(md5($_POST['pass']));

		

		$q = mysql_query ("SELECT id,user,pass FROM users WHERE user='$u' AND pass='$p' LIMIT 1");

		

		$d = mysql_fetch_assoc($q);

		

	if (mysql_num_rows($q) > 0) {

	

			$_SESSION['logged'] = 'true';

			$_SESSION['user'] = $u;

			$_SESSION['id'] = $d[id];

			

			header("Location: index.php?p=home");

	

	} else {

	header("Location: login.php");

	}





} else {



?>

<HTML>

<HEAD>

<TITLE>Dominant Evil</TITLE>

<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">

<SCRIPT SRC="class/boxover.js"></SCRIPT>

<style>

body {

background: #1E1E1E url(images/index_01.jpg) top repeat-x;

color: #fff;

font-size: 11px;

font-family: Verdana;

}



td {

color: #fff;

font-size: 11px;

font-family: Verdana;

}



#foot {

color: #fff;

font-size: 11px;

font-family: Verdana;

width: 808px;

height: 24px;

background: #1E1E1E url(images/footbg.jpg) top center repeat-x;

}



a, a:visited {

color: #D9C5C5;

font-weight: bold;

text-decoration: none;

}



a:hover, a:active {

color: #fff;

font-weight: bold;

text-decoration: none;

}



#head {

background: #1E1E1E url(images/index_02.jpg) no-repeat;

width: 808px;

height: 154px;

font-size: 11px;

font-family: Verdana;

}



#menu {

background: #1E1E1E url(images/index_04.jpg) no-repeat;

width: 808px;

height: 30px;

font-size: 11px;

font-family: Verdana;

padding-top: 6px;

padding-left: 16px;

}



#body {

background: #1E1E1E url(images/index_05.jpg) repeat-y;

width: 580px;

height: 500px;

font-size: 11px;

font-family: Verdana;

padding-top: 10px;

padding-left: 20px;

}



#body-right {

background: #1E1E1E url(images/index_06.jpg) repeat-y;

width: 208px;

height: 500px;

font-size: 11px;

font-family: Verdana;

}



input, select {

font-size: 11px;

}



</style>



</HEAD>

<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>

<!-- ImageReady Slices (psd.psd) -->

<TABLE align=center width='808' BORDER=0 CELLPADDING=0 CELLSPACING=0>

	<TR>

		<TD colspan='2' valign='top' id='head'>

		</TD>

	</TR>

	<TR>

		<TD colspan='2' valign='top' id='menu'>

<a href='index.php'>Homepage</a> | <a href='register.php'>Join the game</a> | <a href='resend.php'>Lost pass?</a>

		</TD>

	</TR>

	<TR>

		<TD valign='top' align='left' id='body'>

</div>

		</TD>

		<TD valign='top' align='left' id='body-right'>

<div align='right' style="margin-top: 30px;">



<form action="login.php" method="post">

<table width='150'>

<tr>

<td align='center'><b>LOGIN</b>

<br /></td>

</tr>

<tr>

<td align='center'><input type="text" name="user"></td>

</tr><tr>

<td align='center'><input type="password" name="pass"></td>

</tr><tr>

<td align='center'><input type="submit" name="prijava" value="Login"></td>

</tr>

<tr><td align='center'><br />Don't you have an account yet?<br /><a href='register.php'>Register here</a></td></tr>

</table>

</form>

		<br />

		</td>

	</TR>

	<tr>

	<td colspan='2' align='right' id='foot'>copyright by Nosf // 2008 | core engine by <a href='http://www.bbgdev.com/' target='_blank'>Dominant Creature</a></td>

	</tr>

</TABLE>

<!-- End ImageReady Slices -->

</BODY>

</HTML>

<?

}

?>
Return current item: Dominant Creature RPG