This repository has been archived on 2026-10-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2025-03-05 15:58:01 -08:00

20 lines
597 B
PHP

<?php
// Handle data storage and retrieval
$dataFile = 'drawing_data.json';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// Handle incoming drawing data
$currentData = json_decode(file_get_contents($dataFile), true);
$newData = json_decode(file_get_contents('php://input'), true);
// Merge new data with existing data
$currentData[] = $newData;
// Save the updated data
file_put_contents($dataFile, json_encode($currentData, JSON_PRETTY_PRINT));
echo 'Data saved successfully';
} else {
// Serve the HTML file
include 'main.html';
}
?>