<section>
      <div id="carouselExampleCaptions" class="carousel slide" data-bs-ride="carousel">
  <div class="carousel-indicators">
     <?php $cnt1=0; foreach($slider as $row): $cnt1+=1; ?> 
    <button type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide-to="<?php echo $cnt1-1; ?>" class="<?php if($cnt1==1){ echo 'active'; } ?>" aria-current="<?php if($cnt1==1){ echo 'true'; } ?>" aria-label="Slide 1"></button>

    <?php endforeach;?>
     
  </div>
  <div class="carousel-inner">
    <?php $cnt=0; foreach($slider as $row): $cnt+=1; ?> 
    <div class="carousel-item <?php if($cnt==1){ echo 'active'; } ?>">
      <a href="<?php echo base_url();?>services">
      <img src="<?php echo base_url();?>assets/uploads/slider/<?php echo $row->s_id;?>.jpg"  onerror="this.src='<?php echo base_url();?>assets/default-img.gif'" class="d-block w-100" alt="...">
    </a>
     
    </div>
     <?php endforeach;?>
  
  </div>

  <button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="prev">
    <span class="carousel-control-prev-icon" aria-hidden="true"></span>
    <span class="visually-hidden">Previous</span>
  </button>
  <button class="carousel-control-next" type="button" data-bs-target="#carouselExampleCaptions" data-bs-slide="next">
    <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="visually-hidden">Next</span>
  </button>
</div>

    </section>