selectWithParameter( "FileName", "plugins", array( 'id' => $id ), "Id=:id" ); $name = $sth -> fetch(); if ( is_dir( "$name[FileName]" ) ) { // removing plugin directory from the code base if ( Plugincache::rrmdir( "$name[FileName]" ) ) { $db -> delete( 'plugins', array( 'id' => $id ), "Id=:id" ); //if result successfull redirect and show success message header( "Location: index.php?page=plugins&result=2" ); die(); } else { // if result unsuccessfull redirect and show error message header( "Location: index.php?page=plugins&result=0" ); die(); } } } else { // if result unsuccessfull redirect and show error message header( "Location: index.php?page=plugins&result=0" ); die(); } } }