File uploading problem

When i try this code in Mozilla 10.0.1 then code works fine but when i run this code in IE 8.0 code is not working.
what is the problem?anyone can tell me.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=“Content-Type” content=“text/html; charset=utf-8” />
<title>Untitled Document</title>
</head>
<body>

<form action=“uploading.php” enctype=“multipart/form-data” method=“post”>
Upload image<input type=“file” name=“file” id=“file”/><br />
<input type=“submit” value=“submit” name=“submit”/>
</form>
<?php
if($_POST[‘submit’]){

if($_FILES[‘file’][‘type’]==“image/jpeg” || $_FILES[‘file’][‘type’]==“image/gif” || $_FILES[‘file’][‘type’]==“image/png”){
if($_FILES[‘file’][‘error’]>0)
{
echo “error”;
}
else
{
echo $_FILES[‘file’][‘name’].“<br/>”;
echo $_FILES[‘file’][‘type’].“<br/>”;
echo ($_FILES[‘file’][‘size’]/1024).“<br/>”;
echo $_FILES[‘file’][‘tmp_name’];
$a = $_FILES[‘file’][‘name’];

	if (file_exists($_FILES['file']['name']))
	{
		echo $_FILES['file']['name']." alredy exists";
	}
	else
	{
		move_uploaded_file($_FILES['file']['tmp_name'],$_FILES['file']['name']);
		echo $_FILES['file']['name'];
		echo "&lt;img src='$a'/&gt;";
	}
}

}
else
{
echo “file type wrong”;
}
}
?>

</body>
</html>

@[B][COLOR=#0071D8][URL=“http://www.sitepoint.com/forums/member.php?457080-12345qwer”]12345qwer

[/COLOR][/B]In I.E. 8 what is the error you get? If you don’t get an error then have you put echo/var_dump/print_r statements in your code to determine how far it gets? Have you checked the values in $_POST, and $_FILLES?

Steve

This code is insecure, it would be easy for an attacker to upload and execute a malicious file.

@EastCoast
i know this code is insecure but i am in learning stage of php,

@ServerStorm
if statement is not working correctly, IE displaying else section of if condition only echo “file type wrong”;