Well, after hours of trying this, I finally managed to get the start of my new site layout to read stuff (template) from a MySQL database. The table I put this in is caled 'templates' and has 3 fields: id, name and content.
The id is the id of the template, name the name (doh) and the content is the actual template. I only have the copyright template as a test now, which is this:
<table width=$tablewidth bgcolor=$tableborder cellspacing=$tablecellspacing cellspadding=$tablecellspadding align=center><tr><td width=100%>$font © RPG Revelation 2001 - 2002, all rights reserved</td></tr></table>
But, the result I get is this: <a href=http://www.rpgrevelation.com/layout/hom ... ome.php</a>
As you can see, the variables won't work, and to be honest, I don't have a clue on how to get them to and on IRC nobody knew either, so can anybody tell me how to get these variables to work? I don't want to use the templates with 100% HMTL, considering I'd have to change everything manually again. <img src=images/icons/icon25.gif align=absmiddle>
Gettings variables to work in a MySQL template
Moderator: General Moderators
try the eval()-functionor use preg_replace to replace certain parts of the template
Code: Select all
eval("print("$template");");