- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경 - DB 연결 하드코딩 → .env 기반으로 변경 - MySQL strict mode DATE 오류 수정
13 lines
343 B
PHP
13 lines
343 B
PHP
<?php
|
|
header('Content-Type: application/json');
|
|
$su = (int)$_POST['su'];
|
|
$length = (float)$_POST['length'];
|
|
$areaPrice = (float)$_POST['areaPrice'];
|
|
|
|
$unitPrice = round($length * $areaPrice);
|
|
$totalPrice = round($unitPrice * $su);
|
|
|
|
echo json_encode([
|
|
'unitPrice' => number_format($unitPrice),
|
|
'totalPrice' => number_format($totalPrice)
|
|
]); |