IMAGE

<form method="post" enctype="multipart/form-data" name="image_upload_form" action="uploadgo.php" id="myform">
<br />

IMAGE
<input type="file" name="image_file" size="60" id="image_file">

<br />
<br />
<input type="submit" value="GO" name="action">
</form>

////////////////////////////////////////////////////////////////////////

////////// UPLOAD THE IMAGE TO THE FOLDER /////////////

//print_r($_POST);

unset($imagename);

if(!isset($_FILES) && isset($HTTP_POST_FILES)) { $_FILES = $HTTP_POST_FILES; }

if(!isset($_FILES['image_file'])) { $error["image_file"] = "An image was not found."; }

//print_r($_FILES);

$imagename = basename($_FILES['image_file']['name']);
//echo ('IMAGENAME = ' . $imagename);

if(empty($imagename)) { echo("The name of the image was not found."); }

$newimageloc = "img/" . $imagename;

$resultimage = @move_uploaded_file($_FILES['image_file']['tmp_name'], $newimageloc);

if(empty($resultimage)){
echo("There was an error moving the uploaded image.");
} else { echo('IMAGE UPLOADED SUCCESSFULY! <br /><br /><br />'); }