Hello again,
I want a piece of code that will allow me to dynamically create pages from a mysql table. I am close, but am having two problems.
Right now it uses $_GET to get the id, so when the page displays it displays index.php?id=1 . What I want is to replace id with a variable that is located in the mysql table. So I want it to be index.php?page=HotGirls (or whatever I call the page in my page mysql row)
I have php code in some of my row['content'] rows, but when using echo to display the row, the php code is displayed as regular html. So, what do I need to use to make it so that I can display both php and html code within row['content'] ?
Help is very much appreciated.
if( !empty($GET['id']) && is_numeric($GET['id']) )
{
$result = mysql_query("SELECT * FROM sampletable WHERE pageid = " . $_GET["id"]);
if( mysql_num_rows($result) == 0 ) echo("Page not found");
else
{
$row = mysql_fetch_assoc($result);
echo $row['content'];
//Input Page content
}
}
else echo("No Page Info was specified.");