我在一个类别中搜索了一个脚本(有一些帮助)。例: 我们有下一个类别:PCgames,电影和音乐。 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
}
?>