I'm setting up a small magazine with several sections that all work from the same PHP page.
I'd like it to redirect people back to the home page if they are not on an official section. So for this my code is:
<?php
if (isset($_GET["section"])) {
$section = $_GET["section"];
} else {
header("Location: $site_url");
exit();
}
if ($section !== 'gallery' || $section !== 'magazine' || $section !== 'picks' || $section !== 'customs' || $section !== 'editor') {
header("Location: $site_url");
exit();
}
?>
The problem is, when I visit localhost/results.php?section=gallery
, I'm redirected back to the home page, even though it is in the If statement. Anyone know why this is?