glenelkins Posted November 7, 2006 Share Posted November 7, 2006 HiOk say i am creating a display, a table that has a row for a title and a row for content. This information is taken from a database table. There is an option (set to 1 for yes and 0 for no) to determine if the content is from a PHP file or from the database. so the code might look like:[code]$sql = "SELECT * FROM blocks WHERE position='right'";$result = mysql_query($sql) or die (mysql_error()); while ($blocks = mysql_fetch_array($result)) { if ($blocks['active'] == '1') { if ($blocks['file'] == '0') { $blocks_right .= " <table border='0' width='100%' align='center'> <tr> <td align='center'><b>" . $blocks['title'] . "</b></td> </tr> <tr> <td>" . $blocks['content'] . "</td> </tr> <tr><td> </td></tr> </table>"; } }}[/code]But what if the $blocks['file'] is set to 1, in the database the filename is in $blocks['filename'], how do i include the PHP code for display within the $blocks_right variable to run the code? Link to comment https://forums.phpfreaks.com/topic/26429-include-in-display/ Share on other sites More sharing options...
glenelkins Posted November 7, 2006 Author Share Posted November 7, 2006 better yet read the contents of the file into a variable for display but i need it to actually run the code like include() execpt not display it until i echo the variable. Link to comment https://forums.phpfreaks.com/topic/26429-include-in-display/#findComment-120853 Share on other sites More sharing options...
trq Posted November 7, 2006 Share Posted November 7, 2006 Your not being at all clear in what you want to do. Link to comment https://forums.phpfreaks.com/topic/26429-include-in-display/#findComment-120861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.