hello can some one tell me they best why to make a skinning system for my script as i can not seem to make one that works were i can have {$something} and that $something is php if($hi == 1){echo 'blah'} i know it uses evil but how is it done?

hello can some one tell me they best why to make a skinning system for my script as i can not seem to make one that works were i can have {$something} and that $something is php if($hi == 1){echo 'blah'} i know it uses evil but how is it done?
sorry to post to times but i can not edit the other post :|
i have this code but it dose not work.
index.php
page.phpPHP Code:<?php
$template = file_get_contents( 'page.php' );
$array = array ( 'echo' => 'echo (\'hello\');'
);
// we have to somehow expand the $template variable, but how?
eval("$template");
?>
but the $array["echo"]; dose not show the word hello like it should :\PHP Code:echo 'hello'; $array["echo"];
What exactly are you tryin to acheive, if your first post was in-any sense to me I would of helped you. You can't do this -> $array = array ( 'echo' => 'echo (\'hello\');'
);
Hi, names James. I am a web developer.
Okay i suck at this bit of php what i am trying to do is make a template system were you call the page eg: page.php and it has some txt in it like
are you logged in? {$logged}
and in the index or some were have the $logged set as a if($hi == 1) {echo'yes';} else { echo'no';} or some thing like that
Okay i suck at this bit of php what i am trying to do is make a template system were you call the page eg: page.php and it has some txt in it like
are you logged in? {$logged}
and in the index or some were have the $logged set as a if($hi == 1) {echo'yes';} else { echo'no';} or some thing like thatThats all I think you want...PHP Code:<?php
include_once ( 'header.php' );
if ( $hi === true )
{
$logged = 'yes';
}
else
{
$logged = 'no';
}
include_once ( 'page.php' );
include_once ( 'footer.php' );
?>
Last edited by Protege; 09-07-2008 at 10:42 AM.
Hi, names James. I am a web developer.
okay thats one why of doing it but i am trying to make it small ish i have done it like the array why before and got it to work but i can not rememeber how i done it because i will have a lot of template pages or i could use smarty but do not know.
I have no idea what you are trying to acheive... An echo inside an array?
Hi, names James. I am a web developer.
SMARTY?
http://www.smarty.net/
But it's a template engine.
Want to hide these adverts? Register an account for free!