delete account

In this example below you will see how to do a delete account with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by isaychris, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright isaychris ©

Technologies

  • HTML
  • CSS
  • JavaScript
      <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery.tablesorter/2.29.0/css/theme.bootstrap_4.min.css">
  <link rel="stylesheet" href="main/main.css">
  <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"></script>
  <script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js"></script>
  <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/tablesorter@2.29.0/dist/js/jquery.tablesorter.combined.min.js"></script>




<button title="Delete Account" type="button" class="btn btn-danger wipe"> Delete Account </button>

/*Downloaded from https://www.codeseek.co/isaychris/delete-account-xPBJPP */
    


/*Downloaded from https://www.codeseek.co/isaychris/delete-account-xPBJPP */
    // PURPOSE: Deletes the users account.
$(document).on('click', 'button.wipe', function() {
  var result = confirm("Are you sure you want to delete?");
  
  if (result == true) {
    var delete_path = crumbarray[0];

    $.ajax({
      type: 'POST',
      url: 'main/delete_account.php',
      data: {
        file: delete_path
      },
      success: function() {
        window.location = "logout.php";
      },
      error: function() {
        showAlert('danger', '<strong>Error!</strong> Unable to delete account.');
      }
    });
  }
  return false;
});

Comments