FrancescoRossi Posted May 13, 2021 Share Posted May 13, 2021 <ul class="navbar-nav me-auto mb-2 mb-lg-0"> <li class="nav-item"> <?php if(str_contains($p, 'home')) echo '<a class="nav-link active " aria-current="page" href="../p/home.php">首页</a>'; else echo '<a class="nav-link " aria-current="page" href="../p/home.php">首页</a>'; ?> </li> <li class="nav-item"> <?php if(str_contains($p, 'cat=11')) echo '<a class="nav-link active" href="../p/itemlist.php?cat=11">限时折扣</a>'; else echo '<a class="nav-link" href="../p/itemlist.php?cat=11">限时折扣</a>'; ?> </li> <li class="nav-item"> <a class="nav-link" href="../p/home.php">新品上架</a> </li> <li class="nav-item"> <a class="nav-link" href="../p/categoria.php">商品分类</a> </li> <li class="nav-item"> <a class="nav-link" href="../includes/data_entry/home.php">联系方式</a> </li> </ul> the last tag i got in my page is ' <li class="nav-item"> </li> ' so i think the problem is the tag <?php ?> in the middle of the html codes. Any solution? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.