- URL 하드코딩 → .env APP_URL 기반 동적 URL로 변경 - DB 연결 하드코딩 → .env 기반으로 변경 - MySQL strict mode DATE 오류 수정
20 lines
755 B
PHP
20 lines
755 B
PHP
<?php
|
|
// ajax_getProductData.php
|
|
require_once($_SERVER['DOCUMENT_ROOT'] . "/guiderail/fun_guiderail.php");
|
|
|
|
// POST로 전달받은 값 (없으면 기본값 설정)
|
|
$model_name = $_POST['model_name'] ?? '';
|
|
$finishing_type = $_POST['finishing_type'] ?? '';
|
|
$rail_length = isset($_POST['rail_length']) ? floatval($_POST['rail_length']) : 0;
|
|
$rail_width = isset($_POST['rail_width']) ? floatval($_POST['rail_width']) : 0;
|
|
$check_type = $_POST['check_type'] ?? '벽면형';
|
|
|
|
// getProductData 함수 호출하여 데이터 배열 생성
|
|
$productData = getProductData($model_name, $finishing_type, $rail_length, $rail_width, $check_type);
|
|
|
|
// JSON 형식으로 반환
|
|
header('Content-Type: application/json');
|
|
echo json_encode($productData);
|
|
exit;
|
|
?>
|