php unidentified index when calling function
<p>Hi I am calling a function to upload an image to a MySQL database
but it keeps saying unidentified index image</p>

<p>I am uploading the image using this button</p>

<pre><code>&lt;input type="file" name="image" size="25" /&gt;
&lt;input type ="submit" name = "Register_Btn" value ="Register"&gt;
</code></pre>

<p>which calls this</p>

<pre><code>if(isset($_POST['Register_Btn'])){
    uploadImage($link);
    register($link);
}
</code></pre>

<p>then in pictureupload.php I have this function</p>

<pre><code>&lt;?php
function UploadImage($link){
    if ($_FILES['image']['error'] == UPLOAD_ERR_OK){
    $image = addslashes(file_get_contents($_FILES['image']['tmp_name'])); //SQL Injection defence!
    $image_name = addslashes($_FILES['image']['name']);
    $sql = "INSERT INTO `authentication` ( `image_name`,`image`) VALUES ('{$image_name}','{$image}')";
    mysqli_query($link,$sql);
    }else{
        echo'No File Chosen';
    }   
}
</code></pre>

<p>?></p>

<p>Every time ['image'] is used it is returning the 
Undefined index: image error and also
also on line 4 of the pictureupload it is also saying
file_get_contents(): Filename cannot be empty
How do I ensure that it is receiving the uploaded image data?</p>