hi guys i am trying to upload an image but my code is not upload image size higher than 400bytes please help me i tried but many thing but figure it out.
<html>
<head>
</head>
<body>
<form action="test.php" method="post" enctype="multipart/form-data" >
File:
<input type="file" name="image" />
<input type="submit" value="Upload" />
</form>
<?php
mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("n") or die(mysql_error());
$file = $_FILES['image']['tmp_name'];
if(!isset($file))
echo "please select an image";
else
{
$image = file_get_contents($_FILES['image']['tmp_name']);
$image_name = $_FILES['image']['name'];
$image_size = getimagesize($_FILES['image']['tmp_name']);
echo $size = $_FILES['image']['size'];
$height = $_FILES['image']['height'] /100;
$width = $_FILES['image']['width'] /100;
if($image_size==FALSE)
echo "that's not an image";
else
{
if(!$insert = mysql_query("INSERT INTO parent_info VALUES ('','$image_name','$image')"))
echo "problem";
else
{
}
}}
?>
</body>
</html>