Today, We want to share with you image slider in php.In this post we will show you image slideshow from database php jquery, hear for PHP image slideshow auto we will give you demo and example for implement.In this post, we will learn about Create Dynamic Image Slider using PHP with jQuery with an example.
How to Create Dynamic Image Slider Using PHP and Bootstrap?
How to upload images using PHP and HTML Form?
HTML Form
Server Side code in PHP
if(isset($_POST["submit"])){ $getImage= basename($_FILES["Image"]["name"]); if($getImage==""){ echo "Please choose"; } else { $target="../sliderImage/"; $ran=time(); $target=$target.$ran.$getImage; $imageName=$ran.$getImage; if($_FILES["Image"]["type"]=="image/jpg"||$_FILES["Image"]["type"]=="image/jpeg"){ move_uploaded_file($_FILES["Image"]["tmp_name"], $target); if(move_uploaded_file){ include_once './slider/slideshowController.php'; $slideshowController=new SlideshowController(); $slideshowController->uploadSlider($imageName,$_POST["Big"],$_POST["Small"]); } else { echo "File is not uploaded"; } } else { echo "Please choose Image"; } } }
slideshowController.php
public function uploadSlider($image,$big,$small){ $insert="Insert into slider (profilepicture,BigText,SmallText) values ('$image','$big','$small')"; $result=$this->query($insert); if($result){ echo "File is uploaded"; } else { echo "File is not uploaded"; } }
show the images slider using PHP and Bootstrap
index.php
listSlider(); ?> Previous Next