The following files exists in this folder. Click to view.
does_make_account.php24 lines ASCII Unix (LF)
<?php
session_start();
$file_in="../accounts/{$_SESSION["username"]}.json";
$json=json_decode(file_get_contents($file_in), true);
foreach($json["{$_SESSION["username"]}"]as $a){
if($a["account-name"]==$_POST["kNamn"]){
header("location:make_account.php?mess=exists");
exit();
}
}
$json["{$_SESSION["username"]}"][] = ["account-type" => "{$_POST["kTyp"]}","account-name" => "{$_POST["kNamn"]}", "transactions" => array(0,date("Y/m/d"),"Konto Skapat")];
$file = fopen($file_in, "w");
fwrite($file, json_encode($json, JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
fclose($file);
header("location:../user.php");
exit();
?>