A
Anonymous
Guest
I'm trying to do my own version of WordPress - sort'a. So far I can: DB: id, page, text.
ie (14, 'bfpage7', '<html><body>now is the time</body></html>')
Then in index.php
$list = array (1,2,3...7,8...);
foreach ($list as $l)
(
$q1 = mysqli_query ($db1, "select text from table where page = 'bfpage$l';");
$r1 = mysqli_fetch_row ($q1);
echo "$r1[0]";
)
That works just fine. Now for my problem: I want to include this in the text:
<?php
include 'another.php';
$menulist = array ("Home|home.php", "Contact Us|contact.php", "About Us|about...
foreach ($menulist as $m)
... [build the menu]
?>
The problem is I don't get the menu (or any php output) I get the php code and not the results of the code. If I php_put_contents(file.php, $r1[0]) to a file and then "include 'file.php'; it works - but yuck!
Suggestions please
Thanks
ie (14, 'bfpage7', '<html><body>now is the time</body></html>')
Then in index.php
$list = array (1,2,3...7,8...);
foreach ($list as $l)
(
$q1 = mysqli_query ($db1, "select text from table where page = 'bfpage$l';");
$r1 = mysqli_fetch_row ($q1);
echo "$r1[0]";
)
That works just fine. Now for my problem: I want to include this in the text:
<?php
include 'another.php';
$menulist = array ("Home|home.php", "Contact Us|contact.php", "About Us|about...
foreach ($menulist as $m)
... [build the menu]
?>
The problem is I don't get the menu (or any php output) I get the php code and not the results of the code. If I php_put_contents(file.php, $r1[0]) to a file and then "include 'file.php'; it works - but yuck!
Suggestions please
Thanks