无法理解这个解析问题

时间:2016-09-14 15:43:01

标签: php

我试图创建一个动态页眉(导航)栏,就像包含文件一样,但是我得到了一个解析错误,我似乎无法找到解决方案,错误是:

  

解析错误:语法错误,意外'?'在第15行的C:\ wamp \ www \ ucp \ admin \ header.php

这是头文件:

  @Override
public void onVideoTrackAdded(Call call) {
    // Get a reference to your SinchClient, in the samples this is done through the service interface:
    VideoController vc = getSinchServiceInterface().getVideoController();
    View myPreview = vc.getLocalView();
    View remoteView = vc.getRemoteView();
    // Add the views to your view hierarchy
    ...
}

2 个答案:

答案 0 :(得分:3)

问题是你在一个字符串里面有<?php ... ?>个语句,它已经在<?php ... ?>块中。如果您要发送大量HTML,而不是回显它,您可以关闭PHP标记,如下所示:

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

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

?>

<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>

答案 1 :(得分:3)

你没有在echo内部连接...更改这些行中的函数调用和回声:

<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="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>

不要在已存在的<?php echo $x ?>

中嵌套<?php ?>