'error', 'message' => 'No data provided']); exit; } $lot_no = $_POST['lot_no']; // 클라이언트에서 받은 로트번호 $filepath = $_SERVER['DOCUMENT_ROOT'] . '/instock/lotnum.txt'; // 파일에 데이터 저장 if (file_put_contents($filepath, $lot_no) !== false) { echo json_encode(['status' => 'success', 'message' => 'Data saved successfully']); } else { echo json_encode(['status' => 'error', 'message' => 'Failed to save data']); } ?>