2015-10-28 38 views
0

致命錯誤重新分配自動全局變量_POST:不能重新分配自動全局變量_POST當我安裝的WordPress主題致命錯誤:不能當我安裝WordPress主題

PHP版本5.4.41

獲取以下錯誤: - 致命錯誤:無法在1360行中的/public_html/linuxnlinux.com/wp-content/themes/Answers_v1.2/Answers/library/functions/custom_functions.php中重新分配自動全局變量_POST

1360行的代碼是: -

} 

function get_user_name($uid) 
{ 
    global $wpdb; 
    return $wpdb->get_var("select display_name from $wpdb->users where ID=\"$uid\""); 
} 

function veryfy_login_and_proced($_POST,$redirecturl = '') // 1360 line 
{ 
    $secure_cookie = ''; 
    if (!empty($_POST['log']) && !force_ssl_admin()) { 
     $user_name = sanitize_user($_POST['log']); 
     if ($user = get_userdatabylogin($user_name)) { 
      if (get_user_option('use_ssl', $user->ID)) { 
       $secure_cookie = true; 
       force_ssl_admin(true); 
      } 
     } 
    } 

回答

0

超級全局變量是不允許的,因爲PHP用作參數的函數5.4
http://php.net/manual/en/language.variables.superglobals.php#112184

所以,你的功能需求是這樣的:
function veryfy_login_and_proced() // 1360 line

然後你可以通過你的參數在函數內部。
希望有所幫助。

+0

您還可以檢查Wordpress Codex [鏈接](http://codex.wordpress.org)以獲得更多關於wordpress -inging的信息 –

+0

感謝samuel網站在進行了上述更改之後得到了工作。 –

+0

很高興爲您提供幫助!你能將這個問題標記爲答案嗎? –