<?php
include "config.php";
myheader();
#####################
$get = $_GET['p'];
switch($get) {
case "cat":
if($_GET['id']) {
$catget = $_GET['id'];
$catq = mysql_feth_array(mysql_query("SELECT * FROM news30_cats WHERE id = '$_GET[id]'"));
$cat = $catq['nome'];
include "news/index.php";
}
break;
default:
$cat = "all";
$template = "default";
$author = "vito";
include "/news/index.php";
break;
}
#####################
myfooter();
mysql_close($db);
?>
<?php
error_reporting(E_ALL);
$db = mysql_connect('sql200.0fees.net','-NO SHOW-','-NO SHOW-') or die("Errore 1: ".mysql_error()."");
mysql_select_db('-NO SHOW-', $db) or die("Errore 2: ".mysql_error()."");
function myheader() {
?>
---- HEADER CODE ----
<?php
}
function myfooter() {
?>
<?php
$catq = mysql_query("SELECT * FROM news30_cats");
while($cat = mysql_fetch_array($catq)) {
echo "<li><a href=\"index.php?p=cat&id=$cat[id]\">$cat[name]</a></li>";
}
?>
---- FOOTER CODE ----
<?php
}
?>