面对这样一个错误“语法错误,意外的T_CONSTANT_ENCAPSED_STRING”我理解带引号的东西 而那只是没有被访问不是什么不起作用可能是什么问题
if (!session_admin ())
{
@header ('Location: ' . $CONFIG['SITE_URL']);
}
if (($_POST['Action'] == 'Save' AND $_POST['submit']))
{
foreach ($_POST as $key => $value)
{
---> if ((($key != 'submit' AND $key != 'Action') AND $key != 'selectedtab') AND !isset ('key'))
{
if ((($key == 'SITE_TEMPLATE' AND $value != $CONFIG['SITE_TEMPLATE']) AND !$recache))
{
$recache = true;
}
$SQL = 'UPDATE ' . $_settings . ' SET value=\'' . $value . '\' WHERE setting=\'' . $key . '\'';
}
$$fieldname = trim ($value);
}
$Success[] = 'Site settings updated successfully.';
if ($recache)
{
@header ('Location: ' . @get_link ($cur_page . '?recache=true'));
}
else
{
if ((!$Error AND $CONFIG['caching_status']))
{
empty_cache_folder ();
}
}
}
答案 0 :(得分:0)
以下内容无效
!isset ('key'))
将其替换为
!isset($key))
我还整理了你的代码,使其更具可读性。
<?php
if (!session_admin()) {
//Try not to suppress errors, but handle them instead
@header('Location: ' . $CONFIG['SITE_URL']);
exit; //Always kill the script after issuing a header('Location
}
if (($_POST['Action'] == 'Save' AND $_POST['submit'])) {
foreach ($_POST as $key => $value) {
if ((($key != 'submit' AND $key != 'Action') AND $key != 'selectedtab') AND !isset($key)) {
if ((($key == 'SITE_TEMPLATE' AND $value != $CONFIG['SITE_TEMPLATE']) AND !$recache)) {
$recache = true;
}
$SQL = 'UPDATE ' . $_settings . ' SET value=\'' . $value . '\' WHERE setting=\'' . $key . '\'';
}
$fieldname = trim($value);
}
$Success[] = 'Site settings updated successfully.';
if ($recache) {
//Try not to suppress errors, but handle them instead.
@header('Location: ' . @get_link($cur_page . '?recache=true'));
exit; //Always kill the script after issuing a header('Location
} else {
if ((!$Error AND $CONFIG['caching_status'])) {
empty_cache_folder();
}
}
}