Well, you can always do this:
Code HTML4Strict:
<?php
if !isset($_GET['id']) {
//static title
$page_title = "HOMEPAGE Z0mg!"
//...some query to display a list of shortened version of contents..
}else {
$id = $_GET['id'];
$query = "SELECT pid, title, content stuff blah blah FROM blab";
$result = @mysql_query($query);
$row = mysql_fetch_assoc($result);
//set page title here?
$page_title = $row['title'];
$content = $row['content'];
?>
<html>
<head>
<title><?php echo $page_title; ?></title>
<meta description = php here>
</head>
<body>
<?php echo $content; ?>
</body>
</html>
Or better yet, move the html to a different file and include it in php script. Let's call the html file template.php:
Code HTML4Strict:
<html>
<head>
<title><?php echo $page_title; ?></title>
<meta description = php here>
</head>
<body>
<?php echo $content; ?>
</body>
</html>
and
Code php:
<?php
if !isset($_GET['id']) {
//static title
$page_title = "HOMEPAGE Z0mg!"
//...some query to display a list of shortened version of contents..
}else {
$id = $_GET['id'];
$query = "SELECT pid, title, content stuff blah blah FROM blab";
$result = @mysql_query($query);
$row = mysql_fetch_assoc($result);
//set page title here?
$page_title = $row['title'];
$content = $row['content'];
include('template.php');
?>
Bookmarks