napisałem proste wybieranie działów z pliku lub z bazy danych, za pomoca ID działu lub jego nazwy
wywoływanie strony index.php?content=NAZWA_LUB_ID_DZIALU
w bazie sa zapisane informacje o dziala w where_c jesli 1 to dzial na pliku jesli 0 to tresc dzialu w bazie.
<?php //content selection include(\"content/news.php\"); } else { //else content selection $sql = 'SELECT * FROM contents WHERE name_c = \"'.$_GET[\"content\"].'\" OR id_c = \"'.$_GET[\"content\"].'\"'; $res = $db -> sql_query($sql); $row = $db -> sql_fetchrow($res); if($num = $db -> sql_numrows($res) > 0) { // if something is in database if($row[\"where_c\"] == 1 & file_exists(\"content/\".$row[\"name_c\"].\".php\")) { // if it's a file include(\"content/\".$row[\"name_c\"].\".php\"); } elseif($row[\"where_c\"] == 0) { //if it's in database include(\"content/database_content.php\"); } else { // if not exist error_code(\"BRAK_DZIALU\"); } // end if it's file } else { // if not exist error_code(\"BRAK_DZIALU_DUZE\"); } // end checking in database } //end content selection ?>
i pytanko, ja to w.g was wyglada, dobrze, lamersko? jakies inne propozycje na zorganizowanie takiego wyboru.