【发布时间】:2016-10-02 02:16:36
【问题描述】:
我正在使用 php 在我的网页中设置 21 个区的会话变量。为此,我使用下面的代码。
<?php
session_start();
header('Cache-control: private'); // IE 6 FIX
//DISTRITO
if (isSet($_GET['distrito'])) {
$distrito = $_GET['distrito'];
// register the session
$_SESSION['distrito'] = $distrito;
}
else
{
$distrito = 'portugal';
}
?>
问题在于,在我的页面中,无论我选择哪个区域,它总是假设相同。谁能帮帮我?
【问题讨论】:
-
isSet 不正确。它是 isset()
-
不是这样的。它做同样的事情。可以是html吗?
标签: php html session session-variables