[G4] 글쓰기에서 전화번호 분할 입력 + 추가필드 활용 > 기술자료 | 해피정닷컴

[G4] 글쓰기에서 전화번호 분할 입력 + 추가필드 활용 > 기술자료

본문 바로가기

사이트 내 전체검색

[G4] 글쓰기에서 전화번호 분할 입력 + 추가필드 활용 > 기술자료

그누보드 [G4] 글쓰기에서 전화번호 분할 입력 + 추가필드 활용

페이지 정보


본문

2007.09.17  핸드폰  013 추가
2008.03.12  목록페이지에서 사용하기 추가
2008.07.03  구분기호를 "-" 에서 "|" 로 변경 ... 주소내용중 "-"값 존재
2011.03.29  목록보기  explode("|",$view[wr_10]); 를 explode("|",$list[i]['wr_10']); 로 수정
2011.03.29  추가필드 1번을 10번으로 변경
2012.08.06  목록보기  explode("|",$list[i][wr_10]); 를 explode("|",$list[$i]['wr_10']); 로 수정
2013.05.12 form name 을 fwirte 에서 hwrite 로 변경 (일부 방화벽 프로그램에서 fwirte 를 차단함)

##################################################
write.skin.php  상단부분에 아래의 내용을 활용

<?php
//전화번호, 팩스, 핸드폰, 성별, 주소
$wr10   = explode("|",$write['wr_10']);
$tel1  = $wr10[0];
$tel2  = $wr10[1];
$tel3  = $wr10[2];
$fax1  = $wr10[3];
$fax2  = $wr10[4];
$fax3  = $wr10[5];
$hp1   = $wr10[6];
$hp2   = $wr10[7];
$hp3   = $wr10[8];
$sex   = $wr10[9];
$zip1  = $wr10[10];
$zip2  = $wr10[11];
$addr1 = $wr10[12];
$addr2 = $wr10[13];
?>

...
form name="fwrite" 를  form name='hwrite" 로 변경   :: 우편번호 찾기에서 방화벽 오류 해결을 위해서
...
<?php // 추가필드 ?>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 전화번호</td>
    <td style='padding-left:0px;'><select name='tel1' class='ed'  itemname='전화번호'>
        <option value=''>선택하세요</option>
        <option value='070' <?php if($tel1 == "070") echo "selected"; ?>>070</option>
        <option value='02' <?php if($tel1 == "02") echo "selected"; ?>>02</option>
        <option value='031' <?php if($tel1 == "031") echo "selected"; ?>>031</option>
        <option value='032' <?php if($tel1 == "032") echo "selected"; ?>>032</option>
        <option value='033' <?php if($tel1 == "033") echo "selected"; ?>>033</option>
        <option value='041' <?php if($tel1 == "041") echo "selected"; ?>>041</option>
        <option value='042' <?php if($tel1 == "042") echo "selected"; ?>>042</option>
        <option value='043' <?php if($tel1 == "043") echo "selected"; ?>>043</option>
        <option value='051' <?php if($tel1 == "051") echo "selected"; ?>>051</option>
        <option value='052' <?php if($tel1 == "052") echo "selected"; ?>>052</option>
        <option value='053' <?php if($tel1 == "053") echo "selected"; ?>>053</option>
        <option value='054' <?php if($tel1 == "054") echo "selected"; ?>>054</option>
        <option value='055' <?php if($tel1 == "055") echo "selected"; ?>>055</option>
        <option value='061' <?php if($tel1 == "061") echo "selected"; ?>>061</option>
        <option value='062' <?php if($tel1 == "062") echo "selected"; ?>>062</option>
        <option value='063' <?php if($tel1 == "063") echo "selected"; ?>>063</option>
        <option value='064' <?php if($tel1 == "064") echo "selected"; ?>>064</option>
        <option value='0502' <?php if($tel1 == "0502") echo "selected"; ?>>0502</option>
        <option value='0505' <?php if($tel1 == "0505") echo "selected"; ?>>0505</option>
      </select> -
      <input name='tel2' class=ed value='<?php echo $tel2; ?>' type='text' size='4' maxlength='4' onkeydown='onlyNumber(this);'  itemname='전화번호 두번째자리'>  -
      <input name='tel3' class=ed value='<?php echo $tel3; ?>' type='text' size='4' maxlength='4' onkeydown='onlyNumber(this);'  itemname='전화번호 세번째자리'></td>
  </tr>
  <tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 팩스번호</td>
    <td style='padding-left:0px;'><select name='fax1' class='ed'  itemname='팩스번호'>
        <option value=''>선택하세요</option>
        <option value='02' <?php if($fax1 == "02") echo "selected"; ?>>02</option>
        <option value='031' <?php if($fax1 == "031") echo "selected"; ?>>031</option>
        <option value='032' <?php if($fax1 == "032") echo "selected"; ?>>032</option>
        <option value='033' <?php if($fax1 == "033") echo "selected"; ?>>033</option>
        <option value='041' <?php if($fax1 == "041") echo "selected"; ?>>041</option>
        <option value='042' <?php if($fax1 == "042") echo "selected"; ?>>042</option>
        <option value='043' <?php if($fax1 == "043") echo "selected"; ?>>043</option>
        <option value='051' <?php if($fax1 == "051") echo "selected"; ?>>051</option>
        <option value='052' <?php if($fax1 == "052") echo "selected"; ?>>052</option>
        <option value='053' <?php if($fax1 == "053") echo "selected"; ?>>053</option>
        <option value='054' <?php if($fax1 == "054") echo "selected"; ?>>054</option>
        <option value='055' <?php if($fax1 == "055") echo "selected"; ?>>055</option>
        <option value='061' <?php if($fax1 == "061") echo "selected"; ?>>061</option>
        <option value='062' <?php if($fax1 == "062") echo "selected"; ?>>062</option>
        <option value='063' <?php if($fax1 == "063") echo "selected"; ?>>063</option>
        <option value='064' <?php if($fax1 == "064") echo "selected"; ?>>064</option>
        <option value='0502' <?php if($fax1 == "0502") echo "selected"; ?>>0502</option>
        <option value='0505' <?php if($fax1 == "0505") echo "selected"; ?>>0505</option>
      </select> -
      <input name='fax2' class=ed value='<?php echo $fax2; ?>' type='text' size='4' maxlength='4' onkeydown='onlyNumber(this);'  itemname='팩스번호 두번째자리'>  -
      <input name='fax3' class=ed value='<?php echo $fax3; ?>' type='text' size='4' maxlength='4' onkeydown='onlyNumber(this);'  itemname='팩스번호 세번째자리'></td></tr>
  <tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 휴대전화</td>
    <td style='padding-left:0px;'><select name='hp1' class='ed'  itemname='휴대전화'>
        <option value=''>선택하세요</option>
        <option value='010' <?php if($hp1 == "010") echo "selected"; ?>>010</option>
        <option value='011' <?php if($hp1 == "011") echo "selected"; ?>>011</option>
        <option value='013' <?php if($hp1 == "013") echo "selected"; ?>>013</option>
        <option value='016' <?php if($hp1 == "016") echo "selected"; ?>>016</option>
        <option value='017' <?php if($hp1 == "017") echo "selected"; ?>>017</option>
        <option value='018' <?php if($hp1 == "018") echo "selected"; ?>>018</option>
        <option value='019' <?php if($hp1 == "019") echo "selected"; ?>>019</option>
      </select> -
      <input name='hp2' class=ed value='<?php echo $hp2; ?>' type='text' size='4' maxlength='4' onkeydown='onlyNumber(this);'  itemname='휴대전화 두번째자리'>  -
      <input name='hp3' class=ed value='<?php echo $hp3; ?>' type='text' size='4' maxlength='4' onkeydown='onlyNumber(this);'  itemname='휴대전화 세번째자리'></td></tr>
  <tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 주소</td>
    <td><input size="4" class=ed name="zip1" itemname="우편번호 앞자리" readonly value="<?php echo $zip1; ?>"> -
      <input size="4" class=ed name="zip2" itemname="우편번호 뒷자리" readonly value="<?php echo $zip; 2?>">
      <a href="javascript:;" onclick="win_zip('hwrite', 'zip1', 'zip2', 'add1', 'add2');"><img src="<?php echo $board_skin_path; ?>/img/btn_post.gif" border="0" align="absmiddle" /></a><br />
      <input name="add1" class=ed type="text" style="width:100%" value="<?php echo $add1; ?>" readonly /><br />
      <input name="add2" class=ed type="text" style="width:100%" value="<?php echo $add2; ?>" /></td></tr>
  <tr><td colspan=2 height=1 bgcolor=#e7e7e7></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 성별</td>
    <td><input type="radio" name="sex" value="남" <?php echo $sex=="남"?"checked":""; ?>>남
      <input type="radio" name="sex" value="여" <?php echo $sex=="여"?"checked":"";?>>여</td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가1</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_1" id="wr_1" itemname="추가1" value="<?php echo $write['wr_10']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가2</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_2" id="wr_2" itemname="추가2" value="<?php echo $write['wr_2']?; >"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가3</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_3" id="wr_3" itemname="추가3" value="<?php echo $write['wr_3']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가4</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_4" id="wr_4" itemname="추가4" value="<?php echo $write['wr_4']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가5</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_5" id="wr_5" itemname="추가5" value="<?php echo $write['wr_5']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가6</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_6" id="wr_6" itemname="추가6" value="<?php echo $write['wr_6']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가7</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_7" id="wr_7" itemname="추가7" value="<?php echo $write['wr_7']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가8</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_8" id="wr_8" itemname="추가8" value="<?php echo $write['wr_8']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
  <tr>
    <td style='padding-left:20px; height:30px;'>· 추가9</td>
    <td><input class="hp_skin_field" style="width:100%;" name="wr_9" id="wr_9" itemname="추가9" value="<?php echo $write['wr_9']; ?>"></td></tr>
  <tr><td colspan="2" height="1" bgcolor="#e7e7e7"></td></tr>
<?php //추가필드 끝 ?>


##################################################
write_update.skin.php 에 아래의 내용을 활용

<?php
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가

//전화번호, 성별, 주소
$wr_10 = "{$tel1}|{$tel2}|{$tel3}|{$fax1}|{$fax2}|{$fax3}|{$hp1}|{$hp2}|{$hp3}|{$sex}|{$zip1}|{$zip2}|{$add1}|{$add2}";
sql_query(" update {$write_table} set wr_10 = '{$wr_10}' where wr_id = '{$wr_id}' ");




##################################################
view.skin.php 에 아래의 내용을 활용
<?php
//전화번호, 팩스, 핸드폰, 성별, 주소
$wr10 = explode("|",$view['wr_10']);
$tel1 = $wr10[0];
$tel2 = $wr10[1];
$tel3 = $wr10[2];
$fax1 = $wr10[3];
$fax2 = $wr10[4];
$fax3 = $wr10[5];
$hp1  = $wr10[6];
$hp2  = $wr10[7];
$hp3  = $wr10[8];
$hp3  = $wr10[9];
$zip1 = $wr10[10];
$zip2 = $wr10[11];
$add1 = $wr10[12];
$add2 = $wr10[13];
?>

<?php // 추가필드 ?>
<tr><td width="100%" bgcolor="#FFFFFF" align="center">
  <table width="100%" border="0" cellpadding="5" cellspacing="0">
    <col width="70" />
    <col />
    <tr><td style="padding:6 0 6 10;">전화번호</td><td bgcolor="#FFFFFF"><?php echo $tel1; ?>-<?php echo $tel2; ?>-<?php echo $tel3; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">팩스번호</td><td><?php echo $fax1; ?>-<?php echo $fax2; ?>-<?php echo $fax3; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">핸드폰</td><td><?php echo $hp1; ?>-<?php echo $hp2; ?>-<?php echo $hp3; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">성별</td><td><?php echo $sex; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">주소</td><td >(<?php echo $zip1; ?>-<?php echo $zip2; ?>) <?php echo $add1; ?> <?php echo $add2; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가1</td><td><?php echo $view['wr_1']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가2</td><td><?php echo $view['wr_2']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가3</td><td><?php echo $view['wr_3']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가4</td><td><?php echo $view['wr_4']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가5</td><td><?php echo $view['wr_5']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가6</td><td><?php echo $view['wr_6']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가7</td><td><?php echo $view['wr_7']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가8</td><td><?php echo $view['wr_8']; ?></td></tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
    <tr><td style="padding:6 0 6 10;">추가9</td><td><?php echo $view['wr_9']; ?></td> </tr>
    <tr><td height="1" bgcolor="#E7E7E7" colspan="2"></td></tr>
  </table>
</td></tr>
<?php //추가필드 끝 ?>



##################################################
list.skin.php 에 내용 활용하기

<!-- 게시판 목록 시작 -->
<?php for ($i=0; $i<count($list); $i++) { ?>

아래쪽에 코드 추가

<?php
//전화번호, 팩스, 핸드폰, 성별, 주소
$wr10 = explode("|",$list[$i]['wr_10']);
$tel1 = $wr10[0];
$tel2 = $wr10[1];
$tel3 = $wr10[2];
$fax1 = $wr10[3];
$fax2 = $wr10[4];
$fax3 = $wr10[5];
$hp1  = $wr10[6];
$hp2  = $wr10[7];
$hp3  = $wr10[8];
$hp3  = $wr10[9];
$zip1 = $wr10[10];
$zip2 = $wr10[11];
$add1 = $wr10[12];
$add2 = $wr10[13];
?>

전화: <?php echo $tel1; ?>-<?php echo $tel2; ?>-<?php echo $tel3; ?><br>
팩스: <?php echo $fax1; ?>-<?php echo $fax2; ?>-<?php echo $fax3; ?><br>
핸드폰: <?php echo $hp1; ?>-<?php echo $hp2; ?>-<?php echo $hp3; ?><br>

댓글목록

등록된 댓글이 없습니다.


Total 2,640건 120 페이지
  • RSS
기술자료 목록
260
그누보드   11949  2007-05-03 21:59  
259
영카트   12175  2007-05-01 20:33  
258
MySQL   16025  2007-04-28 05:45  
257
제로보드   15063  2007-04-27 14:13  
256
제로보드   18363  2007-04-23 16:53  
255
JavaScript   21845  2007-04-21 11:59 ~ 2022-11-22 12:11  
254
Linux   57682  2007-04-20 13:14 ~ 2008-05-27 00:00  
253
그누보드   10831  2007-04-16 20:40  
열람
그누보드   16637  2007-04-16 09:39 ~ 2021-06-03 14:49  
251
Linux   21351  2007-04-12 10:35 ~ 2017-03-21 00:00  
250
영카트   11156  2007-04-11 11:50  
249
영카트   12646  2007-04-11 10:32  
248
테크노트   17939  2007-04-10 22:18 ~ 2022-10-13 07:36  
247
그누보드   15738  2007-04-10 08:35 ~ 2017-05-20 00:00  
246
MySQL   15599  2007-04-07 04:06  
245
MySQL   20753  2007-04-05 21:50 ~ 2020-06-04 19:08  
244
MySQL   17340  2007-04-05 21:47 ~ 2017-11-02 18:04  
243
Linux   27818  2007-03-31 18:29 ~ 2010-10-20 00:00  
242
MSSQL   40446  2007-03-30 14:28  
241
ClassicASP   13010  2007-03-28 21:49 ~ 2013-12-28 00:00  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.