0
我有下面的代码,这对我不起作用。我曾经有$ HTTP_GET_VARS而不是$ _GET,但后来更新到PHP 5,现在事情已经破裂。有什么想法,我在做什么错在这里?
<?php
$_GET['SubCat'];
$_GET['Location'];
$db = mysql_connect("localhost", "xxxx", "xxxx");
mysql_select_db("outdoors",$db);
if ($Location) {
$result = mysql_query("SELECT ID, Longitude, URL, SiteName, Description FROM hunting WHERE SubCategory = '$SubCat' AND Location = '$Location' AND Status <> 'HIDDEN' ORDER BY SiteName",$db);
} else {
$result = mysql_query("SELECT ID, Longitude, URL, SiteName, Description FROM hunting WHERE SubCategory = '$SubCat' AND Status <> 'HIDDEN' ORDER BY SiteName",$db);
<More unrelated stuff after this>
变量将通过这样的链接进行传递:
hunting.php?SubCat=Hunting+Locations
您没有存储来自get的值,并且$ location的位置我没有找到该变量? – Vijay 2011-04-28 07:17:37
位置保留给未来的功能。 – GoNorthWest 2011-04-28 07:20:01
不是$ _GET存储在变量中的值,我将它传递给像'SubCat'?我认为这是它的工作方式。 – GoNorthWest 2011-04-28 07:20:36