First PHP site
Wednesday, 12. March 2008, 21:04:37
With ukrainian comments ))<?php include ('config.php'); $result = mysql_query("SELECT id, title, link, editor, cont FROM about WHERE link='history'", $db); $myrow = mysql_fetch_array($result); if (!count($_GET)){ /*Рандомно виводить фан-фіки*/ $numbers = array('news','fanfics/1','fanfics/2','fanfics/3'); srand((float)microtime() * 1000000); shuffle($numbers); $file = $numbers[0]; $_GET['hp'] = 'news'; } $pages = array_keys($_GET); if($pages[0]!="hp"){ $subdir = $pages[0]."/"; $file = 'submenu'; }else{ $subdir=""; if(!isset($file)) $file = 'submenu'; } if (isset($_GET['hp'])) { $page=$_GET['hp']; if (isset($page)) { include ('blocks/'.$file.'.php'); echo "
"; /*Виводимо контекст*/ $result = mysql_query("SELECT cont FROM $page WHERE link='index'", $db); $myrow = mysql_fetch_array($result); echo $myrow['cont']; echo ""; } } if (!isset($_GET['hp'])) { include ('blocks/'.$file.'.php'); echo ""; $page = array_keys($_GET); $page2 = array_values($_GET); /*Виводимо контекст*/ $result = mysql_query("SELECT * FROM {$page[0]} WHERE link='{$page2[0]}'", $db); $myrow = mysql_fetch_array($result); echo $myrow['cont']; echo ""; } ?>














