session_start(); // CONNECT TO DB ----------------------------------------------------------- include 'db_connect.php'; $_SESSION['url'] = $_SERVER['REQUEST_URI']; if(isset($_SERVER['HTTP_REFERER'])) { setcookie("externalRefer", $_SERVER['HTTP_REFERER'], time() + 3600); } if (!isset($_SESSION['referrer'])) { $_SESSION['referrer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : 'n/a'; } /*if (!isset($_SESSION["is_auth"])) { header("location: http://austinteamsoccer.com/index"); exit; } else if (isset($_REQUEST['logout']) && $_REQUEST['logout'] == "true") { // At any time we can logout by sending a "logout" value which will unset the "is_auth" flag. // We can also destroy the session if so desired. unset($_SESSION['is_auth']); session_destroy(); // After logout, send them back to index.php header("location: http://austinteamsoccer.com/index"); exit; }*/ switch($_GET['weekday']){ case '0': $rday='next sunday'; break; case '1': $rday='next monday'; break; case '2': $rday='next tuesday'; break; case '3': $rday='next wednesday'; break; case '4': $rday='next thursday'; break; case '5': $rday='next friday'; break; case '6': $rday='next saturday'; break; default: $rday1='next tuesday'; $rd1 = strtotime($rday1); $rday2='next thursday'; $rd2 = strtotime($rday2); if($rd1<$rd2) $rday=$rday1; else $rday=$rday2; break; } $nextWeekday = date('D d M Y', strtotime($rday)); $nextWeekdayDB = date('Y-m-d', strtotime($rday)); $query = 'SELECT userid, gamepos FROM ats_games WHERE gamedate = \''.$nextWeekdayDB.'\''; $result = mysql_query($query); //$firstrow = mysql_fetch_assoc($result); // reset the result resource //mysql_data_seek($result, 0); /*while($row = mysql_fetch_assoc($result)) { //display all of them }*/ $row = mysql_fetch_assoc($result); //echo $row['userid']; //echo '-end'; mysql_close(); // DISCONNECT FROM DB ----------------------------------------------------------- ?>