테스트 사이트 - 개발 중인 베타 버전입니다

회원가입 다중체크박스 선택 후 회원수정이나 관리자에 체크가 안되어있습니다. 채택완료

DDGclub 3년 전 조회 3,543

고수님들 도와주세요~

고수님들의 도움으로 게시판에서의

다중선택은 노출도 잘되고 수정도 잘됩니다. 

 

그런데.. 회원가입시 다중선택한 체크박스는 쉽지가 않네요..ㅜ

회원가입시 선택한 다중체크박스 관리자에서(회원수정화면동일)

그대로 보여야 하는데.. 안보여요 도와주세요...

 

질문1

회원가입시 체크한 다중선택이 그대로 관리자 화면 및 수정에 노출되게 할려면 어떻게해야 하나요?

관련파일의 내용은 아래 올렸습니다.

               register_form.skin.php

               member_form.php

               member_form_update.php

 

질문2

mb 여분필드를 활용한 다른 가입항목은 모두 잘보이는데..

관리자모드에서 수정이 안됩니다..ㅜ 도와주세요 고수님들~

 

 

register_form.skin.php 내용

 

</p>

<p><div class="form-group row">

        <label class="col-sm-2 col-form-label" for="mb_8">필수1<strong>필수</strong></label>

    <div class="col-sm-4">

<?php

    $check1 = explode(",", $member['mb_8']);

?>

<input type="checkbox" id="mb_8_1" name="mb_8_box[]" class="selec_chk" value="20대"<?php echo in_array("20대", $check1) ? ' checked="checked"' : '' ?>> 20대

<input type="checkbox" id="mb_8_2" name="mb_8_box[]" class="selec_chk" value="30대"<?php echo in_array("30대", $check1) ? ' checked="checked"' : '' ?>> 30대

<input type="checkbox" id="mb_8_3" name="mb_8_box[]" class="selec_chk" value="40대"<?php echo in_array("40대", $check1) ? ' checked="checked"' : '' ?>> 40대</p>

<p>    </div>

</div></p>

<p><div class="form-group row">

        <label class="col-sm-2 col-form-label" for="mb_9">필수2<strong>필수</strong></label>

    <div class="col-sm-10">

<?php

    $check2 = explode(",", $member['mb_9']);

?>

<input type="checkbox" id="mb_9_1" name="mb_9_box[]" class="selec_chk" value="50대"<?php echo in_array("50대", $check2) ? ' checked="checked"' : '' ?>> 50대

<input type="checkbox" id="mb_9_2" name="mb_9_box[]" class="selec_chk" value="60대"<?php echo in_array("60대", $check2) ? ' checked="checked"' : '' ?>> 60대

<input type="checkbox" id="mb_9_3" name="mb_9_box[]" class="selec_chk" value="70대"<?php echo in_array("70대", $check2) ? ' checked="checked"' : '' ?>> 70대</p>

<p>        </div>

    </div>

</div></p>

<p>

 

member_form.php 해당 부분

 

</p>

<p><th scope="row"><label for="mb_8">필수1</label></th>

    <td colspan="3">

<?php

    $mb_8 = explode("|",$mb['mb_8']);

    $class_arr=explode("|",$config['cf_1']);

    $r_count = count($class_arr);

          for($i=0; $i<$r_count; $i++) { 

    $checked = strpos($mb['mb_8'], $class_arr[$i]) !==false ? 'checked' : '';

    echo '<input type="checkbox" id="mb_8" name="mb_8[]" value="'.$class_arr[$i].'"'.$checked.'>'.$class_arr[$i].'  ';

                    }

 ?></p>

<p><input type="checkbox" id="mb_8_1" name="mb_8_box[]" class="selec_chk" value="20대"<?php echo in_array("20대", $check1) ? ' checked="checked"' : '' ?>> 20대

<input type="checkbox" id="mb_8_2" name="mb_8_box[]" class="selec_chk" value="30대"<?php echo in_array("30대", $check1) ? ' checked="checked"' : '' ?>> 30대

<input type="checkbox" id="mb_8_3" name="mb_8_box[]" class="selec_chk" value="40대"<?php echo in_array("40대", $check1) ? ' checked="checked"' : '' ?>> 40대

    </td>

</tr>

<th scope="row"><label for="mb_9">필수2</label></th>

    <td colspan="3">

<?php

    $mb_9 = explode("|",$mb['mb_9']);

    $class_arr=explode("|",$config['cf_1']);

    $r_count = count($class_arr);

          for($i=0; $i<$r_count; $i++) { 

    $checked = strpos($mb['mb_9'], $class_arr[$i]) !==false ? 'checked' : '';

    echo '<input type="checkbox" id="mb_9" name="mb_9[]" value="'.$class_arr[$i].'"'.$checked.'>'.$class_arr[$i].'  ';

                    }

 ?>

<input type="checkbox" id="mb_9_1" name="mb_9_box[]" class="selec_chk" value="50대"<?php echo in_array("50대", $check2) ? ' checked="checked"' : '' ?>> 50대

<input type="checkbox" id="mb_9_2" name="mb_9_box[]" class="selec_chk" value="60대"<?php echo in_array("60대", $check2) ? ' checked="checked"' : '' ?>> 60대

<input type="checkbox" id="mb_9_3" name="mb_9_box[]" class="selec_chk" value="70대"<?php echo in_array("70대", $check2) ? ' checked="checked"' : '' ?>> 70대

    </td>

</tr></p>

<p>

 

member_form_update.php 해당부분

 

</p>

<p>$mb_8 = implode(',', $_POST['check1']);

$mb_9 = implode(',', $_POST['check2']);</p>

<p>    $sql = " update {$g5['member_table']}

                set {$sql_common}

                     {$sql_password}

                     {$sql_certify}</p>

<p>                 mb_8 = '{$mb_8}',

                 mb_9 = '{$mb_9}'</p>

<p>               where mb_id = ' {$mb_id}' ";

sql_query($sql);</p>

<p>

 

댓글을 작성하려면 로그인이 필요합니다.

답변 2개

D
3년 전

해결하였습니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

세크티
3년 전

member_form_update.php 에서 $mb_8은 mb_8_box로 implode해야하지 않나요?

</p>

<p>$mb_8 = implode(',', $_POST['mb_8_box']);</p>

<p>$mb_9 = implode(',', $_POST['mb_9_box']);</p>

<p>

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인