Im trying to add an image file to a db but am having several probs, firstly the code
<html>
<head>
</head>
<body>
<form enctype="multipart/form-data" action="imagetest.php" method="post">
<br>Image:<input type="file" name="image" ><br>
<input type="submit"></form>
</body
</html>
the php
<?
$image = $_POST['image'];
//$image= "E:\bblogo.jpeg";
$fileContents = addslashes(fread(fopen($image,"r"), filesize($image)));
$type="image/jpeg";
$desc ="test image";
$dbHost = "localhost";
$dbUser = "nt";
$dbPass = "w664437y";
$dbDatabase = "web";
//connect to database
$db = mysql_connect("$dbHost", "$dbUser", "$dbPass") or die ("Cannot connect to database.");
mysql_select_db("$dbDatabase",$db) or die ("Cannot find database");
$insertQuery = "INSERT INTO image (image_desctiption,image_type,image_body) VALUES ('$desc','$type','$image')";
$result=mysql_query($insertQuery);
echo 'image added';
?>
problem
firstly if i dont specify teh image location in the php eg 'E:\bblogo'(line 3 of pho code) i get a
Undefined index: image on line 2 error
secondly if i just use the image location as the image variable it runs the script but does not acctually insert anything into the database.
Any ideas