用戶將點擊一個鏈接打開一個新頁面(代碼如下)。我的問題是,當這個新頁面打開時,它會創建一個新的會話ID。我如何阻止這種情況發生?PHP會話變量
require_once('../../config.php'); //Database connection details
require_once('../../connect.php'); //Connect to database
session_start(); <----------- HERE
if(isset($_GET['id']))
{
$id = $_GET['id'];
$tbl_uploads = $_SESSION['COMPANY_ID'].'_uploads';
$query = "SELECT username, type, size, content FROM $tbl_uploads WHERE id = '$id'";
$result = mysql_query($query) or die('Error, query failed');
list($username, $type, $size, $content) = mysql_fetch_array($result);
header("Content-length: $size");
header("Content-type: $type");
header("Content-Disposition: inline; filename=$username");
echo $content;
mysql_close($link);
exit;
}
我補充說,在,並沒有報告錯誤。該頁面保持空白! – Michael 2010-02-19 16:51:57