parsing php variables?
Posted: Tue Mar 23, 2004 3:42 pm
Hi,
first of all, thank you for taking time reading this!
I was working on a new version of my content management system of my site when I decided I wanted my pages to be stored on database.
it's not like it's more efficient, but it's because I want to be able to do so.
anywayz, I had no problems saving it, nor reading it...
the problem lies here:
this will obviously not work, because $content containt php code that will not be parsed this was.
so now we get to the part where I ask all of you:
if there a way to parse that, and if so how?
again, many thanks for the time you take helping me solve it.[/php_man]
first of all, thank you for taking time reading this!
I was working on a new version of my content management system of my site when I decided I wanted my pages to be stored on database.
it's not like it's more efficient, but it's because I want to be able to do so.
anywayz, I had no problems saving it, nor reading it...
the problem lies here:
Code: Select all
<?php
// database connection already exists
if (ISSET($_GET['pageid'])) {
$pageid = $_GET['pageid'];
}
else {
$pageid = 1; // if nothing then home
}
$sql = "select content from pages where id=$pageid";
$result = mysql_query($sql);
$content = mysql_result($result,0);
echo $content;
?>so now we get to the part where I ask all of you:
if there a way to parse that, and if so how?
again, many thanks for the time you take helping me solve it.[/php_man]