簡體   English   中英

php GLOBALS會話文件

[英]php GLOBALS session file

我正在開發會員系統,遇到麻煩了,通常我只會在這里發布問題,但是我有一個錯誤,我無法解決,並且已經處理了一個多小時了。

我得到的錯誤是:

*解析錯誤:語法錯誤,第10行的/home/ob219/public_html/membership/core/init.php中出現意外的','*

我只是看不到代碼中的錯誤,所以會吸引另一雙眼睛來查看代碼。

    <?php
session_start();

$GLOBALS['config'] = array(
    'mysql' => array(),
        'host' => '#####',
        'username' => '###',
        'password' => 's####',
        'db' => '####'
    ),
    'remeber' => array(
        'cookie_name' => 'hash',
        'cookie_expiry' => 604800
    ),
    'session' => array(
        'session_name' => 'user'
    )
);

spl_autoload_register(function($class) {
    require_once 'classes/' . $class . 'php';
});

require_once 'functions/sanitize.php';

'mysql' => array(),應為'mysql' => array(

$GLOBALS['config'] = array(
   'mysql' => array(
        'host' => '#####',
        'username' => '###',
        'password' => 's####',
        'db' => '####'
    ),
    'remeber' => array(
        'cookie_name' => 'hash',
        'cookie_expiry' => 604800
    ),
    'session' => array(
        'session_name' => 'user'
    )
);
$GLOBALS['config'] = array(
    'mysql' => array(), <===== syntax error here. you don't want the close) and comma

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM