PHP Classes

File: uploady/profile/actions/delete_me.php

Recommend this page to a friend!
  Classes of Faris AL-Otabi   Uploady PHP Upload File to MySQL   uploady/profile/actions/delete_me.php   Download  
File: uploady/profile/actions/delete_me.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Uploady PHP Upload File to MySQL
Store file upload details in a MySQL database
Author: By
Last change: fix bugs and missing alert in 2fa
Date: 4 months ago
Size: 457 bytes
 

Contents

Class file image Download
<?php
include_once '../../session.php';

if (
$auth->checkToken($_GET['token'], $_SESSION['csrf'])) {
    if (
$user->get($_SESSION['username'])->role == 3) {
       
$utils->redirect($utils->siteUrl('/profile/account.php?msg=error'));
        return;
    }
   
$user->delete($_SESSION['username']);
   
$utils->redirect($utils->siteUrl('/logout.php?redirect=user_deleted'));
} else {
   
$utils->redirect($utils->siteUrl('/profile/account.php?msg=csrf'));
}