The following files exists in this folder. Click to view.
errase.php25 lines ASCII Unix (LF)
```php
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$filename = $username . '.json';
if (!file_exists($filename)) {
header('location:index.php?mess=Kontot finns inte');
exit();
}
$users = json_decode(file_get_contents($filename), true);
foreach ($users as $user) {
if ($user['username'] == $username && $user['password'] == $password){
if (unlink($filename)) {
header('location:index.php?mess=Kontot har raderats');
exit();
}
}
}