I want to make form submission per day will be only 5 submit that any user can click, after 5 click per day the button dissapear and will showing the text. And then the next day the button will be shows up until user clicked 5 times again.
This is my php :
<?php
if(isset($_POST['submit'])) {
$hostname = "localhost";
$username = "root";
$password = "";
$databaseName = "test";
$user = $_POST['user'];
$pass = $_POST['pass'];
$connect = mysqli_connect($hostname, $username, $password, $databaseName);
$query = "INSERT INTO `user`(`users`, `pass`) VALUES ('$user','$pass')";
$result = mysqli_query($connect,$query);
if($result)
{
echo 'Data Inserted';
}
else{
echo 'Data Not Inserted';
}
mysqli_close($connect); } ?>
Here my HTML form code
<head>
<title> PHP INSERT DATA </title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<form action="index.php" method="post">
<input type="text" name="user" required placeholder="username"><br><br>
<input type="password" name="pass" required placeholder="pasword"><br><br>
<input type="submit" name="submit" value="Add Data To Database">
//Here my submit button, if row in table "user"in database more than 5 then can automatic dissable
</form>
</body>