抓不到資料

edited 十月 2013 in PHP新手區
請問,下面的程式碼是要判斷如果有登入,則進入下一頁,否則進入"productListNo.php",而且要以"product_id"做篩選.

但是,現在它可以判斷不同的頁面,可是抓不到"product_id",出來的頁面資料都是空白的.(用來傳送的"product_id"是呼叫放在隱藏欄位中的)

請幫忙看一下問題在哪裏好嗎?拜託了

<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "0,1";
$MM_donotCheckaccess = "false";

function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {

$isValid = False;

if (!empty($UserName)) {

$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}

if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "productListNo.php?product_id={$row_RecProduct}";
if (!((isset($_SESSION)) && (isAuthorized("",$MM_authorizedUsers, $_SESSION, $_SESSION)))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER;
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>

原始討論: http://twpug.net/x/modules/newbb/viewtopic.php?topic_id=4367

評論

Sign In or Register to comment.