看板 PHP 關於我們 聯絡資訊
現在大致做出來了 不過..最後不能重新導向到index1.php = = 可以幫我看一下哪裡有問題嗎 <?php $passed = $_COOKIE["passed"]; if ($passed != "TRUE") { header("location:project.htm"); exit(); } $link = mysql_connect("localhost", "root", "321"); if (!$link) die("建立資料連接失敗"); $db_selected = mysql_select_db("ball game", $link); if (!$db_selected) die("開啟資料庫失敗"); $sql = "SELECT * FROM setdate"; $result = mysql_query($sql, $link); if (!$result) die("執行 SQL 命令失敗"); if (mysql_num_rows($result) != 0) { $row = mysql_fetch_array($result, MYSQL_ASSOC); $timestamp1 = mktime($row["starthour"],0,0,$row["startmonth"], $row["startday"],$row["startyear"]); $timestamp2 = mktime($row["closinghour"],0,0,$row["closingmonth"] ,$row["closingday"],$row["closingyear"]); } mysql_free_result($result); mysql_close($link); if(time()<$timestamp1) exit('尚未開放'); else if(time()>$timestamp2) exit('期限已過'); if(time()>$timestamp1 && time()<$timestamp2) header("Location:index1.php"); -- ※ 發信站: 批踢踢實業坊(ptt.cc) ※ 編輯: noguchi 來自: 203.64.183.199 (08/22 15:16)
aqzb:有東西可能輸出在header();前面 試試看把header()提上去吧 08/22 16:13
noguchi:我提到上面可是出現Warning: Cannot modify header 08/22 17:18
noguchi:information-headers already sent by 一串字on line 58( 08/22 17:23
noguchi:就header那行) 08/22 17:25
※ 編輯: noguchi 來自: 203.64.183.208 (08/23 11:40)