I have saved images in database with URL's. What I am doing is that I am fetching images from database and showing that in the Bootstrap carousel. It works perfectly. But I want to get the URL also so that when someone clicks on image, he/she will be redirected to that URL linked with that image.
Here is coding what I have done for showing images in slider.
<div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="15000">
<!-- Indicators -->
<?php
mysql_connect("localhost","twbpla5_eduardo","[2015]Honor");
mysql_select_db("twbpla5_website_dev");
$query = mysql_query("SELECT * FROM banner");
?>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<?php
while($row=mysql_fetch_array($query))
{
echo '<div class="item"><img src="images/banners/'.$row[image].'" alt="'.$row[image].'"></div>';
}
?>
</div>
<!-- Left and right controls -->
<a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
</a>
<a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
</a>
</div>
<link rel="stylesheet" type="text/css" href="css/carousel.css" />
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#myCarousel .item').first().addClass('active');
$('#myCarousel').carousel();
});
</script>
What should I add in the above code?