$userID = 0; if (isset($_COOKIE['userID'])) { $userID = $_COOKIE['userID']; } else { header("Location: /tick/login.html"); } $stageID = 0; if (isset($_COOKIE['stageID'])) { $stageID = $_COOKIE['stageID']; } else { header("Location: /tick/stages.php"); } $query = "SELECT events.name as event_name, stages.* FROM events, stages WHERE events.ID = stages.eventID AND stages.ID = $stageID AND events.userID = $userID"; $result = mysql_query($query, $db); if ($result) { while ($r = mysql_fetch_array($result)) { $event_name = $r['event_name']; $name = $r['name']; $popup_link = $r['popup_link']; $popup_text = $r['popup_text']; $popup_position = $r['popup_position']; } } mysql_free_result($result); ?>