25 lines
540 B
PHP
Raw Permalink Normal View History

2024-09-13 16:45:04 +02:00
<?php
2024-09-16 10:26:33 +02:00
$file = "../../userM3.dat";
2024-09-13 16:45:04 +02:00
function addUser($newUser, $file) {
if(file_exists($file)){
$users = unserialize(file_get_contents($file));
2024-09-16 10:26:33 +02:00
$users[] = $newUser;
file_put_contents($file, serialize($users));
} else {
$users = array();
$users[] = $newUser;
2024-09-13 16:45:04 +02:00
file_put_contents($file, serialize($users));
2024-09-16 10:26:33 +02:00
}
2024-09-13 16:45:04 +02:00
}
2024-09-16 10:26:33 +02:00
function readUserData($file) {
2024-09-13 16:45:04 +02:00
if(file_exists($file)){
$users = unserialize(file_get_contents($file));
}
2024-09-16 10:26:33 +02:00
return $users;
2024-09-13 16:45:04 +02:00
}
?>