Jump to content

Pic Gallery.. issues..


Thadeus

Recommended Posts

Hello,

 

I am trying to make a picture gallery for my website but i am having a problem with the size of the pictures.

When i go to the picture gallery i want to see the pictures that i have stored in the pictures file, in a small scale and not in full resolution. My problem is that i have managed to create this picture gallery but i have failed in seeing the pictures in a small scale. So when i go to the picture gallery i see all of my pictures in full resolution. Imagine how that is. :P

 

The code i use is:

 

<?php

    $pics= ("pics/");

    $cols= 4;

 

 

    if ($handle = opendir($pics))

    {

        while (FALSE !== ($file= readdir($handle)))

        {

            if ($file != "." && $file != ".." && $file != rtrim($pics, "/"))

            {

                $files[]=$file;

            }

        }

        closedir($handle);

    }

 

$colsCtr= 0;

 

echo '<table width="100%" cellspacing="10"><tr>';

 

foreach($files as $file)

{

    if ($colsCtr%$cols == 0)

        echo '</tr><tr><td colspan="2"><hr /></td></tr><tr>';

        echo '<td align="center"><a href="' . $pics . $file . '"><img src="' . $pics . $file . '" /></a></td>';

        $colsCtr++;

}

echo '</table>' . "\r\n";

?>

 

Can some one please tell me what is wrong with the code?

 

Can you please tell me what to add or what to remove so that this works?

 

Please not that i want to see the pictures at small scale first and when i click on each picture see the full resolution.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/215786-pic-gallery-issues/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.