what's wrong or missing ??
Code:
<?php
if ((($_FILES["file"]["type"] == "image/gif")
|| ($_FILES["file"]["type"] == "image/jpeg")
|| ($_FILES["file"]["type"] == "image/pjpeg"))
&& ($_FILES["file"]["size"] < 80000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
if(isset($_POST['submit']))
{
echo "Upload: " . $_FILES["file"]["name"] . "<br />";
echo "Type: " . $_FILES["file"]["type"] . "<br />";
echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
echo "Stored in: " . $_FILES["file"]["tmp_name"];
echo "<br/><br/><br/><br/><br/><br/>";
echo "<html><body><center>";
print '<IMG SRC="$_FILES["file"]["name"]" WIDTH="250" HEIGHT="176" BORDER="0"
ALT="">';
echo "</center></body></html>";
}
}
}
?>
<center>
<form action="<?php $_SERVER=$_POST['PHP_SELF']; ?>" method="post"
enctype="multipart/form-data">
Change Picture
<br>
<input type="file" name="file" id="file" />
<br />
<input type="submit" name="submit" value="Submit" />
</form>
</center>
Comment