Jump to content


Photo

folder content


  • Please log in to reply
3 replies to this topic

#1 techker

techker
  • Members
  • PipPipPip
  • Advanced Member
  • 748 posts

Posted 08 May 2006 - 06:06 PM

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...

#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 08 May 2006 - 06:53 PM

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


#3 techker

techker
  • Members
  • PipPipPip
  • Advanced Member
  • 748 posts

Posted 08 May 2006 - 07:19 PM

[!--quoteo(post=372365:date=May 8 2006, 06:53 PM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ May 8 2006, 06:53 PM) View Post[/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
if ($handle = opendir('.')) 
{
 while (false !== ($file = readdir($handle))) 
{ 
if ($file != "." && $file != "..") 
{ 
echo "<img src='". $file."'>";
} 
}
closedir($handle); 
}
[/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


#4 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 08 May 2006 - 09:39 PM

Like this:

<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>


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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users