However.. I have a problem that someone might be able to help me with, I'm at work so this isn't my actual code but you'll get the basics.
Ok I have the following files for example
Index.php
<?php
include 'functions.php';
$p == '1';
switch ($p)
{
case "1":
createPage();
break;
etc..
}
Page.html
HEADER
<div id="something">
NOTE
</div>
functions.php
function createPage()
{
$output = file_get_contents("page.html");
$replace = array("HEADER","NOTE");
$with = array(include "header.html","Note info");
$output = str_replace($replace, $with, $output);
echo $output;
}
Say I do it like that, if I then want NOTE to say Welcome $user how would I get that data into there because I tried calling it on index.php like
$user = 'Sean'; and include it in my function like a
rray(include "page.html","Note info" . $user)
But it doesn't work like that understandably.. anyone shed some light? Maybe I'm going about this in a bad way, I'm trying!

New Topic/Question
Reply




MultiQuote





|