Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 746 Bytes

php-snippets.md

File metadata and controls

26 lines (19 loc) · 746 Bytes

How to Protect a Page With Verification-Page

See README.md before continuing on this page or see the plain text version.

  1. Add the full path of the page you want to protect (including the PHP filename; it can't just be folder names, it should look like /foo/bar.php or /bar.php) to the $whitelist array in verification.php.

  2. Add the first snippet above the doctype declaration (<!DOCTYPE HTML>)

<?php
session_start();
if ($_SESSION["verified"]) {
?>
  1. Add the second snippet after the closing html tag (</html>)
<?php
} else {
  header("Location: /verification.php?continue=" . $_SERVER["SCRIPT_NAME"]);
}
?>
  1. Done!