Hello,
I am very new to PHP and have been pulling out my hair over this problem. A friend of mine put together this site for me and up until recently it was working fine. Now all the links are mucked up and the site doesn't work as it should!
I think that the problem lies with this part of the code, can anyone help?
The URL to look at is http://www.andoverpool.co.uk/index.php?ua=division_list , I am completely stuck.
// Prints the warnings for unresolved variable references
// in template files. Used if STRICT is true
function show_unknowns ($Line)
{
$unknown = array();
if (ereg("([A-Z0-9_]+)",$Line,$unknown))
{
$UnkVar = $unknown[1];
if(!(empty($UnkVar)))
{
@error_log("[FastTemplate] Warning: no value found for variable: $UnkVar ",0);
}
}
} // end show_unknowns()
// ************************************************************
// This routine get's called by parse() and does the actual
// {VAR} to VALUE conversion within the template.
function parse_template ($template, $tpl_array)
{
while ( list ($key,$val) = each ($tpl_array) )
{
if (!(empty($key)))
{
if(gettype($val) != "string")
{
settype($val,"string");
}
$template = ereg_replace("{" . $key. "}","$val","$template");
//$template = str_replace("{$key}","$val","$template");
}
}
if(!$this->STRICT)
{
// Silently remove anything not already found
$template = ereg_replace("([A-Z0-9_]+)","",$template);
}
else
{
// Warn about unresolved template variables
if (ereg("([A-Z0-9_]+)",$template))
{
$unknown = split("\n",$template);
while (list ($Element,$Line) = each($unknown) )
{
$UnkVar = $Line;
if(!(empty($UnkVar)))
{
$this->show_unknowns($UnkVar);
}
}
}
}
return $template;
} //end parse_template();