automatically generate new pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
lenucks
Forum Newbie
Posts: 2
Joined: Thu Mar 13, 2008 12:08 am

automatically generate new pages

Post by lenucks »

i'm new to php and i was trying to make a simple script to automatically input images and thumbnail them for me. I also want the script to make a new page after the image count reaches a certain number.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: automatically generate new pages

Post by Christopher »

Post what you have done so far.
(#10850)
lenucks
Forum Newbie
Posts: 2
Joined: Thu Mar 13, 2008 12:08 am

Re: automatically generate new pages

Post by lenucks »

here is what i've done so far. It's a bit messy but i'm still learning php. This code so far opens and reads a directory on my server then it generates the html code needed for making 100x100 thumbnails and links them to the full size image.

<?
$path = "gallery";
$dir = opendir($path);
$image = "<img src =\"";
$thumb = "width = 100, height = 100";

while($name = readdir($dir))
{
if(($name != ".") && ($name != ".."))
{
$link = "<a href=\"/gallery/$name\">$image /gallery/$name\"$thumb></a>";
echo "$link";
}
}
closedir($dir);

?>
Post Reply