Hallo Domi,
sowas ähnliches hatte ich erwartet. ;-((
Das ist mein Code wie er jetzt ist. Die Datenbankabfrage dient dazu das Datensätze nicht noch mal im Pulldown erscheinen die schon angelegt wurden.
Wo und Was muß jetzt noch eingebaut werden wenn ich den jeweiligen Dateinamen zum Suchmuster finden will.
PHP-Code:
<?
//Pulldown Navigation ausgeben
$navi_files_hotel = "../villen/"; //Ordner mit Dateien
$path_hotel = opendir($navi_files_hotel);
while(false !== ($file_hotel = readdir($path_hotel))) {
if($file_hotel != '.' && $file_hotel != '..') {
$files_hotel[] = $navi_files_hotel . $file_hotel;
// sort($files_hotel);
}
}
closedir($path_hotel);
echo "<option value=\"0\">$title_lodges_index</option>\n";
echo "<optgroup label=\"Villen u. FeWo\">";
$sortArraya = array();
foreach($files_hotel as $f_hotel) {
$content_hotel = file_get_contents($f_hotel);
$pattern_hotel = '=<span>(.*)</span>=i';
preg_match($pattern_hotel, $content_hotel, $matches_hotel);
$sortArraya[$f_hotel] = $matches_hotel[1];
}
asort($sortArraya);
foreach($sortArraya as $f_hotel => $title_hotel) {
mysql_select_db($db_name_pobox);
$_pobox_sucheA = mysql_query("SELECT * FROM `pobox` WHERE `pobox_a` ='".$title_hotel."'");
$_po_isA = mysql_num_rows($_pobox_sucheA);
if ($_po_isA == 1) {
}else{
echo "<option value\"$title_hotel\">$title_hotel</option>\n";
}
} echo "</optgroup>";
?>