Skip to content

Instantly share code, notes, and snippets.

@acegreen
Last active September 20, 2015 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acegreen/27163ce9f6c99a165ad0 to your computer and use it in GitHub Desktop.
Save acegreen/27163ce9f6c99a165ad0 to your computer and use it in GitHub Desktop.
<?php
if (file_exists($_GET['file'])) {
chmod($_GET['file'], 0755);
if (unlink($_GET['file'])) {
echo "true";
} else {
echo "false";
}
} else {
echo "false";
}
echo '/deleteImage/';
?>
function deleteImage(file_path) {
$.ajax({
url: 'http://Your_LocalHost/deleteImage.php',
data: {'file' : "/var/www/html/" + file_path },
success: function (response) {
},
error: function () {
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment