prepare(" SELECT client_url FROM survey_urls WHERE project_id = ? AND unique_identifier = ? LIMIT 1 "); $stmt->execute([$project_id, $unique_id]); $result = $stmt->fetch(PDO::FETCH_ASSOC); if (!$result) { header('HTTP/1.0 404 Not Found'); echo "Survey URL not found or expired"; exit; } // Redirect to client survey URL header('Location: ' . $result['client_url']); exit; } catch (Exception $e) { error_log("Survey proxy error: " . $e->getMessage()); header('HTTP/1.0 500 Internal Server Error'); echo "Error loading survey"; exit; }