- Feb 7, 2001
- 1,637
- 0
- 0
OK, basically what I want to do, is store an entire page in a database.
So say my page is this:
<html>
<title>arg</title>
<head></head>
<body>
This is <?php print ("$fname $lname"); ?>'s Website!
Content
</body>
</html>
I want to store that whole bit in a database, which is fine I can do that, BUT, then I want to pull it back out and build the page with it. Problem being, if I say this:
$fname = Keith
$lname = Palmer
SELECT * FROM $tablename etc etc etc to get the content
print ($select_result);
PHP won't parse that, and thus won't print out my firstname and lastname. How can I get PHP to parse the string? The ' eval() ' function sounds promising but I don't understand how its used and the documentation is rather sparse on it. Suggestions? The only other idea I could come up wiht was to write it to a file, then include () it. Is there a way I can make include () take a string instead of a file?
So say my page is this:
<html>
<title>arg</title>
<head></head>
<body>
This is <?php print ("$fname $lname"); ?>'s Website!
Content
</body>
</html>
I want to store that whole bit in a database, which is fine I can do that, BUT, then I want to pull it back out and build the page with it. Problem being, if I say this:
$fname = Keith
$lname = Palmer
SELECT * FROM $tablename etc etc etc to get the content
print ($select_result);
PHP won't parse that, and thus won't print out my firstname and lastname. How can I get PHP to parse the string? The ' eval() ' function sounds promising but I don't understand how its used and the documentation is rather sparse on it. Suggestions? The only other idea I could come up wiht was to write it to a file, then include () it. Is there a way I can make include () take a string instead of a file?