问题
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