Forum Moderators: DixonJones
I made the line below an include file located in a directory that is not accessable from the public.
<?PHP $db_server ="serverURL"; $db_name = "DBName"; $username = "User"; $password = "pass"; $dbh = @mysql_connect($db_server,$username,$password) or die ("Connection failed."); $db = @mysql_select_db($db_name) or die ("Connection made. But database '$db_name' was not found.");?>
Next put this on each page
<head>
<?php
$query="SELECT * FROM `META` WHERE PAGE = " . $_SERVER['REQUEST_URI'];
$result=mysql_query($query); $row=mysql_fetch_assoc($result);echo "<META NAME='description' CONTENT='";
echo $row['DESCRIPTION'];
echo "'>";echo "<META NAME='keywords' CONTENT='";
echo $row['KEYWORDS'];
echo "'>";?>
<title>title</title>
</head>
I have not tested this and I could be way wrong but this is what I would do. Of course you have to have MySQL installed with a table that has a record for each file name. If you just have .html file you will need to put
AddType application/x-httpd-php html
in your .htaccess file.