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
?这完全没有必要。通常,它只是不必要地打开了代码注入漏洞。