锚标签在php代码中不起作用

时间:2017-10-22 14:51:04

标签: php html ajax

我使用Php和AJAX制作了实时通知系统。在我的通知中,它包含一个重定向链接供管理员审核。

      - >                 

<a class="img-responsive" rel="home" href="index.php"> 
      <img src="img/cbsua.png" style="height: 50px; padding: 2px ;">
</a>

<a class="navbar-brand" href="index.php">CBSUA Livestream</a>
<div class="collapse navbar-collapse" id="navbarNavDropdown">
  <ul class="navbar-nav mr-auto">
     <li class="nav-item active">
       <a class="nav-link" href="index.php"><i class="fa fa-home" aria-hidden="true"></i> Home</a>
     </li>
     <li class="nav-item">
       <a class="nav-link" href="library.php"><i class="fa fa-folder" aria-hidden="true"></i> Library</a>
     </li>
     <li class="nav-item">
       <a class="nav-link" href="question.php"><i class="fa fa-question-circle" aria-hidden="true"></i> Ask A Question</a>
     </li>
      <li class="dropdown ">
        <a href="" class="dropdown-toggle nav-link" data-toggle="dropdown">
          <span class="badge badge-pill badge-danger count" style="border-radius:10px;"></span>
          Notification
          <ul class="dropdown-menu" style="padding: 2px;"></ul>
        </a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="logout.php" data-toggle="modal" data-target="#logoutModal"><i class="fa fa-user" aria-hidden="true"></i> <?php echo $_SESSION['User']; ?></a> </li>

</ul>

这是我从数据库中获取所有数据的方法:https://pastebin.com/5Wam23uB

if (mysqli_num_rows($result) > 0) {
            while ($row = mysqli_fetch_array($result)) {
                $id = $row['questId'];

                $output .= '
                    <li>
                        <strong><a href="question.php?id='.$id.'">'.$row["sender"].'</a></strong><br>
                        <small><em>'.$row["question"].'</em></small>
                    </li>
                ';
            }
        }

这不起作用。输出变量中的锚标记。当我点击通知系统中的假设链接时,没有任何反应。

This is a sample image of my notification. The bold one is where I should click and redirect me to a new url. But nothing happens.

0 个答案:

没有答案