Firstly create a new database for your data called ' pages ' and
then create a table in that database called ' pagetable '.
Create the pagetable with the fields
id (primary, unique, varchar)
pagetitle(text)
pagebody(text)
details of how to do this can be found on mysql.org or you can install webmin (www.webmin.com). There's also a cool thing
called phpmyadmin which is probably found at www.phpmyadmin.org although i'm not sure.
<body>
HEADER STUFF HERE
<?php
$page = $HTTP_POST_VARS["section"];
$link = mysql_connect("hostname", "username", "password")
or die ("Could not connect");
mysql_select_db("pages")
or die("Could not select database");
$query = "SELECT pagebody FROM pagetable WHERE title LIKE '$page' ";
$result = mysql_query($query)
or die("Query Failed");
$line = mysql_fetch_row($result);
foreach($line as $fieldnumber => $value) {
$pagebody = $value;
}
if ($pagebody) {
// Now if you want to include php in your database do this something like this:
eval($pagebody);
// If you just want to have text or html go:
require($pagebody);
} else {
print "Sorry, page not found";
}
?>
FOOTER STUFF HERE
</body>
Now that should work - although I can't promise anything because i haven't tested it.
Gareth Down
www.ihostweb.net