Jump to 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...
Link to comment
https://forums.phpfreaks.com/topic/9324-folder-content/
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]
Link to comment
https://forums.phpfreaks.com/topic/9324-folder-content/#findComment-34379
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
Link to comment
https://forums.phpfreaks.com/topic/9324-folder-content/#findComment-34385
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...
Link to comment
https://forums.phpfreaks.com/topic/9324-folder-content/#findComment-34435
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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