Nathanus Nathanus - 2 months ago 5
PHP Question

can't understand this parsing issue

I'm trying to create a dynamic header(navigation) bar, like an include file, but I'm getting an parsing error, for which i can't seem to find an solution, the error is:


Parse error: syntax error, unexpected '?' in C:\wamp\www\ucp\admin\header.php on line 15


This is the header file:

<?php
session_start();
include('functions.php');

$username = $_SESSION['login_admin'];
$username=mysqli_real_escape_string($con, $username);

echo '

<div class="cp_text">
<h3>ADMIN CONTROL PANEL</h3>

</div>

<div class="izbornik">
<a href="pocetna.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-home fa-2x"></i></div><div class="texttipka">HOME</div></div></a>
<a href="addnews.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-plus-square-o fa-2x"></i></div><div class="texttipka">DODAJ VEST</div></div></a>
<a href="listaigraca.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-users fa-2x"></i></div><div class="texttipka">LISTA IGRACA&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">' <?php echo GetPlayersCount($con); ?> '</span></div></div></a>
<a href="oglasi.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-newspaper-o fa-2x"></i></div><div class="texttipka">LISTA OGLASA&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">'<?php echo GetAdCount($con); ; ?>'</span></div></div></a>
<a href="alltickets.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-question-circle fa-2x"></i></div><div class="texttipka">SUPPORT TIKETI&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">'<?php echo GetTicketCount($con); ;?>'</span></div></div></a>
<a href="stats.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-bookmark fa-2x"></i></div><div class="texttipka">ZAHTEVI ZA UNBAN</div></div></a>
<a href="stats.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-credit-card fa-2x"></i></div><div class="texttipka">BILLING LISTA</div></div></a>
<a href="stats.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-adn fa-2x"></i></div><div class="texttipka">DODAJ UREDNIKA</div></div></a>
<a href="pocetna.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-forumbee fa-2x"></i></div><div class="texttipka">FORUM</div></div></a>
<a href="logout.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-close fa-2x"></i></div><div class="texttipka">LOGOUT</div></div></a>
</div>

';

?>

Answer

You didn't concatenate inside the echo...change the function calls and echos inside these lines:

<a href="listaigraca.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-users fa-2x"></i></div><div class="texttipka">LISTA IGRACA&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">' <?php echo GetPlayersCount($con); ?> '</span></div></div></a>
<a href="oglasi.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-newspaper-o fa-2x"></i></div><div class="texttipka">LISTA OGLASA&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">'<?php echo GetAdCount($con); ; ?>'</span></div></div></a>
<a href="alltickets.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-question-circle fa-2x"></i></div><div class="texttipka">SUPPORT TIKETI&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">'<?php echo GetTicketCount($con); ;?>'</span></div></div></a>

to

<a href="listaigraca.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-users fa-2x"></i></div><div class="texttipka">LISTA IGRACA&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">' . GetPlayersCount($con) . '</span></div></div></a>
<a href="oglasi.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-newspaper-o fa-2x"></i></div><div class="texttipka">LISTA OGLASA&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">' . GetAdCount($con) . '</span></div></div></a>
<a href="alltickets.php"><div class="tipka"><div class="slika"><i style="text-align: center; width: 25px;" class="fa fa-question-circle fa-2x"></i></div><div class="texttipka">SUPPORT TIKETI&emsp;<span class="_51lp _5ugg _5ugh _3-99" id="u_0_1a">' . GetTicketCount($con) . '</span></div></div></a>

Don't nest <?php echo $x ?> inside an already existing <?php ?>