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
https://forums.phpfreaks.com/topic/96358-displaying-users-uploaded-images/
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>

Archived

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

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