Download search_customer.php from multibiz/finger: direct link, hf CLI and curl.
- Browser
- Download file 937 Bytes
-
https://huggingface.co/spaces/multibiz/finger/resolve/main/search_customer.php
- Command line
-
hf download hf://spaces/multibiz/finger/search_customer.php
-
curl -L -o search_customer.php https://huggingface.co/spaces/multibiz/finger/resolve/main/search_customer.php
937 Bytes
| ```php | |
| require_once 'db_connect.php'; | |
| if ($_SERVER['REQUEST_METHOD'] === 'GET') { | |
| $customerId = $_GET['customer_id'] ?? ''; | |
| if (empty($customerId)) { | |
| die(json_encode(['error' => 'Customer ID is required'])); | |
| } | |
| try { | |
| $stmt = $pdo->prepare("SELECT customer_id, customer_name, customer_email, | |
| registration_date FROM customers WHERE customer_id = ?"); | |
| $stmt->execute([$customerId]); | |
| if ($stmt->rowCount() === 0) { | |
| die(json_encode(['error' => 'Customer not found'])); | |
| } | |
| $customer = $stmt->fetch(PDO::FETCH_ASSOC); | |
| echo json_encode($customer); | |
| } catch (PDOException $e) { | |
| die(json_encode(['error' => 'Database error: ' . $e->getMessage()])); | |
| } | |
| } else { | |
| die(json_encode(['error' => 'Invalid request method'])); | |
| } | |
| ``` | |
| 5. Here's the updated index.php with real DigitalPersona integration: |