<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {

	require "../includes/db1.php";

	$password = password_hash($_POST['password'], PASSWORD_DEFAULT);


	$sql = "INSERT INTO accounts1 (username, password1, email, level1)
			VALUES ('" . mysqli_escape_string($con, $_POST['username']) . "', '"
						. mysqli_escape_string($con, $password) . "', '"
						. mysqli_escape_string($con, $_POST['email']) . "', '"
						. mysqli_escape_string($con, $_POST['level1']) . "')";

	$results= mysqli_query($con, $sql);

	if ($results === false) {
	  echo mysqli_error($con);
	} else {
	  $id = mysqli_insert_id($con);
	  echo "Data Submitted successfully. with $id ";
echo $_POST['level1'];
	}

  }

   ?>
