Jump to content

Archived

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

techker

folder content

Recommended Posts

hey guys i have been looking for something for a long time now.

with my server it is configed so we can view the content of a folder.

now i wold like to view it but in thumb nails.

im building a ringtone site and i have wallpapers that i want to put ,but i don't want to start making thumb nails of each and putting them on a page...lasy

so i want to make so i could direct a page to the folder directly,and i would see the images directly...

now i have been googling it and nothing to be seen!

can somebosy help me please...

Share this post


Link to post
Share on other sites
One very basic example - look it up in the [a href=\"http://www.php.net\" target=\"_blank\"]Manual[/a],
put this in a file in the folder with your images - and call the file
[code]
if ($handle = opendir('.'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
echo "<img src='". $file."'>";
}
}
closedir($handle);
}
[/code]

Share this post


Link to post
Share on other sites
[!--quoteo(post=372365:date=May 8 2006, 06:53 PM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ May 8 2006, 06:53 PM) [snapback]372365[/snapback][/div][div class=\'quotemain\'][!--quotec--]
One very basic example - look it up in the [a href=\"http://www.php.net\" target=\"_blank\"]Manual[/a],
put this in a file in the folder with your images - and call the file
[code]
if ($handle = opendir('.'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
echo "<img src='". $file."'>";
}
}
closedir($handle);
}
[/code]
[/quote]

it gives me errors?

and here is a stupid question,do i put it in the body or before the head?lol

but it gives me this

Parse error: syntax error, unexpected '{' in /home2/techker/public_html/wallpapers_bb/view.php on line 5

Share this post


Link to post
Share on other sites
Like this:
[code]

<head></head>
<body>

Headline info or whatever goes here

<?php

if ($handle = opendir('.'))
{
while (false !== ($file = readdir($handle)))
{
if ($file != "." && $file != "..")
{
echo "<img src='".$file."'>";
}
}
closedir($handle);
}

?>

Footer or whatever goes here

</body>

[/code]

your parse error must be a cut'n paste error or something...

Share this post


Link to post
Share on other sites

×

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.