renaming folder edit_wp5_web_folder to map-service
[geo.git] / map-service / geo / images / remove_img2.php
diff --git a/map-service/geo/images/remove_img2.php b/map-service/geo/images/remove_img2.php
new file mode 100644 (file)
index 0000000..5ad9c0b
--- /dev/null
@@ -0,0 +1,29 @@
+<?
+require_once("../../path_index.php");
+$img=$_GET['img'];
+       
+function isAjax() {
+return (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && 
+    ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'));
+}
+if (!isAjax()) {echo "No vas pas b\8e, cirerer...";} 
+else
+{
+//download/2473/120dpi/241/137.png
+//$path_towrite="/var/www/synthesys/www/fitxers/images/download/".$img;
+//echo $path_towrite;
+//$s="var/www/synthesys/www/fitxers/images/download/no_user/120dpi/186/";
+$mydir = DIR_PLATFORM."/geo/images/download/$img"; 
+
+//echo $mydir;
+$d = dir($mydir); 
+while($entry = $d->read()) { 
+ if ($entry!= "." && $entry!= "..") { 
+       //echo $entry;
+ unlink($mydir."/".$entry); 
+ } 
+} 
+$d->close(); 
+rmdir($mydir."/");
+}
+?>