PHP Code:
<?php
echo('Image upload:
<FORM ENCTYPE="multipart/form-data" ACTION="' . $PHP_SELF . '" METHOD="POST">
Choose an image: <INPUT TYPE="file" NAME="userfile">
<INPUT TYPE="submit" VALUE="Upload">
</FORM>');
$path = "img/";
$max_size = 200000;
if (!isset($HTTP_POST_FILES['userfile'])) exit;
if (is_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'])) {
if ($HTTP_POST_FILES['userfile']['size']>$max_size) { echo "The file is too big<br />"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/png")) {
if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) { echo "This image is already uploaded.<br />"; exit; }
$res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .
$HTTP_POST_FILES['userfile']['name']);
if (!$res) { echo "Error!<br />"; exit; } else { echo "The image was uploaded!<br />"; }
echo "Name: ".$HTTP_POST_FILES['userfile']['name']."<br />";
echo "Size: ".$HTTP_POST_FILES['userfile']['size']." bytes<br />";
echo "File type: ".$HTTP_POST_FILES['userfile']['type']."<br />";
echo "Image url: <textarea cols=\"40\">http://YOURSITE.COM/img/".$HTTP_POST_FILES['userfile']['name']."</textarea><br />";
echo "Preview: <img src=\"http://YOURSITE.COM/img/".$HTTP_POST_FILES['userfile']['name']."\"><br />";
} else { echo "You can upload only images!<br />"; exit; }
}
$my_file = $HTTP_POST_FILES['userfile']['name'];
?>
For the script to work you need to create a folder called
img. You also need to change http://YOURSITE.COM to your website's link 
The script is made by me for one of my websites but I decided to share it with you
Good luck using it
Post here if you have any questions 