Warning: Undefined array key "mobile_dir" in /home/kagla/new-sir/old/common.php on line 315
체크한것을 필드 안에 넣으려 하거든요.. 도와주세요.

체크한것을 필드 안에 넣으려 하거든요.. 도와주세요.

체크한것을 필드 안에 넣으려 하거든요.. 도와주세요.

QA

체크한것을 필드 안에 넣으려 하거든요.. 도와주세요.

답변 4

본문

wirte.skin.php에서 아래와 같이 체크박스를 하게 어떤 고마우신 분이 만들어 주셨어요..

 

<tr>
</tr>
    <td>
  <input type="checkbox" name="rweekd[]" id="rweekd0" value="0" /><label for="rweekd0"><span style="color:red"><B>일,</B></span></label> 
  <input type="checkbox" name="rweekd[]" id="rweekd1" value="1" /><label for="rweekd1"><B>월,</B></label> 
  <input type="checkbox" name="rweekd[]" id="rweekd2" value="2" /><label for="rweekd2"><B>화,</B></label> 
  <input type="checkbox" name="rweekd[]" id="rweekd3" value="3" /><label for="rweekd3"><B>수,</B></label> 
  <input type="checkbox" name="rweekd[]" id="rweekd4" value="4" /><label for="rweekd4"><B>목,</B></label> 
  <input type="checkbox" name="rweekd[]" id="rweekd5" value="5" /><label for="rweekd5"><B>금,</B></label> 
  <input type="checkbox" name="rweekd[]" id="rweekd6" value="6" /><label for="rweekd6"><span style="color:blue"><B>토</B></span></label>
 </td>
</tr>​

 

체크는 한가지가 아니라 모두 다 할 수도 잇거든요..

어떤걸 어떤걸 체크했는지 wr_10 에 구분자 |로 구분하여 입력시키고 싶어요...

그러면 write_update.php 파일에 어떻게 해야 하는지 좀 갈켜주세요...

 

 $arr_weekday = $_POST['rweekd'];

 

이 질문에 댓글 쓰기 :

답변 4

<?

$r_weekday = $_POST['rweekd'];

$TMP_CNT = count($r_weekday);

 

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

$n = $r_weekday[$i];

 

switch($n){

case '1':

$s="월";

break;

case '2':

$s="화";

break;

case '3':

$s="수";

break;

case '4':

$s="목";

break;

case '5':

$s="금";

break;

case '6':

$s="토";

break;

case '0':

$s="일";

break;

}

 

$t .= $s."|";

}

 

//

여기에 DB입력 쿼리 넣으시면 될듯 -> wr_10 = $t

//

 

?> 

답변을 작성하시기 전에 로그인 해주세요.
QA 내용 검색
질문등록
전체 129,406
© SIRSOFT
현재 페이지 제일 처음으로