2014-09-05 122 views
-1

「的語法錯誤,意外T_CONSTANT_ENCAPSED_STRING」這樣的錯誤面對我瞭解,一些與報價 而這僅僅是沒有到過是不是有什麼不工作可能是什麼問題語法錯誤,意想不到的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

所有語言都有語法。這是什麼語言? – chepner 2014-09-05 14:51:42

+0

它寫在php – 2014-09-05 14:52:59

+0

使用'...'submit'&& $ key ...'而不是'...'submit'AND $ key ...' – Justinas 2014-09-05 14:55:47

回答

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(); 
     } 
    } 
} 
+0

所有發生的感謝 – 2014-09-05 15:02:58

+0

您歡迎@ gogl35 – 2014-09-05 15:05:25

相關問題