タイトル、キャプション、画像とともにhtml/jsにカルーセルを作成しました。私はPHPを使用して転送しようとしているが、どのように考えていない。私は5つの行(ID、タイトル、キャプション、画像とリンク)とフィールドに入力データを "カルーセル"という名前の私のデータベース "テスト"のテーブルを作成しましたが、どのようにカルーセルフォーム。カルーセルhtmlからデータベースを使用したPHP
<div class="container">
<div id="myCarousel" class="carousel slide" data-ride="carousel">
<!-- Wrapper for slides -->
<div class="carousel-inner">
<div class="item active">
<img src="../images/aa1.jpg">
<div class="carousel-caption">
<h4><a href="#">Title</a></h4>
<p>Caption Caption Caption Caption <a class="label label-primary" href="#" target="_blank">See More</a></p>
</div>
</div><!-- End Item -->
<div class="item">
<img src="../images/aa2.jpg">
<div class="carousel-caption">
<h4><a href="#">Title</a></h4>
<p>Caption Caption Caption Caption<a class="label label-primary" href="#" target="_blank">See More</a></p>
</div>
</div><!-- End Item -->
<div class="item">
<img src="#">
<div class="carousel-caption">
<h4><a href="#">Title</a></h4>
<p>Caption Caption Caption. <a class="label label-primary" href="#" target="_blank">See More</a></p>
</div>
</div><!-- End Item -->
<div class="item">
<img src="#">
<div class="carousel-caption">
<h4><a href="#">Title</a></h4>
<p>Caption Caption Caption <a class="label label-primary" href="#" target="_blank">See More</a></p>
</div>
</div><!-- End Item -->
<div class="item">
<img src="#">
<div class="carousel-caption">
<h4><a href="#">Title</a></h4>
<p>Caption Caption Caption <a class="label label-primary" href="#" target="_blank">See More</a></p>
</div>
</div><!-- End Item -->
</div><!-- End Carousel Inner -->
<ul class="list-group col-sm-4">
<li data-target="#myCarousel" data-slide-to="0" class="list-group-item active"><h4>Title</h4></li>
<li data-target="#myCarousel" data-slide-to="1" class="list-group-item"><h4>Title</h4></li>
<li data-target="#myCarousel" data-slide-to="2" class="list-group-item"><h4>Title</h4></li>
<li data-target="#myCarousel" data-slide-to="3" class="list-group-item"><h4>Title</h4></li>
<li data-target="#myCarousel" data-slide-to="4" class="list-group-item"><h4>Title</h4></li>
</ul>
<!-- Controls -->
<div class="carousel-controls">
<a class="left carousel-control" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div><!-- End Carousel -->
</div>
これをPHP/SQLに転送して簡単に更新できる方法はありますか?
戦略としては、できるだけPHPでやりたくないことがあり、クライアントサイドのJavaScriptで大げさなことをしているかもしれません。 PHPであらゆることを完璧にしようとすると、HTMLをスケッチして、クライアント上で展開するためのJSONデータを適切なカルーセルに送ることができます。 jQueryには、これを簡単にするプラグインがたくさんあります。 – tadman