get_access_token(); error_log($token); $_SESSION['userdata'] = $oauth2 -> get_identity($token, 'https://auth.dataporten.no/userinfo'); header('Location: http://[::1]:1080/paamelding/'); die(); } if (!isset($_SESSION['userdata'])) { $oauth2 -> redirect(); die(); } //var_export($_SESSION); //exit; if ($_SERVER['REQUEST_METHOD'] === 'POST') { if($_POST["firstname"] == null && $_POST["lastname"] == null && $_POST["username"] == null && $_POST["email"] == null) { var_export($_POST); } else { $membersFile = "members.json"; $members = json_decode(file_get_contents($membersFile), true); $newMember = array( 'firstname' => $_POST["firstname"], 'lastname' => $_POST["lastname"], 'username' => $_POST["username"], 'email' => $_POST["email"]); array_push($members, $newMember); file_put_contents($membersFile, json_encode($members)); } header('Location: .'); die(); } ?> PVV registrering
Programvareverkstedet
Full name:
NTNU username:
Email adress: