Kod
<?php
........
$connect = mysql_connect($mysql_host, $mysql_login, $mysql_password);
if (!$connect) {
die("Nie połączono");
}
$mysql_db = mysql_select_db($mysql_base, $connect);
if (!$mysql_db) {
die("Nie połączono");
}
$id = $_REQUEST["id"];
$page = isset($_REQUEST["page"])?($_REQUEST["page"]):"1";
function title() {
if($page==$id)
$wynik = mysql_query("SELECT * FROM pages WHERE id='$id'");
if ($wynik)
$dane = mysql_fetch_array($wynik);
$id = $dane['id'];
$title = $dane['title'];
echo "$title";
}
?>
........
$connect = mysql_connect($mysql_host, $mysql_login, $mysql_password);
if (!$connect) {
die("Nie połączono");
}
$mysql_db = mysql_select_db($mysql_base, $connect);
if (!$mysql_db) {
die("Nie połączono");
}
$id = $_REQUEST["id"];
$page = isset($_REQUEST["page"])?($_REQUEST["page"]):"1";
function title() {
if($page==$id)
$wynik = mysql_query("SELECT * FROM pages WHERE id='$id'");
if ($wynik)
$dane = mysql_fetch_array($wynik);
$id = $dane['id'];
$title = $dane['title'];
echo "$title";
}
?>
+
Kod
<link rel="Stylesheet" type="text/css" href="/css/style.css" />
<link rel="Shortcut icon" href="/img/favicon.ico" type="image/x-icon" />
<title><?php if ($page==$id) { title(); } ?></title>
<link rel="Shortcut icon" href="/img/favicon.ico" type="image/x-icon" />
<title><?php if ($page==$id) { title(); } ?></title>
Będę chciał tak jeszcze zrobić z content, keywords, description ... ale to później jak uda się z tytułem coś wymyślić.