Mar
16
How to dynamic titles with php?
March 16th, 2010 posted by
admin
CATEGORY_CLASS.PHP
function main_category(){
$sql = “SELECT * FROM category” ;
$res = mysql_query($sql) or die(mysql_error());
while($row = mysql_fetch_assoc($res)){
echo ‘‘;
$title = ‘asd’ ;
}
}
CATEGORY.PHP
include 'class/category_class.php';
$obj = new category();
$obj->host = ‘localhost’;
$obj->username = ‘demo’;
$obj->password = ‘demo’;
$obj->db = ‘blog’;
$obj->connect();
?>
include 'includes/header.php';
?>
|
if(isset($_GET['id'])): endif; ?> |
include 'includes/footer.php';
?>
HEADER.PHP
HOW TO IMPORT “main_category function $title var ” then “category.php



























































































































DzSoundNirvana says:
March 17th, 2010 at 8:24 pm
try this is for automatic header information
/****************************************************************************
Time to call the class in each . Lets say index.php
****************************************************************************/