$_SESSION['acess'], "password" => $_POST['password'], "pid" => $pid, "expiration" =>$expire, "valid_from" => $valid, //------------------ on work-------------------------// "category" => $_SESSION['role_id'], "access_duration" => $_SESSION['access_duration'], "unregdate" => $_SESSION['unregdate'] ]; $response = make_post_request($url, $data); if ($response === FALSE) { $response = json_encode(['status' => 'error', 'message' => 'An error occurred']); } $response_data = json_decode($response, true); if ($response_data['status'] === 201) { //echo ''; $_SESSION['message']="User Created Successfully"; $redirect_page="../user/userlist.php"; } elseif ($response_data['status'] === 409) { $_SESSION['message'] = 'User not created . User already exists'; $redirect_page="../user/createuser.php"; } else{ $_SESSION['message'] = $data["access_level"]; $redirect_page="../user/createuser.php"; } } else { header('Location: ../index.php'); exit(); } } ?>