I write this code for remove pictures from my library project,
but it won't get a value somehow, i am unable to figure out what is going on, could someone help me with this?
i get an undefined index as error.
$foto = new fotobibliotheek;
$fotos = $foto->fetch_all();
    if(isset($_GET['verwijderen'])) 
    {
        echo $_GET['foto_id'];
        echo $_GET['fotourl'];
          $fotoid = $_GET['foto_id'];
          $filename = $_GET['fotourl'];
          echo $filename;
          if (file_exists($filename)) {
            // bestand verwijderen uit de map
            unlink($filename);
            // link naar de map verwijderen die in het database staat
            $query = $pdo->prepare("DELETE FROM fotobibliotheek WHERE foto_id =?");
            $query->bindValue(1,$fotoid);
            $query->execute();
            // succes bericht
            echo 'File '.$filename.' het bestand is verwijderd';
          } else {
            // fout bericht
            echo 'dit bestand '.$filename.', kan niet worden verwijderd';
          }
    }
<?php
foreach($fotos as $foto)
    { ?>
            <div class ="container2item">
                <form method ="get">
                    <p name="foto_id"><?php
                    echo $foto['foto_id'] ?></p>
                    <h2><?php echo $foto['foto_naam'] ?></h2>
                    <img src="<?php echo $foto['foto_url'] ?>" width="300" height="170" name="fotourl" />
                    <p> <?php echo $foto['foto_omschrijving'] ?> </p>
                    <input type="submit" name="verwijderen" value="Foto Verwijderen">   
                </form>
            </div>
    <?php
    } ?>
 
     
     
    