我制作了一个在类别中搜索的脚本(在一些帮助下)。示例:我们有下一个类别:PC 游戏、电影和音乐。X 用户正在 PCgames 类别中搜索 Y 游戏。在搜索脚本大多数发布后,必须显示所有结果,但脚本不显示结果。一些帮助?这是在类别中搜索的 php 脚本
<?php
//define each directory here, the index starts with 0 == all and so on.
$categorydir = array('/Category/All/', '/Category/PCGames/', '/Category/Console/', '/Category/Movies/', '/Category/Music/', '/Category/XXX/', '/Category/Windows/', '/Category/Linux/', '/Category/Software/', '/Category/Documents/');
//if option selected and its valid number
if(isset($_POST['category']))
if(ctype_digit($_POST['category']) && isset($categorydir[$_POST['category']]))
if(array_key_exists($_POST['category'], $categorydir) && is_dir($categorydir[$_POST['category']])){
$handle = opendir($categorydir[$_POST['category']]);
}else{
echo 'target directory not found';
}
else{
//please enter an option
}
?>