Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/236.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 分析错误:语法错误,意外'';_Php - Fatal编程技术网

Php 分析错误:语法错误,意外'';

Php 分析错误:语法错误,意外'';,php,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['use

哈罗

我有这个剧本:

<?
  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']."'");
?>

第一眼看到你。。。错误可能在传递给函数eval()的代码中


注意:我不使用函数eval()。它会导致难以发现的隐藏错误

你为什么在这里使用
eval
?这完全没有必要。通常,它只是不必要地打开了代码注入漏洞。