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 "File is too big !
\n"; exit; }
if (($HTTP_POST_FILES['userfile']['type']=="image/gif") || ($HTTP_POST_FILES['userfile']['type']=="image/pjpeg") || ($HTTP_POST_FILES['userfile']['type']=="image/jpeg")) {
if (file_exists($path . $HTTP_POST_FILES['userfile']['name'])) {
echo "There already exists a file with this name, please rename your file and try again
\n"; exit; }
$res = copy($HTTP_POST_FILES['userfile']['tmp_name'], $path .$HTTP_POST_FILES['userfile']['name']);
if (!$res) { echo "Didn't work, please try again
\n"; exit; } else {
?>