Serge
06-07-2003, 12:42 AM
I'm get a Parse error when I try to run a script could someone please help me. Here is the script:
<?php
////////////////// start template cache ///////////////
function templatecache($templatelist) {
global $templatecache;
$templateslist=str_replace(',', "','", addslashes($templateslist));
$temps=mysql_query("SELECT template,title FROM template WHERE (title IN ('$templatelist')") or
die (mysql_error());
while($temp=mysql_fetch_array($temps)) {
$templatecache["$temp[title]"]=$temp['template'];
}
unset($temp);
mysql_free_result($temps);
/////////////////// Start Gettemplate //////////////////
function gettemplate($templatename) {
global $templatecache;
if(isset($templatecache[$templatename])) {
$template=$templatecache[$templatename];
}
else {
$gettemp=mysql_query("SELECT template FROM template WHERE title='".addslashes($templatename)."'" ) or
die (mysql_error());
$template=$gettemp[template];
}
return $template;
}
?>
The error is Parse error: parse error in /www/worldlinks/members/patrickmcdaniel/admin/functions.php on line 28
Line 28 is the closing tag for php so this is kind of strange to me?
<?php
////////////////// start template cache ///////////////
function templatecache($templatelist) {
global $templatecache;
$templateslist=str_replace(',', "','", addslashes($templateslist));
$temps=mysql_query("SELECT template,title FROM template WHERE (title IN ('$templatelist')") or
die (mysql_error());
while($temp=mysql_fetch_array($temps)) {
$templatecache["$temp[title]"]=$temp['template'];
}
unset($temp);
mysql_free_result($temps);
/////////////////// Start Gettemplate //////////////////
function gettemplate($templatename) {
global $templatecache;
if(isset($templatecache[$templatename])) {
$template=$templatecache[$templatename];
}
else {
$gettemp=mysql_query("SELECT template FROM template WHERE title='".addslashes($templatename)."'" ) or
die (mysql_error());
$template=$gettemp[template];
}
return $template;
}
?>
The error is Parse error: parse error in /www/worldlinks/members/patrickmcdaniel/admin/functions.php on line 28
Line 28 is the closing tag for php so this is kind of strange to me?