<?php
//login interface
// verbinding
$conn = mysql_connect("localhost", "root", "Your pass")
or die(mysql_error());
mysql_select_db("coproj",$conn)
or die(mysql_error());
$IPcheck =$_SERVER['REMOTE_ADDR'];
?>
<body>
<form action="?op=register" method="post">
<table width="338" border="0" align="center">
<tr>
<td width="132" height="20" class="b01">Username:</td>
<td width="196"><label>
<input name="user" type="text" class="liteoption" id="user" size="15" maxlength="15" />
</label></td>
</tr>
</table>
<p align="left"></p>
<p align="center">
<input name="submit" type="submit" class="liteoption" value="Register" />
<br>
</p>
<?php
if(isset($_POST['submit'])) {
if(!$_POST['user']) {
die('You must fill in all of the feilds!!!<BR>');
}
$check = mysql_query("SELECT * FROM accounts WHERE AccountID = '$user'");
$check2 = mysql_num_rows($check);
if($check2 != '0') {
die("Username: '".$user."' is in use!");
}
$insert_member = mysql_query("INSERT INTO accounts (AccountID, LogonType, Status) VALUES ('$user', '2','0')");
if($insert_member) {
echo("<p class='b01'>Registration Complete!");
} else {
echo("<p class='b01'>Registration Failed!</p>");
}}
?>