I'm stomped, this makes no sense. Help please

Ok i am making a simple image upload script. However I am having a problem I can’t figure out.

I have a file called upload.php which works just fine, and then I have my index.php which is almost the same exact code, but does not work!

upload.php:

<?php
$maxSize = 2097152; // Maximum file size is about 2mb.

$types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png");

if(isset($_POST['submit'])) {

    // Files variables
    $file_name    = $_FILES['file']['name']; // File name
    $file_size    = $_FILES['file']['size']; // File size
    $file_type    = $_FILES['file']['type']; // The file type, if we want to upload a determinated type of file
    $file_temp    = $_FILES['file']['tmp_name']; // Our temporary file
    $file_error = $_FILES['file']['error']; // The files errors
    $file_dest    = "images/".time().basename($file_name); // Rename the file, and specify the new location.
    
    if (!in_array($file_type, $types)) {
        $error = "This file type is not allowed!";
        echo $error;
    }

    if($file_size <= $maxSize && empty($error)) {
        if(move_uploaded_file($file_temp, $file_dest)) {
            echo $file_dest;
        } else {
            echo $file_error;
        }
    } else {
        $error = "File is too big!";
        echo $error;
    }


} else {
    // Uploading form
    echo "<form method=\\"post\\" action=\\"upload.php\\" enctype=\\"multipart/form-data\\">
            File to upload: <input type=\\"file\\" name=\\"file\\"> <input type=\\"submit\\" name=\\"submit\\" value=\\"Upload\\">
         </form>";
}
?>

My index.php which is the same thing except for the styling.

<?php
//Below are the settings for the website, you may edit them as you wish.

//Maximum image size we will alllow to be uploaded.
$maxSize = 2097152; // Maximum file size is 2mb.

//Allowed image types stored in an array
$types = array("image/jpg", "image/jpeg", "image/bmp", "image/gif", "image/png");

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href='http://fonts.googleapis.com/css?family=Orbitron:900' rel='stylesheet' type='text/css'>
        <link href='http://fonts.googleapis.com/css?family=Kelly+Slab' rel='stylesheet' type='text/css'>
        <link href="style.css" rel="stylesheet" type="text/css">
        <title></title>
    </head>
    <body>
        <div id="main">
            <h1 class="logo">Easy Image Upload</h1>
            <div class="upload-container">
                <p class="info">File Types Allowed: JPG, GIF, and PNG</p>
                <form name="newad" method="post" enctype="multipart/form-data" action="index.php">
                    <input type="file" class="button" name="image"><br />
                     <input type="submit" class="button color" name="submit" value="Upload">
                 </form>
    <?php

    if(isset($_POST['submit'])) {

    // Files variables
    $file_name    = $_FILES['file']['name']; // File name
    $file_size    = $_FILES['file']['size']; // File size
    $file_type    = $_FILES['file']['type']; // The file type, if we want to upload a determinated type of file
    $file_temp    = $_FILES['file']['tmp_name']; // Our temporary file
    $file_error = $_FILES['file']['error']; // The files errors
    $file_dest    = "images/".time().basename($file_name); // Rename the file, and specify the new location.

    if (!in_array($file_type, $types)) {
        $error = "This file type is not allowed!";
        echo $error;
    }

    if($file_size <= $maxSize && empty($error)) {
        if(move_uploaded_file($file_temp, $file_dest)) {
            echo $file_dest;
        } else {
            echo $file_error;
        }
    } else {
        $error = "File is too big!";
        echo $error;
    }


}
?>
                </div>
        </div>
    </body>
</html>

The problem with index.php is that it shows me the errors that the file is too big and not the correct format, while upload.php processes the same exact file just fine. Someone help please? Here’s the link to the live script… http://leeveo.com/image and http://leeveo.com/image/upload.php

I appreciate any help in advance,
Procode.

I removed the

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
and
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

and it still does not work. Same error.

I wonder if you have fixed the problem? I just uploaded a jpg file and your index.php said it worked.

Have you tried several different files to see if there is something about the specific file that is giving you an error?

The uploader also works for myself too, i just uploaded an image i had sitting around.

http://leeveo.com/image/images/1321496378web-development.jpg

Yes, I have fixed it now, thank you.