<html>
	<head>
		<link rel="stylesheet" type="text/css" href="Style.css" />
		<style>
		div.img
		{
			margin: 2px;
			height: auto;
			width: auto;
			position: top center;
			text-align: center;
		}
		</style>
	</head>
	<body>
<a href="index.php"><center><img src="images/logo.png" width="500" height="200" align="center" /></center></a>
<center>
		<?php

		function Reg()
		{
			if (isset($_POST['reg'])==true) {
                     require_once('config.php'); 
				$user = $_POST['username'];
				$pass = sha1(strtoupper($user.':'.$_POST['password'])); 
				$email = $_POST['email'];

				$con = mysql_connect($dbhost, $dbuser, $dbpassword);

				if (!$con) 
 				{ 
     				die('Could not connect!'); 
  				} else {
  					mysql_select_db("$logondb", $con); 

					$sql="INSERT INTO account (username, sha_pass_hash, email) VALUES ('$user','$pass','$email')"; 

					if (!mysql_query($sql,$con)) 
					{ 
     					die('There was an error creating your account.'); 
  					} 

					echo $succesmsg; 

					mysql_close($con);

  				} 


			} else {
?>
<form method="POST">
<center>Username:<br/> <input type="text" name="username" placeholder="Username" /><br/>
Password:<br/> <input type="password" name="password" placeholder="******" /><br/>
Email:<br/> <input type="EMAIL" name="email" placeholder="example@example.com"/><br/>
<input type="submit" value="Register!" name="reg"/></center>
</form>
<?php


			}
            }

Reg();

?>
</center>
</body>
</html>