MY GOAL: once the button is pressed then it cannot be pressed again. It should give an error or some sort of message like (when button is pressed first time to mark attendance and someone again press it)
" attendance is already marked you cannot mark your attendance again "
<?php
session_start();
?>
<form method="post">
<button name="attendence" >mark attendence </button>
</form>
<?php
if (isset($_POST['attendence'])){
$id =$_SESSION["id"];
$con = mysqli_connect('localhost','root','','yo');
$query = "INSERT INTO attendance (present,absent, datetime, std_id) VALUES ('present','',current_timestamp(), $id ) ";
$rs=mysqli_query($con,$query);
if($rs){
echo "Marked as Present";
}
else {
echo "marked as Absent";
}
}