MyBB Community Forums

Full Version: Image Uploader
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
you could write a simple function to uniquely hash your image names.
<?php
class hasher {
   public $new_photo;
   function generate($photo) {
      $this->new_photo = sha1(md5(hash("sha512", $photo.time().rand())));
      return $this->new_photo;
   }
}

$hash = new hasher;
$hash->generate($the-uploaded-file);
?>
etc...

P.S: excuse any PHP mistakes. I'm currently drowning in jQuery and may have mixed the two up somehow... Forgive my mistakes Toungue
Hmm, you are missing upload directory and a bit more in the code.
I was able to make the img URL shorter ^^ so its 6 digits now letters and numbers. Here is an example:

http://www.*********.com/img1.ak/files/cfm/ei9k56.jpg

I am going to add more goodies into it like option off running it under view.cf/ei9k56.jpg .cf being a MINE Type added to Apache to handle PHP. And I will also try to use mt_rand(1, 10) which will be placed before upload path so it will dump the file in a sub domain server marked img1, img2, img3....... img10 you can add more but you will need to change the number in mt_rand(1, 1000) for example will allow you to drop files into sub domains marked from img1 to img1000 ^^
Pages: 1 2