I have a get edit button; <a href="edit_leave.php?delete=id); ?>,linking to an edit page. My problem is that have noticed user can edit other leave-types by just changing the id on the link; https://www.website.com/edit_leave.php?edit=11.
I have tried adding this script on top of the page:
<?phpif ( $_SERVER['REQUEST_METHOD']=='GET' && realpath(__FILE__) == realpath( $_SERVER['SCRIPT_FILENAME'] ) ) {header( 'HTTP/1.0 403 Forbidden', TRUE, 403 );die( header( 'location: /404.php' ) );}?>.
How can i prevent this edit via URL?