Calling PHP variables from inside a MySQL Database -


I am currently working on a CMS system that directly builds the website directly from the information saved in the MySQL database < / P>

I have this problem:

  • Within CMS, the user enters coding for a template
  • The front of the site (frontend.php ) Variable calls where layouts are stored ($ template_header)
  • Menu from the frontend database D also creates variable $ menu_code, which is also stored by CMS
  • Within the template code, there should be a break for this variable, when it is run by the frontend.fpp It will be raised.

This is what I am trying to do:

inside frontend.php:

  $ template eheader Echo; $ Template_header inside  

  & lt; Tr & gt; & Lt; Td> & Lt; Center & gt; '. $ Menu_code. ' & Lt; / Center & gt; & Lt; / TD & gt; & Lt; / TR & gt;  

When Frontend.php is run in IE, then it should look like:

  & lt; Tr & gt; & Lt; Td> & Lt; Center & gt; & Lt; Script & gt; The rest coding in the menu menu & lt; / Script & gt; & Lt; / Center & gt; & Lt; / Td> & Lt; / Tr & gt;  

What does this look like when I run it:

  & lt; Tr & gt; & Lt; Td> & Lt; Center & gt; '$ Menu_code.' & Lt; / Center & gt; & Lt; / TD & gt; & Lt; / TR & gt;  

This is a simple problem, but it will probably be appreciated with a strong timeline with this project and any advice would be greatly appreciated. . Thank you

If I understand you correctly, then a simple move will be:

< $ template_data = "<<<<<<<<<<<<<<<<<<<<<<>
{% REPLACE_WITH_CONTENT%} & lt; / center> ; & Lt; / tr & gt; "; $ Template_data = str_replace ("{% REPLACE_WITH_CONTENT%}", $ menu_code, $ template_data);

Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -