Hi
I just wan to to pass the value of Input Type File html tag to a 2nd PHP page where I will insert the image in mysql but I am always getting a notice and isset() is not getting the $_FILE('IMAGE').
Here is the notice - Notice: Undefined index: IMAGE in C:\xampp\htdocs\billing\prodinsert.php on line 11
This is my HTML TAGS -
<body>
<hr />
<form id="form1" name="form1" method="post" action="prodinsert.php" enctype="multipart/form-data">
<input name="ICODE" type="text" size="10" maxlength="6" />
<input name="DESCR" type="text" size="50" maxlength="45" />
<input name="RATE" type="text" size="10" maxlength="9" />
<input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
<input name="IMAGE" type="file" />
</form>
And this is my PHP code-
<?php
$host="localhost";
$user="root";
$pass="";
$db="bill";
mysql_connect($host, $user, $pass) OR DIE (mysql_error());
mysql_select_db ($db) OR DIE ("Unable to select db".mysql_error());
$code=$_POST['ICODE'];
$descp=$_POST['DESCR'];
$rate=$_POST['RATE'];
$image=$_POST['IMAGE'];
if(!isset($_FILES[$image]))
{
echo '<p>Please select a file</p>';
echo $image;
}
else
{
echo "File Uploaded";
echo $image;
}
Where I am making mistake ??? Please guide me.