<?php $parts = explode("/", $_GET["_"]); if (isset($parts[2])) { if ($parts[2] === "cloudburst") { $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/ynmuc/fronters.json"), true); } elseif ($parts[2] === "raindrops") { $fronters = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/gdapd/fronters.json"), true); } else { peh_error("Invalid argument; got " . strip_tags($parts[2]), 400); die(); } if (count($fronters["members"]) > 0) { header("Location: /" . $fronters["members"][0]["name"]); die(); } else { if ($parts[2] === "cloudburst") { header("Location: /cloudburst"); } else { header("Location: /raindrops"); } } } else { peh_error("Missing operand", 400); die(); }