Scratch that...I fixed it myself.
Santo, use this function, I use it and it works great for me:
function content(){
global $type;
global $content;
if($type == "plaintxt"){
echo $content;
}
elseif($type == "php"){
eval $content;
}
else {
die();
}
}
This is how I use it:
switch ($pg) {
// --------------------------------
default:
echo "";
$type = "plaintxt";
$content = "a";
$sub_title = "Main";
break;
// --------------------------------
case "main":
echo "";
$type = "plaintxt";
$content = "a";
$sub_title = "Main";
break;
// --------------------------------
case "login":
echo "";
$type = "plaintxt";
$content = "b";
$sub_title = "Login";
break;
// --------------------------------
}
All you have to do is in your switch, define type...if it says 'plaintxt' then it will just echo() what you put for content, but if you put 'php' it will eval() it.
MAKE SURE THAT WHEN YOU USE 'PHP' THAT YOU WRITE IT LIKE YOU WOULD IN HTML!?
example:
If you want to do this:
if($you == "cool"){
echo "I am so cool!";
} else {
echo "I am not so cool";
}
Then you have to do this:
$content = "if($you == \"cool\"){echo \"I am so cool!\";} else {echo \"I am not so cool\";}";
And in your template page just put <? content(); ?> where you want it to appear.
Also, if you want it mixed between plain text and php then you are going to have to echo all the plain text.
I hope it helps...