解析错误:语法错误,意外';'

时间:2010-03-20 10:15:40

标签: php

我有这个脚本:

<?
  require("lib2/config.inc.php");
  require("lib2/tpl.class.php");
  require("lib2/db.class.php");
  require("lib2/um.class.php");


  $tpl          = new template("templates", "tpl");
  $db         = new db($db['location'], $db['username'], $db['passwort'], $db['database']);
  $um         = new usermanagment();


  /** User login **/

  $checklogin       = $um->check_login();
  $userdata       = $um->getuserdata();

  if(!$checklogin && !$guest) {
    header("LOCATION: ./index2.php");
  }

  eval("\$header .= \" ".$tpl->get("header")."\";");
  eval("\$footer .= \" ".$tpl->get("footer")."\";");

$time     = time();
$db->Query("UPDATE userdaten SET lastaction = '$time' WHERE userid = '".$userdata['userid']."'");
?>

并收到此错误: 解析错误:语法错误,意外';'在/home/httpd/html/login/global.php(22):第96行的eval()代码

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

首先看你......错误可能在传递给函数eval()的代码中。

注意:我不使用函数eval()。它可能导致隐藏的错误,很难找到。