<?php
include "includes/database.php";

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Registration</title>
<link href="css/half-slider.css" rel="stylesheet">
</head>

<body>
<br>
<br>
<br>

<?php

if (isset($_POST["email"]))
{
$name=$_POST["name"];
$email=$_POST["email"];
$university=$_POST["university"];
$password=$_POST["password"];
$phone=$_POST["phone"];
$address=$_POST["address"];



$dataWujud=mysqli_query($newcon,"SELECT * from tbl_user where email='$email'");
$bil_rekod=mysqli_num_rows($dataWujud);

if ($bil_rekod==0)
{

mysqli_query($newcon,"INSERT INTO tbl_user (name,email,university,password,phone,address,category, status) values ('$name','$email','$university','$password','$phone','$address','1','1')");

echo "New record added!";
}
else
{
echo "Record already exist!";
}
}
?>


<div class="register">
<form id="form1" name="form1" method="post" action="">
  <table height="500"  border="0" align="center">
    <tr>
      <td colspan="3" align="center" valign="middle"><strong>Create your MyUniversity MarketPlace Account</strong><br></td>
    </tr>
    <tr>
      <td>NAME</td>
      <td></td>
      <td><input type="text" name="name" id="name" /> </td>
    </tr>
    <tr>
      <td width="73">EMAIL</td>
      <td width="19"></td>
      <td width="294"><label for="email"></label>
      <input type="text" name="email" id="email" /> </td>
    </tr>

    <tr>
      <td>UNIVERSITY</td>
      <td></td>
      <td><input type="text" name="university" id="university" /> </td>
    </tr>

    <tr>
      <td>PASSWORD</td>
      <td></td>
      <td><input type="password" name="password" id="password" /> </td>
    </tr>
     <tr>
      <td>PHONE</td>
      <td></td>
      <td><input type="text" name="phone" id="phone" /> <td>
    </tr>
    <tr>
      <td>ADDRESS</td>
      <td></td>
      <td><input type="text" name="address" id="address" /> <td>
    </tr>
   
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Register" /></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td><center>Click <a href="log.php">Here</a>Back To Login</center></td>
    </tr>
  </table>
</form>
</div>
</body>
</html>