【发布时间】:2025-12-28 13:35:07
【问题描述】:
所以我从另一个开发人员那里继承了一个旧网站,而我并不是真正的程序员,所以我遇到了一些麻烦。我已将代码放入 Fiddle:https://jsfiddle.net/s6coraf5/
基本上有不同类别的房地产,当您点击不同的页面时,它应该过滤它们并仅显示特定于您所在页面的那些。问题是,无论您在哪个页面上,它都只是显示所有内容。我已经缩小了一些特定代码的范围,但无法弄清楚为什么它没有正确应用它。
在 php 中有:
$select_title = "Unknown";
if ($select_type == "all") { $select_title = "All Listings"; }
if ($select_type == "office") { $select_title = "Office"; }
if ($select_type == "industrial") { $select_title = "Industrial"; }
if ($select_type == "retail") { $select_title = "Retail"; }
if ($select_type == "shoppingcenter") { $select_title = "Shopping Center"; }
if ($select_type == "land") { $select_title = "Land"; }
if ($select_type == "agricultural") { $select_title = "Ranch / Farm"; }
if ($select_type == "investment") { $select_title = "Investment"; }
if ($select_type == "lodging") { $select_title = "Lodging"; }
if ($select_type == "sportsentertainment") { $select_title = "Sports / Entertainment"; }
在 HTML 中有很多地方应该应用这些 $select_type:
a href="properties.php?select_type=<?php echo $select_type;?>&select_city=<?php echo $select_city;?>&priceForm=<?= $lowPrice;?>,<?= $highPrice; ?>&sqft=<?= $lowSize;?>,<?= $highSize; ?>&sort_type=city, asking_price desc"><font size=4><b>Location,</b></a>
它只是在每一页上应用“全部”。同样,小提琴具有完整的 php 和 html,这可能更有帮助。我意识到这很丑陋而且很糟糕,但也许有人能看到一些我看不到的明显的东西。
提前感谢任何人提供的任何帮助。
【问题讨论】:
-
请再看看您发布的小提琴。有点乱。
-
这在我看来像是 PHP 代码,而不是 JavaScript - 这就是它在 JSFiddle 中呈现不佳的原因。
-
是的,我有点说我不是程序员。我也没有写任何代码。我的任务是弄清楚为什么它没有正确过滤。我其实是一个前端设计师。也许我应该找其他人帮忙。这有点过头了。我只是希望这里有人能看到一些明显的东西。
标签: php