정보수정에서 이메일 수정
본문
수고하십니다.
의뢰를해서
회원정보에서 프로그램을 조금 바꾸었는데
이메일 수정하는 부분이 아이디나 이름 처럼
수정할 수 없게 되어 있습니다.
이메일을 수정할 수있게 하려면 어떻게 해야할까요?
register_form.skin.php
<tr>
<th scope="row"><label for="reg_mb_email">이메일</label> <strong class="sound_only">필수</strong></th>
<td>
<div class="hidden_div">이메일 <strong class="sound_only">필수</strong></div>
<?php if($w){ ?>
<?php echo get_text($member['mb_email']) ?>
<input type="hidden" name="emailid" value="<?php echo $member['emailid']; ?>" id="reg_emailid">
<input type="hidden" name="emailserver" value="<?php echo $member['emailserver']; ?>" id="reg_emailserver">
<?php }else{ ?>
<span class="input_txt w150">
<input type="text" class="frm_input" name="emailid" id="emailid" value="<?php echo $member['emailid'];?>">
</span>
<span class="symbol">@</span>
<span class="input_txt w150">
<input type="text" class="frm_input" name="emailserver" id="emailserver" value="<?php echo $member['emailserver'];?>">
</span>
<span class="select w150">
<select name="domain" id="domain" class="frm_input" onChange="domainChange(this.form);">
<option value="">== 선택 ==</option>
<?php
foreach ($emailserver_array as $key => $value) {
echo '<option value="'.$key.'">'.$value.'</option>';
}
?>
<option value="">직접입력</option>
</select>
</span>
<button type="button" class="btn_frmline emailcheck" style="padding:0 15px;">중복확인</button>
<?php } ?>
<input type="hidden" name="mb_email" value="<?php echo $member['mb_email']; ?>" id="reg_mb_email">
</td>
</tr>
답변 3
아래처럼 수정하세요
기존
<tr>
<th scope="row"><label for="reg_mb_email">이메일</label> <strong class="sound_only">필수</strong></th>
<td>
<div class="hidden_div">이메일 <strong class="sound_only">필수</strong></div>
<?php if($w){ ?>
<?php echo get_text($member['mb_email']) ?>
<input type="hidden" name="emailid" value="<?php echo $member['emailid']; ?>" id="reg_emailid">
<input type="hidden" name="emailserver" value="<?php echo $member['emailserver']; ?>" id="reg_emailserver">
<?php }else{ ?>
<span class="input_txt w150">
<input type="text" class="frm_input" name="emailid" id="emailid" value="<?php echo $member['emailid'];?>">
</span>
<span class="symbol">@</span>
<span class="input_txt w150">
<input type="text" class="frm_input" name="emailserver" id="emailserver" value="<?php echo $member['emailserver'];?>">
</span>
<span class="select w150">
<select name="domain" id="domain" class="frm_input" onChange="domainChange(this.form);">
<option value="">== 선택 ==</option>
<?php
foreach ($emailserver_array as $key => $value) {
echo '<option value="'.$key.'">'.$value.'</option>';
}
?>
<option value="">직접입력</option>
</select>
</span>
<button type="button" class="btn_frmline emailcheck" style="padding:0 15px;">중복확인</button>
<?php } ?>
<input type="hidden" name="mb_email" value="<?php echo $member['mb_email']; ?>" id="reg_mb_email">
</td>
</tr>
변경후
<tr>
<th scope="row"><label for="reg_mb_email">이메일</label> <strong class="sound_only">필수</strong></th>
<td>
<div class="hidden_div">이메일 <strong class="sound_only">필수</strong></div>
<span class="input_txt w150">
<input type="text" class="frm_input" name="emailid" id="emailid" value="<?php echo $member['emailid'];?>">
</span>
<span class="symbol">@</span>
<span class="input_txt w150">
<input type="text" class="frm_input" name="emailserver" id="emailserver" value="<?php echo $member['emailserver'];?>">
</span>
<span class="select w150">
<select name="domain" id="domain" class="frm_input" onChange="domainChange(this.form);">
<option value="">== 선택 ==</option>
<?php
foreach ($emailserver_array as $key => $value) {
echo '<option value="'.$key.'">'.$value.'</option>';
}
?>
<option value="">직접입력</option>
</select>
</span>
<button type="button" class="btn_frmline emailcheck" style="padding:0 15px;">중복확인</button>
<input type="hidden" name="mb_email" value="<?php echo $member['mb_email']; ?>" id="reg_mb_email">
</td>
</tr>
현재 코드상으론 입력을 막는 속성이 없는거같은데
jquery나 script단에서 막고있는지 확인해보셔야할거같네요
<input type="text" class="frm_input" name="emailid" id="emailid" value="<?php echo $member['emailid'];?>">
이 코드가 이메일 아이디를 적는부분인데 해당 페이지에서 emailid를 검색해서 입력을 제어하는 구문이 있는지 찾아보세요
현재 코드를 보면
<input type="hidden" name="mb_email" value="<?php echo $member['mb_email']; ?>" id="reg_mb_email"> <----- 이부분을 제거하시면 가능할겁니다.. 다만. 먼저 이렇게 수정하신 이유를 먼저 알고 처리하시는 게 좋겠습니다. (단순히 @를 기준으로 앞뒤 작업을 하신것이라면 제거하시면OK)
이유는 register_form.update.php 파일에 ==> $mb_email=$_POST[emailid]."@".$_POST[emailserver];
이런 부분이 있을겁니다.. 이렇게 수정하신 이유를 먼저 알고 바꾸시는게 좋습니다.
참고로 : <input type="hidden" name="mb_email" value="<?php echo $member['mb_email']; ?>" id="reg_mb_email"> 이부분을 그대로 남겨둔 이유가 불분명합니다.
if($w) <--수정일때 else <---입력일때 처리해서 register_form.update.php로 넘겨 $mb_email=$_POST[emailid]."@".$_POST[emailserver]; 으로 저장하기 때문에 실수로 남겨둔것이 아닌가 합니다.