<?php require_once "framework2/CredentialStore.php"; $cs = new CredentialStore(); $serverName = basename($_SERVER["SERVER_NAME"]); $serverURI = $_SERVER['REQUEST_URI']; if (!in_array($serverName, $cs->getValidDomains())) { header('Location: https://walkntrade.com' . $serverURI, true, 301); } $schoolTextId = $cs->cookieCheck("sPref"); if ($cs->getSchoolName($schoolTextId) === null) { include "selector.php"; } else { $query = isset($_GET["query"]) ? $_GET["query"] : ""; header('Location: /schools/' . $schoolTextId . '?query=' . $query); }
<?php require_once "framework2/CredentialStore.php"; $cs = new CredentialStore(); $loggedIn = $cs->getLoginStatus(); //get page args $args = array_keys($_GET); $args = split(":", $args[0]); $identifier = htmlspecialchars($args[1]); $schoolTextId = htmlspecialchars($args[0]); $myPost = false; $serverName = basename($_SERVER["SERVER_NAME"]); $serverURI = $_SERVER['REQUEST_URI']; $redirect = true; foreach ($cs->getValidDomains() as $domain) { if ($serverName === $domain) { $redirect = false; } } if ($redirect) { header('Location: https://walkntrade.com' . $serverURI, true, 301); } if ($cs->getSchoolName($schoolTextId) == null) { header('Location: ./'); return; } if ($identifier != null) { //get details of the post if ($stmt = $cs->getlistingConnection()->prepare("SELECT id, identifier, category, title, details, price, location, username, userid, date, views, price, isbn, author FROM `" . $schoolTextId . "` WHERE `identifier` = ? LIMIT 1")) { //prepare query $stmt->bind_param('s', $identifier);