0

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
}
?>
tshepang
  • 12,111
  • 21
  • 91
  • 136
Rzn Rzv
  • 19
  • 6
  • 1
    You're code is incredibly hard to follow. Can you give a better example of the flow from when a user searches to what it's supposed to do exactly. – Hydra IO Feb 25 '13 at 19:37
  • So look out: This script search in a category. Example: We have next categories: PCgames, Movies and Music. The X user is searching in category PCgames for Y game. But the script doesn`t post the results of search so the page is blank after search. I need a script who post the all files found in the search on page. – Rzn Rzv Feb 25 '13 at 19:50

0 Answers0