Help with Image posting with form to database with php
Posted: Fri Jul 15, 2005 2:59 am
Hello !
Im newbie to php . I want to post some data with form and Image or binary date i use the following code:
<form action="/CMS/Img.php" method="post" enctype="multipart/form-data" name="form1">
<INPUT type ="text" name="txtName" id="txtName">
<INPUT type ="image" src="../media/10.gif" name = "Img">
<INPUT name=Submit type=submit value=Submit>
<input name="Reset" type="reset" value="Reset">
</form>
the php Code:
$txtName = Trim($_POST["txtName"]) ;
$Img = $_POST["Img"] ;
$Query= "insert into product (Name ,Picture )
values ('$txtName','$Img')" ;
why i cant get the Img field from form
Can you help
Thanks very much
Im newbie to php . I want to post some data with form and Image or binary date i use the following code:
<form action="/CMS/Img.php" method="post" enctype="multipart/form-data" name="form1">
<INPUT type ="text" name="txtName" id="txtName">
<INPUT type ="image" src="../media/10.gif" name = "Img">
<INPUT name=Submit type=submit value=Submit>
<input name="Reset" type="reset" value="Reset">
</form>
the php Code:
$txtName = Trim($_POST["txtName"]) ;
$Img = $_POST["Img"] ;
$Query= "insert into product (Name ,Picture )
values ('$txtName','$Img')" ;
why i cant get the Img field from form
Can you help
Thanks very much