0

I am using ajax to make my website's menu bar, but the menu doesn't show and I get this error:

PHP Parse error:  syntax error, unexpected '[' in /home/mtahayac/public_html/ajax/ajax_render_menu.php on line 8

Here is the code:

equire_once("../functions/functions_logs.php");
//require_once '../functions/functions_player.php';
//Main menu
$menu = array();
//Home
array_push($menu, ["Home", "index.php", "_self"]);
//Forums
array_push($menu, ["Forums", "http://forum.mydomain.com", "_blank"]);
array_push($menu, ["Refer a friend", "refer-a-friend.php", "_self"]); //Referrer
//UCP
if(isset($_SESSION['username']) ){
    array_push($menu, ["UCP", "ucp.php", "_self"]);
}
//Logs
if(isset($_SESSION['groups']) and canUserAccessLogs($_SESSION['groups'])){
    array_push($menu, ["Logs", "logs.php", "_self"]);
}

//Library
array_push($menu, ["Library", "library.php", "_self"]);
array_push($menu, ["Statistics", "stats.php", "_self"]);
array_push($menu, ["Support Center", "support.php", "_self"]);
//Donate
array_push($menu, ["Donate", "donate.php", "_self"]);

if(!isset($_SESSION['username']) or !$_SESSION['username']){
    array_push($menu, ["Register", "register.php", "_self"]); //Register
}

Any ideas?

Thanks.

I wrestled a bear once.
  • 22,983
  • 19
  • 69
  • 116
GeorgeDG
  • 7
  • 4

0 Answers0