개발 Q&A

제목 form으로 post 전송 관련 문의 드립니다.
글쓴이 하하예에 작성시각 2016/07/25 10:11:51
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 10914   RSS
<?
function print_a($p_ary) {
  echo '<font color="orangered">';
  if (is_array($p_ary)) {
    echo '<xmp>',print_r($p_ary).'</xmp>';
  } else {
    echo $p_ary;
  }
  echo '</font>';
}
if (!empty($_POST)) {
  print_a($_POST);
}
?>

<!DOCTYPE html>
<html lang="ko">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
  <script type="text/javascript">
  $(document).ready(function(){


  var dom = '';
    for ( var i=0; 200 > i; i++ ) {
      dom +=
      '<tbody >' +
        '<tr>' +
          '<td><input type="radio" name="v_opt_sele" value="" /></td>' +
          '<td>' +
            '<button type="button">위</button>' +
            '<button type="button">아래</button>' +
          '</td>' +
          '<td>1</td>' +
          '<td><input type="hidden" name="a_opt_code[]" value="" />d</td>' +
          '<td><input type="hidden" name="a_opt_name[]" value="" />d</td>' +
          '<td><input type="text" name="a_opt_cost[]" value="" /></td>' +
          '<td><input type="text" name="a_opt_dis[]"  value="" /></td>' +
          '<td><input type="text" name="a_opt_net[]"  value="" readonly /></td>' +
          '<td><input type="text" name="a_opt_rate[]" value=""readonly /></td>' +
          '<td>' +
            '<select name="a_opt_time[]" >' +
              '<option value="" >선택하세요</option>' +
            '</select>' +
          '</td>' +
          '<td>' +
            '<label>' +
              '<span>사용</span>' +
              '<input type="checkbox" name="a_opt_use[]" value="Y" checked />' +
              '<input type="hidden" name="a_opt_use[]" value="N" disabled />' +
            '</label>' +
          '</td>' +
          '<td><button type="button" >열기</button></td>' +
          '<td><button type="button" >plus</button></td>' +
        '</tr>' +
        '<tr>' +
          '<td colspan="13">' +
            '<table>' +
              '<tbody>' +
                '<tr>' +
                  '<td>' +
                    '<div>' +
                      '<label>재고수량' +
                        '<input type="checkbox" name="a_use_stock[]" value="Y" checked >' +
                        '<input type="hidden" name="a_use_stock[]" value="N" disabled >' +
                      '</label>' +
                    '</div>' +
                    '<input type="number" name="a_opt_stock[]" value="d" />' +
                  '</td>' +
                  '<td>' +
                    '<div>' +
                      '<label>구매후 유효기간' +
                        '<input type="checkbox" name="a_use_period[]" value="Y" checked >' +
                        '<input type="hidden" name="a_use_period[]" value="N" disabled >' +
                      '</label>' +
                    '</div>' +
                    '<select name="a_opt_period[]" >' +
                      '<option value="" >선택하세요</option>' +
                    '</select>' +
                  '</td>' +
                  '<td>' +
                    '<div>' +
                      '<label>노출일시' +
                        '<input type="checkbox" name="a_use_show[]" value="Y" checked >' +
                        '<input type="hidden" name="a_use_show[]" value="N" disabled >' +
                      '</label>' +
                    '</div>' +
                    '<input type="text" name="a_show_dt[]" value="d" />' +
                  '</td>' +
                  '<td>' +
                    '<div>' +
                      '<label>옵션유효일시' +
                        '<input type="checkbox" name="a_use_period_dt[]" value="Y" checked >' +
                        '<input type="hidden" name="a_use_period_dt[]" value="N" disabled >' +
                      '</label>' +
                    '</div>' +
                    '<input type="text" name="a_opt_period_dt[]" value="d" />' +
                  '</td>' +
                  '<td>' +
                    '<div>' +
                      '<label>블럭일 설정' +
                        '<input type="checkbox" name="a_use_block[]" value="Y" checked >' +
                        '<input type="hidden" name="a_use_block[]" value="N" disabled >' +
                      '</label>' +
                    '</div>' +
                    '<input type="text" name="a_opt_block[]" value="d" />' +
                  '</td>' +
                  '<td>' +
                    '<div>' +
                      '<label>요일설정' +
                        '<input type="checkbox" name="a_use_week[]" value="Y" checked >' +
                        '<input type="hidden" name="a_use_week[]" value="N" disabled >' +
                      '</label>' +
                    '</div>' +
                    '<label >일' +
                      '<input type="checkbox" name="a_w0[]" value="1" checked >' +
                      '<input type="hidden" name="a_w0[]" value="0" disabled >' +
                    '</label>' +
                    '<label >월' +
                      '<input type="checkbox" name="a_w1[]" value="1" checked >' +
                      '<input type="hidden" name="a_w1[]" value="0" disabled >' +
                    '</label>' +
                    '<label >화' +
                      '<input type="checkbox" name="a_w2[]" value="1" checked >' +
                      '<input type="hidden" name="a_w2[]" value="0" disabled >' +
                    '</label>' +
                    '<label >수' +
                      '<input type="checkbox" name="a_w3[]" value="1" checked >' +
                      '<input type="hidden" name="a_w3[]" value="0" disabled >' +
                    '</label>' +
                    '<label >목' +
                      '<input type="checkbox" name="a_w4[]" value="1" checked >' +
                      '<input type="hidden" name="a_w4[]" value="0" disabled >' +
                    '</label>' +
                    '<label >금' +
                      '<input type="checkbox" name="a_w5[]" value="1" checked >' +
                      '<input type="hidden" name="a_w5[]" value="0" disabled >' +
                    '</label>' +
                    '<label >토' +
                      '<input type="checkbox" name="a_w6[]" value="1" checked >' +
                      '<input type="hidden" name="a_w6[]" value="0" disabled >' +
                    '</label>' +
                    '<label >휴' +
                      '<input type="checkbox" name="a_opt_holiday[]" value="Y" checked >' +
                      '<input type="hidden" name="a_opt_holiday[]" value="N" disabled >' +
                    '</label>' +
                  '</td>' +
                '</tr>' +
              '</tbody>' +
            '</table>' +
          '</td>' +
        '</tr>' +
      '</tbody>';
    }
    $('#ddd').append(dom);
    });
  </script>
</head>
<body>
  <form method="post">
  <button>전송</button>
  <table id="ddd">

  </table>

  </form>
</body>
</html>

 

 

 

안녕하세요 오랜만에 질문드립니다.

현재 어드민화면에서 옵션생성하는부분 제작하고있는데요. 

문제점이 하나 발견되서 이렇게 문의드립니다. 

돌려보면 아시겠지만  javascript 로 dom 생성한후로 submit하면 post로 받아오는게 38개까지만 받아오는데 

혹시 이런 경험 해보신분 있으신가해요. 

local에서 테스트할땐 200개를 잘받아오던데 서버에 올려서 테스트해보면 38개까지만 받아옵니다. ㅠㅠ

하루꼬박 원인찾느라 시간만 낭비하고잇네요. 

알고계시는분 조언좀 부탁드려요.

 다음글 이런경우는 session데이터를 저장하는 테이블을 별도...
 이전글 변수 선언 (2)

댓글

배강민 / 2016/07/25 10:22:21 / 추천 0

38개는 좀 이상하긴하지만

php.ini에서

; How many GET/POST/COOKIE input variables may be accepted
; max_input_vars = 1000

이 부분 설정이 38로 되어있다면 그럴 수 있긴합니다. 다른 문제일 수도 있지만요.

하하예에 / 2016/07/25 13:00:20 / 추천 0

알려주신대로 php 설정부분에 default가 1000으로 되어있어서 50000 으로 설정했더니 정상적으로 넘어갔습니다.

정말 감사합니다.^^