-6
<?php
if(!defined('AccessPermitted')){
    die('Direct access not permitted!');
}

$users = array(
    'root' => '$2y$10$S4I6KYGRJchekcNvFOVOhOsQTP9wPafrKAbh95VxAhyC6iJ6GzwUq',
    'ceo' => '$2y$10$EO84saam8Y7bir7wVLwrJOA5Pp5tBJKQyfq0vr10jsNWS5FpgfRvO',
    'test123' => '$2y$10$OrspF.C5MwQShdVjhgmsSOi67k3/OF/05wbQa4fHZEa8vtoFzwnty'
);

$admins = array(
    'root'
);

$staff = array(
    'ceo'
);

$tools = array(
    'xtr3m3' => array(
        'root',
        'ceo',
        'test123'
    );
);

I'm having trouble with the above-standing code. It says it's an error, but I think it's just bullshitting... I really don't know how to fix this... Thanks in advance! And yes, I want the login to use an array, I don't want any DataBases.

  • [*"An array can be created using the array() language construct. It takes any number of **comma-separated** key => value pairs as arguments."*](http://php.net/manual/en/language.types.array.php) – Rizier123 Feb 28 '17 at 13:48
  • $tools = array( 'xtr3m3' => array( 'root', 'ceo', 'test123' ); ); – Mani7TAM Feb 28 '17 at 13:49
  • 4
    "I think the computer is bullshitting" the computer usually doesnt make mistakes. like 99% of them are the user. – castis Feb 28 '17 at 13:54

1 Answers1

0

Before last line you have ; character which is invalid.

$tools = array(
    'xtr3m3' => array(
        'root',
        'ceo',
        'test123'
    );
);

should be

$tools = array(
    'xtr3m3' => array(
        'root',
        'ceo',
        'test123'
    )
);
unalignedmemoryaccess
  • 7,246
  • 2
  • 25
  • 40
  • Hmm, thanks, but now it says, 'Direct Access not Permitted', but I defined 'DirectAccess' – DataBuster Feb 28 '17 at 13:49
  • I don't see where it is call to `define('AccessPermitted')` in your code. Basically, your error was fixed, you can mark asnwer as correct. Your next problem is based on your structure of program. – unalignedmemoryaccess Feb 28 '17 at 13:50
  • It's in the login.php, which contains this: `define('AccessPermitted', TRUE); include('./inc/php/arrays.php');` – DataBuster Feb 28 '17 at 13:51