<?php $imgpath = "http://localhost/imgupload/"; if ($_REQUEST[completed] == 1) { $newname = uniqid("p").".jpg"; move_uploaded_file($_FILES['image']['tmp_name'], "./$newname"); } ?> <html> <head><title>Free Image Hosting</title></head> <body><h1>Image Uploader</h1> <?php if ($_REQUEST[completed] != 1) { ?> <b>Please choose your image</b><br> Max file size : 1.5 Mb<br> <form enctype=multipart/form-data method=post> <input type=hidden name=MAX_FILE_SIZE value=1500000> <input type=hidden name=completed value=1> Image source : <input type=file name=image> <br> <input type=submit value="Upload"></form> <?php } else { ?> <b>Image uploaded !</b> <br> URL : <?php echo $imgpath, $newname; ?> <?php } ?> <hr> Copyright, MediaPlay @ forums.digitalpoint.com </body></html> Code (markup): I hope you will find it useful
I remember some1 in DP has written a very good and absolutely free image hosting script with a LOT of features including image resize, rotate, random image, gallery, and more. Zivem's is nice too =D