Add a Delete Button to my Gallery script
<p>I've made an image gallery to work with my instant image capture program I've made. I've got all the images from the directory to display correctly but I want to add a delete button which can delete the images. Here's my code so far (minus the HTML).</p>

<pre><code>&lt;?php

$ip = getenv(REMOTE_ADDR);
$folderName = md5($ip);
$dir = ''.$folderName.'';
$file_display = array('png', 'jpg', 'gif');

if (file_exists($dir) == false) {
    echo "&lt;b&gt;Your Folder&lt;/b&gt; ( $dir ) &lt;b&gt;cannot be found. Please contact the site     developer.&lt;/b&gt;&lt;br&gt;";
} else {
    $dir_contents = scandir($dir);

    foreach ($dir_contents as $file) {
        $file_type = strtolower(end(explode('.', $file)));

        if ($file !== '.' &amp;&amp; $file !== '..' &amp;&amp; in_array($file_type, $file_display)     == true) {
            echo '&lt;div style="margin-bottom:15px;"&gt;&lt;img src="', $dir, '/',     $file, '" alt="', $file, '" /&gt;&lt;br /&gt;&lt;a class="button"&gt;Delete&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;';
        }
    }
}
?&gt;
</code></pre>

<p>How would I got about making the link with the class "button" able to delete the image which is displayed? I'm not very experienced with PHP so a good explanation would be of great help and appreciation.</p>
