I want to have a page with 3 sections:
<?php
session_start();
if (isset($_SESSION['login'])) {
echo "Work";
$_GET['id'] = 'edit';
?>
<a href="protected.php?if=edit">Edit post</a>
<?php
}
else {
echo "notWork";
}
if (isset($_GET['id']) && $_GET['id'] == 'edit') {
echo "Editing . . .";
}?>
But I have no idea how to do that page “Edit”, will be visible only when we go link protected.php?if=edit.
ok.simply check your page referer with this code :
more documentation here
http://php.net/manual/en/reserved.variables.server.php