Bootstrap 4 navbar dropdown items (Subcategories) are displayed in localhost but not in server

Viewed 49

The problem is that categories dropdowns and sub-categories dropdown items are displayed on the localhost but not on the site server and even are not displayed as links.

https://i.stack.imgur.com/VhQGH.png https://i.stack.imgur.com/B8WLd.png

My navbar code is as follows:

               <?php             
            mysqli_set_charset($con, 'utf8');
            $no_of_records_per_page = 20;
            $offset = ($pageno - 1) * $no_of_records_per_page;
            $total_pages_sql = "SELECT COUNT(*) FROM tblposts";
            $result = mysqli_query($con, $total_pages_sql);
            $total_rows = mysqli_fetch_array($result) [0]; 
            $total_pages = ceil($total_rows / 
$no_of_records_per_page);
            $query=mysqli_query($con,"select tblposts.id as 
pid,tblposts.PostTitle as posttitle from tblposts left join 
tblcategory on tblcategory.id=tblposts.CategoryId left join 
tblsubcategory on  
tblsubcategory.SubCategoryId=tblposts.SubCategoryId ");
            while ($row=mysqli_fetch_array($query))
            {
             } ?>
<!-- navbar -->
<nav class="navbar navbar-expand-lg navbar-dark text-right fixed-top 
px-0 animated wow slideInDown  border-bottom border-danger" 
style="background-color:rgb(51,104,202);margin-bottom:200px;">                   
        
<!-- Collapse button -->
<button class="navbar-toggler collapsed" type="button" data- 
   toggle="collapse" data-target="#basicExampleNav" aria- 
   controls="basicExampleNav" aria-expanded="false" aria- 
label="Toggle 
navigation">
    <span class="navbar-toggler-icon ml-0"></span>
</button>      
    
<!-- Collapsible content -->
<div class="navbar-collapse collapse" id="basicExampleNav">
    <!-- Links -->
    <a class="nav-link small text-white pt-3 mr-4" 
href="index.php">خانه <span class="sr-only">(current)</span></a>                
    <?php
    $sql=mysqli_query($con,"select * from tblcategory");
    while($row=mysqli_fetch_array($sql))
    {
    $catname=$row['CategoryName'];
    $catid=$row['id'];
    ?>   
    <ul class="navbar-nav color-block-dark" style="margin- 
    right:100px;">    
        <!-- Dropdown -->
        <li class="nav-item dropdown mt-4" style="paddingx:);">
            <a class="nav-link dropdown-toggle small pt-0 pl-0 mb-1" 
    data-toggle="dropdown" style="margin-left:0 !important;" aria- 
   haspopup="true" aria-expanded="false"><?php echo $catname?></a>
                <?php
                $sql2=mysqli_query($con,"select tblposts.id as 
pid,tblposts.PostTeller as postteller,tblposts.PostTitle as 
posttitle,tblposts.PostSummary as 
postsummary,tblposts.PostImage,tblcategory.CategoryName as 
category,tblcategory.id as cid, tblSubcategory.CategoryId as 
categoryid, tblsubcategory.Subcategory as 
subcategory,tblposts.PostDetails as postdetails,tblposts.PostingDate 
as postingdate,tblposts.PostUrl as url from tblposts left join 
tblcategory on tblcategory.id=tblposts.CategoryId left join  
tblsubcategory on  
tblsubcategory.SubCategoryId=tblposts.SubCategoryId where 
 tblposts.Is_Active=1 and posttitle1=0 and 
tblsubcategory.categoryid='$catid' ");
                ?>
            <div class="dropdown-menu text-right" aria- 
   labelledby="basicExampleNav1">
                <?php
                while($row2=mysqli_fetch_array($sql2))
                {
                ?>
                <a class="dropdown-item text-white text-small" 
href="news-details.php?nid=<?php echo htmlentities($row2['pid']) ?>"> 
<?php echo $row2['subcategory'];?></a>
                <?php } ?>
            </div>
        </li>
    </ul>
    <?php  } ?>
    <a class="nav-link small text-white mt-2 " href="about-us.php" 
style="margin-left:0;">در باره ما <span class="sr-only">(current)</span> 
   </a>
    <a class="nav-link small text-white mt-2" href="contact-us.php" 
    style="margin-left:0;">تماس با ما <span class="sr-only">(current) 
   </span> 
   </a>     
    <!-- Links -->
    </div>
    
    <!-- Collapsible content -->
    </nav>
    <!--/.Navbar--> 
0 Answers
Related