Deleting images with javascript function
<p>In a page, i am showing thumbs of images from a folder, with a link below them "Delete Image",
through this code:</p>

<pre><code>echo '&lt;li&gt; &lt;a href="Gallery/'.$file.'" rel="lightbox['.$lightbox.']"&gt;';
echo '&lt;div id="image" &gt;&lt;img src="Gallery/thumbs/'.$file.'" alt="" /&gt;&lt;br&gt;
&lt;a href="javascript:Del();"&gt;&lt;font style="font-size:9px"&gt;Delete Image&lt;/font&gt;';
echo '&lt;/a&gt;&lt;/div&gt;&lt;/a&gt;&lt;/li&gt;';
</code></pre>

<p>On the Delete Image I am calling a javascript function Del(). I want that if a User clicks on Delete Image, the Image thumb should be deleted, from its containing folder i.e., Gallery/thumbs.</p>

<p>The function Del is:</p>

<pre><code> &lt;script type="text/javascript"&gt;
function Del(){
    var image_x = document.getElementById('image');
image_x.parentNode.removeChild(image_x);
}
&lt;/script&gt;
</code></pre>

<p>This function removes the images from the page, not from the folder. And also it deletes them like, if i delete on third image it will remove first, then second, in a sequnce.
I want images to be deleted , only those on which user click Delete Image</p>

<p>I hope you all understand.</p>
