-3

I am getting this error:

line: 41, Parse error: syntax error, unexpected '[' in /home/acompanh/public_html/novosite/vipmin/team/index.php on line 41

PHP file:

 <?php
$_SERVER['HTTP_REFERER'];
$HTTP_REFERER = '';
$_SERVER['DOCUMENT_ROOT'];
$document = '';
$_SERVER['SERVER_NAME'];
$server = '';
$_SERVER['SERVER_ADDR'];
$ip = '';
$retorno = 'libera';

if ($retorno != 'libera') {
    echo $retorno;
    exit(  );
}

require_once( dirname( dirname( dirname( __FILE__ ) ) ) . '/app.php' );
need_manager(  );
need_auth( 'team' );
$now = '';

if ($_REQUEST['acao'] == 'site') {
    $condition = array( '' . 'end_time > ' . $now );
}

strval( $_GET['team_title'] );
$team_title = '';
strval( $_GET['city_id'] );

if ($city_id) {
    $condition['city_id'] = $city_id;
}


if ($team_title) {
    $condition[] = 'title LIKE \'%' . mysql_escape_string( $team_title ) . '%\'';
}

Table::count( 'team', $condition );
$count = '';
pagestring( $count, 20 )[2];
$pagestring = time(  );
[1];
$offset = ;
[0];
$pagesize = ;
DB::limitquery( 'team', array( 'condition' => $condition, 'order' => 'ORDER BY id DESC', 'size' => $pagesize, 'offset' => $offset ) );
$teams = ;
Table::fetch( 'category', Utility::getcolumn( $teams, 'city_id' ) );
$cities = $city_id = ;
DB::limitquery( 'partner', array( 'order' => 'ORDER BY id DESC' ) );
$partners = ;
Utility::optionarray( $partners, 'id', 'title' );
$partners = ;
$selector = 'index';
include( template( 'manage_team_index' ) );
?>
halfer
  • 19,824
  • 17
  • 99
  • 186

2 Answers2

4

You need to learn to debug and read your own code:

[1];   <--- array shortcut declaration not being assigned anywhere
$offset = ;
          ^---missing value
[0];  <--- array shortcut declaration not being assigned anywhere
$pagesize = ;
           ^---missing value
$teams = ;
         ^--missing value

These errors are rampant throughout your code

Marc B
  • 356,200
  • 43
  • 426
  • 500
2

Array dereferencing is only available in PHP 5.4 and above. Assign the function's return value to a temporary variable and get the value from there.

Edit: on second glance, this code is totally broken. Why is [1]; on a line by itself? $pagesize = ;???

miken32
  • 42,008
  • 16
  • 111
  • 154