정보수정에서 이메일 수정

정보수정에서 이메일 수정

QA

정보수정에서 이메일 수정

본문

수고하십니다.

 

의뢰를해서

회원정보에서 프로그램을 조금 바꾸었는데

 

이메일 수정하는 부분이 아이디나 이름 처럼

수정할 수 없게 되어 있습니다.

 

이메일을 수정할 수있게 하려면 어떻게 해야할까요?

 

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를 검색해서 입력을 제어하는 구문이 있는지 찾아보세요

해당 페이지내에 없다면
아마 register.lib인가 js가 있을텐데
해당 부분에서도 한번 찾아보시고
현재 문제되는게 input이 수정이 안되시는건지(readonly 상태)
input값을 수정하고 넘겼을때 수정이 안되는건지 정확히 말씀해주시면 좋을거같네요
가능하시다면 페이지주소도 올려주시면 좋고요

현재 코드를 보면 

<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]; 으로 저장하기 때문에 실수로 남겨둔것이 아닌가 합니다.

 

<?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{ ?>
                                            <!------을 아래로 바꾸세요

                              <?php if($w){ ?>
                                            <input type="text" name="emailid" value="<?php echo $member['emailid']; ?>" id="reg_emailid">@
                                            <input type="text" name="emailserver" value="<?php echo $member['emailserver']; ?>" id="reg_emailserver">
                                <?php }else{ ?>

아래 내용을 올리신 내용과 교체해보세요

                                  <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){ ?>

                                            <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) {
        if($member['emailserver']==$key) {
                                                        echo '<option value="'.$key.'" selected>'.$value.'</option>';        
} else {
                                                        echo '<option value="'.$key.'">'.$value.'</option>';
}
                                                    }
                                                    ?>
                                                    <option value="">직접입력</option>
                                                </select>
                                            </span>
                                            <button type="button" class="btn_frmline emailcheck" style="padding:0 15px;">중복확인</button>



                                            <?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 }  ?>
                                        </td>
                                    </tr>

감사합니다.

알려주신 것 처럼수정을하니 수정을 할 수 있게 나타나기는 합니다.

하지만 이메일 중복검사가 안되며 정보수정 버튼을 누르면
이메일을 확인하라는 메시지가 나오네요. ㅠㅠ

아래와 같이 하면
중복검사 버튼이 없지만 수정하기는 되네요.

<?php if($w){ ?>
                                            <input type="text" name="emailid" value="<?php echo $member['emailid']; ?>" id="reg_emailid">@
                                            <input type="text" name="emailserver" value="<?php echo $member['emailserver']; ?>" id="reg_emailserver">
<?php }else{ ?>

답변을 작성하시기 전에 로그인 해주세요.
전체 35
QA 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT