dgnzcn Posted July 26, 2016 Share Posted July 26, 2016 Hi to everyone! i write bootstrap dynamic tabs from mysql. But there was problem displaying to active tab's content if i refresh page. active tab content not displaying. but it is showing if i clicked to tabs. i checked <li class="active"> is ok, but <div class="tab-pane fade ? ?"> active in is missing, and then tab content not displaying. How can i fix issue? Thanks. ?php if($_GET['link']){ $link = $_GET['link']; } echo '<div class="row">'; echo '<div class="col-lg-12">'; echo '<ul id="myTab" class="nav nav-tabs nav-justified">'; $sorgula = "select * from tablar WHERE link = '$link' ORDER BY sira ASC"; $liste = mysqli_query($baglan, $sorgula); while ($sonuc = mysqli_fetch_assoc($liste)) { $Tabid = $sonuc['id']; $ikon = $sonuc['ikon']; $isim = $sonuc['isim']; $kisa_aciklama = $sonuc['kisa_aciklama']; $sira1[] = $sonuc['sira']; // $sira1[] değişkenine dönen tüm veriyi dizi olarak aktarır $enkucuksira = min($sira1); $enbuyuksira = max($sira1); if ($enkucuksira != $enbuyuksira) {?> <li class=""><a href="#<?php echo $Tabid;?>" data-toggle="tab"><i class="fa <?php echo $ikon;?>"></i> <?php echo $isim;?></a></li> <?php }else{?> <li class="active"><a href="#<?php echo $Tabid;?>" data-toggle="tab"><i class="fa <?php echo $ikon;?>"></i> <?php echo $isim;?></a></li> <?php }};?> </ul> <div id="myTabContent" class="tab-content"> <?php $sorgula = "select * from tablar WHERE link = '$link' ORDER BY sira ASC"; $liste = mysqli_query($baglan, $sorgula); while ($sonuc = mysqli_fetch_assoc($liste)) { $Tabid = $sonuc['id']; $ikon = $sonuc['ikon']; $isim = $sonuc['isim']; $kisa_aciklama = $sonuc['kisa_aciklama']; $sira1[] = $sonuc['sira']; // $sira1[] değişkenine dönen tüm veriyi dizi olarak aktarır $enkucuksira = min($sira1); $enbuyuksira = max($sira1); if ($enkucuksira != $enbuyuksira) {?> <div class="tab-pane fade" id="<?php echo $Tabid;?>"> <h4> <?php echo $isim;?></h4> <p><?php echo $kisa_aciklama = html_entity_decode($kisa_aciklama, ENT_QUOTES, "utf-8");?></p> </div> <?php }else{?> <div class="tab-pane fade active in" id="<?php echo $Tabid;?>"> <h4><?php echo $isim;?></h4> <p><?php echo $kisa_aciklama = html_entity_decode($kisa_aciklama, ENT_QUOTES, "utf-8");?></p> </div> <?php }};?> <hr> </div> </div> </div> Quote Link to comment https://forums.phpfreaks.com/topic/301640-php-active-tab-active-in-displaying-issue/ Share on other sites More sharing options...
Solution dgnzcn Posted July 27, 2016 Author Solution Share Posted July 27, 2016 i fixed it like this: $Tabid = $sonuc['id'];$ikon = $sonuc['ikon'];$isim = $sonuc['isim'];$kisa_aciklama = $sonuc['kisa_aciklama'];$aktiftab = $sonuc['aktif'];if ($aktiftab == 'evet') Quote Link to comment https://forums.phpfreaks.com/topic/301640-php-active-tab-active-in-displaying-issue/#findComment-1535114 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.