Oct 9, 2013

How to Create a Simple Image Gallery Using PHP Script

By With No comments:

It is easy to create a dynamic image galley using php.

Step 1: Create a folder name your gallery name (let myphotogallery).

Step 2: Create a folder inside the gallery (myphotogallery) folder
name (let images)

step 3 : Now we will create a index.php file inside the photogallery
folder and here we will write our php script.

Gallery File Folder Structer :

/photogallery
/photogallery/images
/photogallery/index.php

Upload image in images folder and open index.php using your browser
 you can see your image gallery is ready.
Just upload image on your images folder dont need to modify your
index.php page gallery will be created automatically.

PHP Code :

<?php
/*>>>>>>>>>>>>Gallery Setting>>>>>>>>>>>>>>>>>>*/
$image_dir="images";
$gallery_name="Biswarup Image Gallery";
$thumb_width="320";
$thumb_height="240";
$image_per_row="3";
/*>>>>>>>>>>>>>Generating Gallery>>>>>>>>>>>>>>>>>*/
$images=scandir($image_dir);
$total_images=count($images) - 2;
echo "<center><h3>$gallery_name</h3></center>";
echo "<table align=\"center\">";
$i=0;
$t=0;
foreach($images as $image)
{
        if($image=='.' || $image=='..')
                {
                }
        else
                {
if($i==0)
{
echo "<tr>";
}

                echo "<td valign=\"top\"><img src=\"$image_dir/$image
\" alt=\"$image
\" height=\"$thumb_height\" width=\"$thumb_width\" /></td>";
$i++;
$t++;
if($i==$image_per_row)
{
echo "</tr>";
$i=0;
}

elseif($t==$total_images)
{
echo "</tr>";

}
}
}

echo "</table>";
?>


You can improve this gallery including more feature on
1. Pagination
2. Jquery Effect 


That's all.Share your scripts with us in the comments!

Reliance GSM USSD Codes (Updated)

By With No comments:

Here Is List Of Reliance USSD Codes.


main balance nd validity

*333*1*1*1# 
Last recharge detail
*333*1*2*1#

Activate callertune
*333*3*1*1#
Deactivate callertune
*333*3*1*2#
Activate miscall  alert
*333*3*2*1#
Deactivate miscall alert
*333*3*2*2#



Intermet data nd validity
*333*1*3*1#

 VAS balance
*333*1*4*1#