|
套用互動討論區的用法,設計最新消息的檔案,可是點選之後,出現如下訊息:
Warning: Cannot modify header information - headers already sent by (output started at /home/customer/walk-tao.com/www/news/count_hits.php:8) in /home/customer/walk-tao.com/www/news/count_hits.php on line 37
我將整個count_hits.php的語法貼在下方:
<?php require_once('../Connections/green99.php'); //設定資料庫連線 mysql_select_db($database_green99, $green99); //連結資料庫
$send_id = $HTTP_GET_VARS['news_id']; //接收傳遞的URL參數 $updateCommand="UPDATE news_table SET news_hits = news_hits + 1 where news_id = $send_id"; //更新資料的SQL字串
mysql_query($updateCommand,$green99);//執行postmain資料的更新 $updateGoTo = "news_detail.php?news_id=".$send_id; //設定更新後前往的頁面 header(sprintf("Location: %s", $updateGoTo)); //執行頁面的轉換 ?>
請指導一下,我不懂它的意思。謝謝!! |