Well i want avatars to automatically add to a page, so once they hit the directory they will automatically upload to the site in a image format. there on the same sever, how would i do this?
Ross

Well i want avatars to automatically add to a page, so once they hit the directory they will automatically upload to the site in a image format. there on the same sever, how would i do this?
Ross
anyone?
Explain please i dont understand what you want to achieve.
Basically you need to get the listings of the directory, then for each image (i presume the folder will just contain images?) add a <img src="$file"> tag around it. The $file would come from the listing of the directory
edit:
http://php.net/manual/en/function.readdir.php
so the code would be something like the 2nd example (i changed it a little)
PHP Code:<?php
if ($handle = opendir('avatar')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..") {
echo "<img src='$file'>\n";
}
}
closedir($handle);
}
?>
Last edited by Blinger$; 12-12-2009 at 12:32 AM.
So im guessing the php file would be in the document with where i want the images put? then the images would be in the same folder?
Ross
Want to hide these adverts? Register an account for free!