여분필드 explode 라디오버턴 입출력
본문
안녕하세요.
write.skin.php에서 편집/수정시에
여분필드 wr_3을 분할해서 주제언어와 번역언어로 각각 입력하고 출력 표시하려고 하는데,
db에 입력은 되는데, 편집화면에 입력되 데이터가 표시되질 않네요.
어디를 손봐야 하는지 좀 도와주세요.
write.skin.php
<?php
//$wr_3; <표제언어|번역언어>
$wr_3 = explode("|",$write['wr_3']);
$wr_3_00 = $wr_3[0];//
$wr_3_01 = $wr_3[1];//
?>
<label for="wr_3_00" class="">표제 언어:</label>
<input type="radio" name="wr_3_00" value="cn"<?php echo ($write['wr_3_00'] == "cn") ? " checked" : "";?> required> cn
<input type="radio" name="wr_3_00" value="en"<?php echo ($write['wr_3_00'] == "en") ? " checked" : "";?> required> en
<input type="radio" name="wr_3_00" value="ja"<?php echo ($write['wr_3_00'] == "ja") ? " checked" : "";?> required> ja
<input type="radio" name="wr_3_00" value="ko"<?php echo ($write['wr_3_00'] == "ko") ? " checked" : "";?> required> ko
<input type="radio" name="wr_3_00" value="ru"<?php echo ($write['wr_3_00'] == "ru") ? " checked" : "";?> required> ru
<input type="radio" name="wr_3_00" value="vi"<?php echo ($write['wr_3_00'] == "vi") ? " checked" : "";?> required> vi
<br>
<label for="wr_3_01" class="">번역 언어:</label>
<input type="radio" name="wr_3_01" value="cn"<?php echo ($write['wr_3_01'] == "cn") ? " checked" : "";?> required> cn
<input type="radio" name="wr_3_01" value="en"<?php echo ($write['wr_3_01'] == "en") ? " checked" : "";?> required> en
<input type="radio" name="wr_3_01" value="ja"<?php echo ($write['wr_3_01'] == "ja") ? " checked" : "";?> required> ja
<input type="radio" name="wr_3_01" value="ko"<?php echo ($write['wr_3_01'] == "ko") ? " checked" : "";?> required> ko
<input type="radio" name="wr_3_01" value="ru"<?php echo ($write['wr_3_01'] == "ru") ? " checked" : "";?> required> ru
<input type="radio" name="wr_3_01" value="vi"<?php echo ($write['wr_3_01'] == "vi") ? " checked" : "";?> required> vi
write_update.skin.php
<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
// 자신만의 코드를 넣어주세요.
//$wr_3; <표제언어|번역언어>
$wr_3 = "$wr_3_00|$wr_3_01";
$sql3 = " update $write_table set wr_3 = '{$wr_3}' where wr_id = '$wr_id' ";
sql_query($sql3);
?>
!-->!-->
답변 1
위에 표제 언어쪽에서
<input type="radio" name="wr_3_00" value="cn"<?php echo ($write['wr_3_00'] == "cn") ? " checked" : "";?> required> cn
<input type="radio" name="wr_3_00" value="cn"<?php echo ($wr_3_00 == "cn") ? " checked" : "";?> required> cn
아래쪽 번역언어쪽에서
<input type="radio" name="wr_3_01" value="cn"<?php echo ($write['wr_3_01'] == "cn") ? " checked" : "";?> required> cn
<input type="radio" name="wr_3_01" value="cn"<?php echo ($wr_3_01 == "cn") ? " checked" : "";?> required> cn
checked 를 표시하기위해 비교하는 변수를 바꿔주셔야 할것 같네요
답변을 작성하시기 전에 로그인 해주세요.