this is not help to me PHP check session, checking multiple variables to allow access to specific pages
PHP if condition number issue [duplicate]
i try simple php CRUD with session user.php if login usercan only access ore its print error but this is user.php top lines
<?php include('server.php') ?>
<?php
if(!isset($_SESSION['name'])){
// header("Location:login.php");
echo "nee to login to access this page" ;
exit;
session_destroy();
}
?>
and this my delete button code
<a href="server.php?delete=<?php echo $row['id'];?>" class ="btn btn-danger" > delete </a>
when this button gt clicked ip/user.php?delete=id (id get from data base) when with out login when type this ip/user.php?delete=20
its delete from data base how can i stop that?
its my server.php for delete
if (isset($_GET['delete'])) {
$id = $_GET['delete'];
$qry = "DELETE FROM crud WHERE id=$id" ;
mysqli_query($conn, $qry);
$_SESSION['message'] = "recoard deleted success";
$_SESSION['msg_type'] = "danger";
header('location: user.php');
}