include("connect.php");
$sql = "SELECT * FROM menu";
$result = mysql_query($sql, $conn) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$id = $row[id];
$title= $row[title];
$linktitle = $row[linktitle];
if ($id==4) {
$menu .= ": $title
";
} else {
$menu .= ": $title
";
}
}
$sql = "SELECT * FROM pages where catid = '$_GET[catid]'";
$result = mysql_query($sql, $conn) or die(mysql_error());
$num_rows = mysql_num_rows($result);
if ($num_rows == 1) {
$sql2= "SELECT * FROM pages where catid = '$_GET[catid]'";
$result2 = mysql_query($sql2, $conn) or die(mysql_error());
while ($row2 = mysql_fetch_array($result2)) {
$id= $row2[id];
$title = $row2[title];
$linktitle = $row2[linktitle];
$text = $row2[text];
$text = nl2br($text);
$content = "
$title
$text";
}
} else {
$sql2= "SELECT * FROM pages where catid = '$_GET[catid]'";
$result2 = mysql_query($sql2, $conn) or die(mysql_error());
while ($row2 = mysql_fetch_array($result2)) {
$id= $row2[id];
$title = $row2[title];
$linktitle = $row2[linktitle];
$content .= "";
}
}
if ($_GET[id] != "") {
$sql2= "SELECT * FROM pages where id = $_GET[id]";
$result2 = mysql_query($sql2, $conn) or die(mysql_error());
while ($row2 = mysql_fetch_array($result2)) {
$id= $row2[id];
$title = $row2[title];
$linktitle = $row2[linktitle];
$text = $row2[text];
$text = nl2br($text);
$content = "$title
$text";
}
} else if ($_GET[catid] == "") {
$sql2= "SELECT * FROM pages where catid = 4";
$result2 = mysql_query($sql2, $conn) or die(mysql_error());
while ($row2 = mysql_fetch_array($result2)) {
$id= $row2[id];
$title = $row2[title];
$linktitle = $row2[linktitle];
$text = $row2[text];
$text = nl2br($text);
$content = "$title
$text";
}
}
?>
echo "$title"; ?>
">
">