Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require "db.php";
- header('Content-Type: application/json');
- $get_result = ['auth' => false];
- if (isset($_SESSION['logged_user'])) {
- // get SESSION user id
- $userid = $_SESSION['logged_user']->id;
- // get user date
- $user = R::Load('users', $userid);
- foreach ($user->ownTestList as $test) {
- if ($test->name == $_POST['name']) {
- $progress = $test->progress;
- $time = $test->time;
- }
- }
- //we transfer the obtained data to js
- $get_result = ['result' => $progress, 'time' => $time, 'auth' => true];
- }
- echo json_encode($get_result);
- die();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement