Hi,
I'm having a bit of troulbe with passing arrays to an object. Here is what I have:
$template->show(
"step2_signup.tmpl",
array(
"WHERETO" => $_SERVER["PHP_SELF"],
"STYPE" => $stype,
"REQID" => $reqid,
"REQNAME" => $reqname
)
);
The function is:
class Templates {
function show ($template, $tag) {
$file = fopen ($template, "r") or die($error_string());
while (!feof($file)) {
$line_in = fgets($file, 1024);
$line_out .= $line_in;
}
foreach ($tag as $name => $value) {
echo str_replace ("#$name#", $value, $line_out);
}
fclose ($file);
}
}
What's happening is $tag is only getting the first item in the array (WHERETO), it is not getting the other 3 values. When echoing the $name in the foreach as a test, it only displays WHERETO.
Is there something I'm doing wrong? Any help is appreciated...