w

추가필드에서 체크박스로 항목 받으려고 할때요.

write.skin.php 파일에

<tr>
<td class=mw_basic_write_title>· 희망강의</td>
<td>
<input type="checkbox" name="four01" value="1" <? if ($four01 == '1') echo "checked";?> />기업출강
<input type="checkbox" name="four02" value="1" <? if ($four02 == '1') echo "checked";?> />어학원
<input type="checkbox" name="four03" value="1" <? if ($four03 == '1') echo "checked";?> />그룹강의
<input type="checkbox" name="four04" value="1" <? if ($four04 == '1') echo "checked";?> />개인교습
</td></tr>
<tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>



write_update.skin.php

$wr_4 = "$four01|$four02|$four03|$four04";
$sql4 = " update $write_table set wr_4 = '$wr_4' where wr_id = '$wr_id' ";
sql_query($sql4);

이걸 넣었는데요.

안되네요.



http://www.sir.co.kr/bbs/board.php?bo_table=g4_tiptech&wr_id=5749&sca=&sfl=wr_subject%7C%7Cwr_content&stx=%C3%DF%B0%A1%C7%CA%B5%E5&sop=and

이걸로 새 필드 추가해서 해보려고 해도 안되구요. ㅜㅜ

어떻게 하면 체크박스로 입력폼 여러개 있는거 받을 수 있나요?

댓글 3개

write.skin.php

<?
//상단에추가
$ex9_filed = explode("|",$write[wr_9]); //여분필드 wr_9를 사용
$ext9_00 = $ex9_filed[0]; // 기업출강
$ext9_01 = $ex9_filed[1]; // 어학원
$ext9_02 = $ex9_filed[2]; // 그룹강의
$ext9_03 = $ex9_filed[3]; // 개인교습
$ext9_04 = $ex9_filed[4]; /////// 이하 사용안하면 삭제해도 됨
$ext9_05 = $ex9_filed[5]; //
$ext9_06 = $ex9_filed[6]; //
$ext9_07 = $ex9_filed[7]; //
$ext9_08 = $ex9_filed[8]; //
$ext9_09 = $ex9_filed[9]; //
?>


<input type="checkbox" name="ext9_00" value="기업출강" <? if ($ext9_00 == '기업출강') echo "checked";?> />기업출강
<input type="checkbox" name="ext9_01" value="어학원" <? if ($ext9_01 == '어학원') echo "checked";?> />어학원
<input type="checkbox" name="ext9_02" value="그룹강의" <? if ($ext9_02 == '그룹강의') echo "checked";?> />그룹강의
<input type="checkbox" name="ext9_03" value="개인교습" <? if ($ext9_03 == '개인교습') echo "checked";?> />개인교습





write_update.skin.php
<?
$wr_9 = "$ext9_00|$ext9_01|$ext9_02|$ext9_03|$ext9_04|$ext9_05|$ext9_06|$ext9_07|$ext9_08|$ext9_09|";
$sql9 = " update $write_table set wr_9 = '$wr_9' where wr_id = '$wr_id' ";
sql_query($sql9);
?>


//------------------------


wr_9 사용소스가 있어서 올립니다.
다른 필드사용시는 조금 변경해서 사용하면될거예요..


리스트에 출력시 ..................
아래소스를 필히 for 문 안에 넣고

<?
$ex9_filed = explode("|",$list[$i][wr_9]); //여분필드 wr_9를 사용
$ext9_00 = $ex9_filed[0]; // 기업출강
$ext9_01 = $ex9_filed[1]; // 어학원
$ext9_02 = $ex9_filed[2]; // 그룹강의
$ext9_03 = $ex9_filed[3]; // 개인교습
$ext9_04 = $ex9_filed[4]; //
$ext9_05 = $ex9_filed[5]; //
$ext9_06 = $ex9_filed[6]; //
$ext9_07 = $ex9_filed[7]; //
$ext9_08 = $ex9_filed[8]; //
$ext9_09 = $ex9_filed[9]; //
?>

출력 : <?=$ext9_00?>/<?=$ext9_01?>/<?=$ext9_02?>/...



뷰어 출력시 ..................
아래소스를 필히 상단에 넣고
<?
$ex9_filed = explode("|",$view[wr_9]); //여분필드 wr_9를 사용
$ext9_00 = $ex9_filed[0]; // 기업출강
$ext9_01 = $ex9_filed[1]; // 어학원
$ext9_02 = $ex9_filed[2]; // 그룹강의
$ext9_03 = $ex9_filed[3]; // 개인교습
$ext9_04 = $ex9_filed[4]; //
$ext9_05 = $ex9_filed[5]; //
$ext9_06 = $ex9_filed[6]; //
$ext9_07 = $ex9_filed[7]; //
$ext9_08 = $ex9_filed[8]; //
$ext9_09 = $ex9_filed[9]; //
?>

출력 : <?=$ext9_00?>/<?=$ext9_01?>/<?=$ext9_02?>/...
네, 감사합니다. ^^

말씀해 주신대로 하니, 글쓴다음에 수정 눌러도 체크한것이 그대로 있네요. ^^

view 화면에 나오는것도 적용해 볼께요~.
정말 감사합니다. 잘 적용됩니다. ^^
댓글을 작성하시려면 로그인이 필요합니다.

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기 기존 게시물은 열람만 가능합니다.

+
제목 글쓴이 날짜 조회
10-07-15 조회 2,644
10-07-14 조회 1,639
10-07-14 조회 1,630
10-07-14 조회 3,346
10-07-14 조회 1,699
10-07-14 조회 1,289
10-07-14 조회 1,625
10-07-14 조회 1,100
10-07-14 조회 1,603
10-07-14 조회 2,901
10-07-14 조회 1,559
10-07-14 조회 1,134
10-07-14 조회 1,647
10-07-14 조회 1,610
10-07-14 조회 1,841
10-07-14 조회 2,866
10-07-14 조회 1,597
10-07-13 조회 1,506
10-07-13 조회 1,625
10-07-13 조회 1,668