将照片上传到文件夹,将照片名称上传到数据库

if ($_SERVER["REQUEST_METHOD"] == "POST")
    {

    $product_naam = clean_input($_POST["product_naam"]);
    $product_specificaties = clean_input($_POST["product_specificaties"]);
    $product_categorie = clean_input($_POST["product_categorie"]);
    $product_soort = clean_input($_POST["product_soort"]);
    $prijs = clean_input($_POST["prijs"]);


    //als form gesubmit is
    if (isset($_POST['submit']))
        {
        //devinieert de image file variabele
        $foto = $_FILES["file"]["name"];
        //maakt tijdelijke naam voor in tmp map
        $tmp_name = $_FILES['file']['tmp_name'];
        $error = $_FILES['file']['error'];

        //moved de image file naar uploads map als er gesubmit is
        if (isset ($foto)) 
            {
            if (!empty($foto)) 
                {
                $location = 'uploads/';
                move_uploaded_file($tmp_name, $location.$foto);
                }
            } 
        }
    //sql insert voor product toevoegen
    $sql = "INSERT INTO producten ( prijs, product_naam, product_specificaties, foto, product_categorie, product_soort)
            VALUES (:prijs, :product_naam, :product_specificaties, :foto, :product_categorie, :product_soort)";
    //query uitvoeren
    $query = $dbh->prepare( $sql );
    $result = $query->execute( array( ':prijs'=>$prijs, ':product_naam'=>$product_naam, ':product_soort'=>$product_soort, 
        ':product_specificaties'=>$product_specificaties, ':foto'=>$foto, ':product_categorie'=>$product_categorie) );

}

I have form to upload properties and a photo of a product to the database. The foto uploads to a map called uploads. But I also want the name of the foto to be inserted into the database. But when I submit I get an error saying the variable $foto is undefined. How to I upload the name of the photo to the database??