This is really starting to get annoying...
I'm trying to create a register page where it sends the username, password and security level.
HTML form
<div class="login">
<h1>Register</h1>
<form method="POST" action="" name="register_form">
<input type="text" name="user" placeholder="Username" required="required" />
<input type="password" name="pass" placeholder="Password" required="required" />
<input type="text" name="level" placeholder="LEVEL" value="1" disabled="true"/>
<button type="submit" name="Register" class="btn btn-primary btn-block btn-large">Register</button>
</form>
</div>
And my PHP code which is in the same file...
<?php
require 'config/db_connect.php';
if (isset($_POST['Register'])) {
session_start();
$username = $_POST['user'];
$password = $_POST['pass'];
$level = $_POST['level'];
//$seccode = $_POST['seccode'];
$sql = $con->query("INSERT INTO secure_login (email, password, lvl) VALUES('{$username}', '{$password}','{$level}')");
}
?>
And I keep getting this error:
Notice: Undefined index: level in C:\xampp\htdocs\tools\register.php on line 8