PHP post data after search

流过昼夜 提交于 2019-12-12 03:35:16

问题


I have made a script(with some help) who search in a category. Example: We have next categories: PCgames, Movies and Music. The X user is searching in category PCgames for Y game. After the search script most post all the results must be displaied but the script doesn`t display the results. Some help? Here is the php script who search in a category

    <?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
}
?>

来源:https://stackoverflow.com/questions/15074996/php-post-data-after-search

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!