Jump to content

displaying users uploaded images


brad12345

Recommended Posts

hi all

 

Is anyone able to show me a tutorial that can help me with this problem or some guidance

 

I want to be able to display my uploaded images on their own unique page that php will create automatically and assign the relevant images to so im not having to hard code the html to display the content i want which takes forever, i can allready upload images to my desired new folder using php now i want to have them automatically displayed.

 

Its a realestate website so that might give you a better grasp of what i am wanting. So when i have a new property for sale it can be uploaded quickly to my site.

 

 

 

 

Link to comment
Share on other sites

this is what i used for mine

 

<?php

$NBFile=0;
$dir ="SET THE LOCATION OF FILES";

if ($handle = opendir($dir)) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
$FileArray[] = $dir."/".$file;
$NBFile=$NBFile+1;
}
}

closedir($handle);
?><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<table align="center"><tr>
<?php
$NBPicswidth=1;
$NBPics=0;
for ($i=0; $i<$NBFile; $i++) {
$Pic_Name1=$FileArray[$i];
?><td class="image">
<img src="<?php echo $Pic_Name1; ?>" width="100" border="0" align="top">
 </td></tr>
 <?php
$NBPics=$NBPics+1;

if ( $NBPics==$NBPicswidth ) { $NBPics=0; ?>
<?php }
}
?></table>
</body>
</html>

Link to comment
Share on other sites

no just into folders i specify and create when i upload the images

thats all i do, and i just pass a variable to that page so that it knows what folder to look in for the images :)

 

its a good little script, totally generates on the fly, so there is no messing about :)

Link to comment
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.