Hello,
I am fairly new to web and am making a page I am happy with, however I am wonding if my method is flawed. Currently what I do is load everything into a monster sized sting in my php script like:
Do people actually do this? if yes, it takes a long time, and is prone to error, is there a tool that can help me do this?^.- It seems to me that this method is a bit of a hack.
my eventual intent is to load all these strings into a SQL database and query them out (entire divs, and divs inside of divs!), and am wondering if this approach also seems appropriate as well.
Also, my tactic with css for my divs has been to use php to echo a style section into the code like so: "<style>" . $styles . "</style>" >.> which also seems kinda flawed.
Thanks!
I am fairly new to web and am making a page I am happy with, however I am wonding if my method is flawed. Currently what I do is load everything into a monster sized sting in my php script like:
Code:
function printContent(){
$string = "\n<div id='" . $someID . "\n'>" . $content . "\n</div>\n";
$string .= "more stuff here...";
echo $string;
}
my eventual intent is to load all these strings into a SQL database and query them out (entire divs, and divs inside of divs!), and am wondering if this approach also seems appropriate as well.
Also, my tactic with css for my divs has been to use php to echo a style section into the code like so: "<style>" . $styles . "</style>" >.> which also seems kinda flawed.
Thanks!
Comment