Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

62 users online



Storing html/php in database

Storing html/php in database

Currently viewing this thread: 1 (0 members and 1 guests)


Page 2 out of 2
TheMickster

TheMickster

Neverside Newbie
Status: Offline!

yea thats what i presume

___________________

Bytecon Web Solutions
Flyscripts - Remotely Hosted Scripts
Talk Ski - Skiing Discussion
ClickCreator - $1.85 for 1000 targetted visitors

Genevieve

Genevieve

Status: Offline!

ok, I need a picture here ...

you can't really store "raw code" into a db like you were storing text data, it doesn't make any sense. Let's say you want to do a tutorial website and that you want to create a search engine for the user to browse all your code exemple. I would store only the info relevant to each exemple and the file path to each page containing the code exemple.

maybe I'm getting your problem all wrong, but I just don't understand why you would store any code into a db. :confused:

___________________

http://www.genevieveplante.com/Images/mini_banner.jpg
msn : genevievep2@hotmail.com

Chippo

Chippo

Status: Offline!

you could just add simple things to your code eg <# Blah #> n then do an str_replace("<# Blah #>",$blah,$source);
how ever I think he means doing something like this.....

PHP:

<?php
function template($which)
    {
        global 
$acp;
        
$new "class " $which "{\r";
        
$temp $this->mysql->query("SELECT * FROM `" $acp->ss['sql_prefix'] . "skin_templates` WHERE class = '$which'");
        while(
$t $this->mysql->fetch_row($temp)){
            
$new .= "function " $t['func_name'] . "(" $t['args'] . "){\n";
            
$new .= "global \$acp;\n";
            
$new .= "return <<<EOF\n";
            
$new .= $t['template'] . "\nEOF;\n\r}\n";
        }
        
$new .= "}\n";
        eval(
$new);
        return new 
$which();
    }
?>

Page 2 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0172 seconds.