PHP Classes

File: deletefile.php

Recommend this page to a friend!
  Classes of Er. Rochak Chauhan   AJAX File Uploader   deletefile.php   Download  
File: deletefile.php
Role: Auxiliary script
Content type: text/plain
Description: Delete uploaded file
Class: AJAX File Uploader
Browse files uploaded without page reloading
Author: By
Last change:
Date: 17 years ago
Size: 401 bytes
 

Contents

Class file image Download
<?php
/**
 * This file uploads a file in the back end, without refreshing the page
 *
 */
$homepage="index.php";
if (isset(
$_GET['filename'])) {
    if (
unlink($_GET['filename'])) {
       
header("Location: $homepage");
    }
    else {
        echo
"<script type='text/javascript'> alert('Failed to delete: ".$_GET['filename'].". Please try again.');</script>";
    }
}
else {
    echo
"File deleted";
}
?>