[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 458건 23 페이지
  • RSS
기술자료 목록
18
그누보드   12768  2007-06-08 11:57 ~ 2023-01-20 11:39  
17
그누보드   14508  2007-05-06 09:17  
16
그누보드   11948  2007-05-03 21:59  
15
그누보드   10829  2007-04-16 20:40  
열람
그누보드   16635  2007-04-16 09:39 ~ 2021-06-03 14:49  
13
그누보드   15736  2007-04-10 08:35 ~ 2017-05-20 00:00  
12
그누보드   15624  2007-03-13 13:40  
11
그누보드   16570  2007-03-09 08:48  
10
그누보드   13042  2007-03-01 19:07  
9
그누보드   13770  2007-03-01 19:04 ~ 2018-11-16 12:40  
8
그누보드   11768  2007-03-01 18:55  
7
그누보드   15487  2007-02-01 12:14 ~ 2009-05-13 00:00  
6
그누보드   18116  2007-01-28 18:45  
5
그누보드   17551  2007-01-28 06:08 ~ 2021-08-02 21:45  
4
그누보드   12704  2007-01-26 21:05  
3
그누보드   12181  2007-01-04 10:07  
2
그누보드   21592  2006-12-30 14:50  
1
그누보드   17229  2006-11-08 21:44 ~ 2020-10-07 18:49  

검색

해피정닷컴 정보

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

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