OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
cream
/
quiz
/
backup
/
process
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
05/19/2025 10:07:16 AM
rwxr-xr-x
📄
check_user_exists.php
840 bytes
05/19/2025 10:07:16 AM
rw-r--r--
📄
logged_out.php
132 bytes
05/19/2025 10:07:16 AM
rw-r--r--
📄
loginCheck.php
1.17 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
sendOTP.php
2.51 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
showChildDetails.php
1.11 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
storeChildDetails.php
1.83 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
submitParentForm.php
2.03 KB
05/19/2025 10:07:16 AM
rw-r--r--
📄
verifyOtp.php
459 bytes
05/19/2025 10:07:16 AM
rw-r--r--
Editing: showChildDetails.php
Close
<?php session_start(); include '../assets/php/db_config.php'; function fetchChildrenData($userId) { global $conn; // Prepare the SQL query to fetch child details for the given user ID $sql = "SELECT * FROM child_details WHERE user_id = ?"; $stmt = $conn->prepare($sql); // Bind the userId parameter to the query $stmt->bind_param("i", $userId); // Execute the query $stmt->execute(); // Get the result set $result = $stmt->get_result(); // Initialize an empty array to store child details $children = []; // Fetch each row and append it to the array while ($row = $result->fetch_assoc()) { $children[] = $row; } // Close the statement $stmt->close(); // Return the array of child details return $children; } // Endpoint logic to return JSON if ($_SERVER['REQUEST_METHOD'] === 'GET') { header('Content-Type: application/json'); // Call the function to get the data $data = fetchChildrenData($_SESSION['userId']); // Send JSON-encoded response echo json_encode($data); } ?>