Skip to content

The Image gallery developed in basic php and more detail in jQuery AJAX for learning purpose.

Notifications You must be signed in to change notification settings

vrushalrt/image-gallery-in-PHP-jQuery-AJAX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Gallery In PHP jQuery AJAX

Introduction

The Image gallery developed in basic php and more detail in jQuery AJAX for learning purpose.

And here's some code! 👍

To interact with file directory

$dir = "images/";
$files = preg_grep('/^([^.])/', scandir($dir));
$i=1;
<?php foreach ($files as $file) { ?>
	<li>
    	<img id="<?php echo $i; ?>" src="<?php echo $dir."".$file; ?>" alt="img">
    </li>
<?php $i++; } ?>

Image description logic

function setImg(src,id){
                $("#main").attr("src",src);
                var path = "text/" +id+".txt";
                $.get(path,function(data){
                //console.log(data);
               $("#description p").html(data);
     });
    }

Stuff used to make this:

  • jQuery for Image Viewer
  • PHP for file interaction and dynamic web
  • HTML CSS for Image viewer UI
  • XAMPP for Web Server

About

The Image gallery developed in basic php and more detail in jQuery AJAX for learning purpose.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors