i am using php and mysql db , i want take the values from the two input type and insert them to data base when the button save clicked when run the code no erros shown but its do not save in the db here is the code. (note that the id is auto increment and the admin table contains three columns id,username , password) addAdmin.php :
<?php include("connect.php");?>
<div class="col-md-12">
<!-- Add admin -->
<div class="box box-info">
<div class="box-header with-border">
<h3 class="box-title">Add admin</h3>
</div>
<!-- /.box-header -->
<!-- form start -->
<form id="adminForm" class="form-horizontal" action="" method = "get">
<div class="box-body">
<div class="form-group">
<label for="inputName" class="col-sm-2 control-label">User
name</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputName"
placeholder="user name" name="username" required >
</div>
</div>
<div class="form-group">
<label for="inputPassword3" class="col-sm-2 control-
label">Password</label>
<div class="col-sm-10">
<input type="password" class="form-control" id="inputPassword3"
placeholder="Password" name="password" required>
</div>
</div>
</div>
<!-- /.box-body -->
<div class="box-footer">
<input type = "submit" class="btn btn-info pull-right save" name =
"submit" value = "save">
<?php
if(isset($_POST["submit"])) {
$name = $_GET['username'];
$password = $_GET['password'];
$insertNewAdmin = "INSERT INTO `admin` VALUES
('$name','$password')";
mysql_query($insertNewAdmin);
}
?>
</div>
<!-- /.box-footer -->
</form>
</div>
<!-- /.box -->
</div>
mysql_*functions. They have been deprecated for years and don't even exist in current PHP releases. I suggest studying about PHP Data Objects, known as PDO for short, for a more modern approach.password_hash()compatibility pack. It is not necessary to escape passwords or use any other cleansing mechanism on them before hashing. Doing so changes the password and causes unnecessary additional coding.getand is checking for aPOST