회원 아이디 찾기를 이름, 생년월일, 성별로 검색해서 보여주려고 하는데요
이름,생년월일,성별이 같은 회원이 있을경우 그 값을 리스트로 출력하려고 합니다.
예) 아이디 : kam** 가입일 :2013년 4월 2일
아이디 : jju** 가입일 : 2012년 3월 1일
정보가 하나일 때는 잘 출력됩니다.
그런데 둘이상일 때는 최초 가입자만 출력이 됩니다.
리스트로 출력하려면 어떤부분을 수정해야 하는지 조언 부탁드립니다.
for문을 써야 할 것 같은데 잘 안되서요.
아래 소스도 한번 봐주세요 잘못된 부분이 있는지요.
//** findid.skin.php
<div id="idfind">
<form name=idfind method=post onsubmit="return idfind_submit(this);" autocomplete=off>
<ol><li>이름<br /> <input type="text" name="mb_name" itemname="이름" size="18" /></li></ol>
<ol><li>생년월일<br /><input type="text" name="mb_birth" itemname="생일" size="30" /></li></ol>
<ol><li>성별 <select name="mb_sex">
<option value="">선택하세요</option>
<option value="M">남자</option>
<option value="F">여자</option>
</select> </li></ol>
<ol><input type="image" src="<?=$member_skin_path?>/img/btn_next_01.gif"></ol>
</form>
</div>
<script language="JavaScript">
function idfind_submit(f)
{
if (f.mb_name.value == "") {
alert("이름을 입력하여 주십시오.");
mb_name.focus();
return false;
}
if (f.mb_birth.value == "") {
alert("생년월일을 입력하여 주십시오(예:19990101)");
mb_birth.focus();
return false;
}
if (f.mb_sex.value == "") {
alert("성별을 선택하여 주십시오");
mb_sex.focus();
return false;
}
f.action = "./idfind_check.php";
return true;
}
</script>
//** findid_check.php
include_once("./_common.php");
// 토큰 생성
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
$norobot_key = substr($token, 0, rand(4,6));
set_session("ss_norobot_key", $norobot_key);
$mb_name = $_POST['mb_name'];
$mb_birth = $_POST['mb_birth'];
$mb_sex = $_POST['mb_sex'];
if (!$mb_name && !$mb_birth && !$mb_sex)
alert_close("정보가 없습니다.");
$sql = " select mb_id, mb_name, mb_birth, mb_sex, mb_datetime from $g4[member_table] where mb_name = '$mb_name' and mb_birth ='$mb_birth' and mb_sex='$mb_sex' ";
$mb = sql_fetch($sql);
if (!$mb[mb_name])
alert("존재하지 않는 회원입니다.");
else if (is_admin($mb[mb_id]))
alert("관리자 아이디는 접근 불가합니다.");
$g4[title] = "아이디 찾기";
include_once("$g4[path]/head.sub.php");
include_once("_head.php");
$member_skin_path = "$g4[path]/skin/member/$config[cf_member_skin]";
include_once("$member_skin_path/idfind_result.skin.php");
include_once("_tail.php");
include_once("$g4[path]/tail.sub.php");
/* findid_sesult.skin.php
아이디 : <?=substr($mb['mb_id'],0,-2).'**'?>
가입일 : <?=date('Y년 m월 d일',strtotime($mb[mb_datetime)?>
이름,생년월일,성별이 같은 회원이 있을경우 그 값을 리스트로 출력하려고 합니다.
예) 아이디 : kam** 가입일 :2013년 4월 2일
아이디 : jju** 가입일 : 2012년 3월 1일
정보가 하나일 때는 잘 출력됩니다.
그런데 둘이상일 때는 최초 가입자만 출력이 됩니다.
리스트로 출력하려면 어떤부분을 수정해야 하는지 조언 부탁드립니다.
for문을 써야 할 것 같은데 잘 안되서요.
아래 소스도 한번 봐주세요 잘못된 부분이 있는지요.
//** findid.skin.php
<div id="idfind">
<form name=idfind method=post onsubmit="return idfind_submit(this);" autocomplete=off>
<ol><li>이름<br /> <input type="text" name="mb_name" itemname="이름" size="18" /></li></ol>
<ol><li>생년월일<br /><input type="text" name="mb_birth" itemname="생일" size="30" /></li></ol>
<ol><li>성별 <select name="mb_sex">
<option value="">선택하세요</option>
<option value="M">남자</option>
<option value="F">여자</option>
</select> </li></ol>
<ol><input type="image" src="<?=$member_skin_path?>/img/btn_next_01.gif"></ol>
</form>
</div>
<script language="JavaScript">
function idfind_submit(f)
{
if (f.mb_name.value == "") {
alert("이름을 입력하여 주십시오.");
mb_name.focus();
return false;
}
if (f.mb_birth.value == "") {
alert("생년월일을 입력하여 주십시오(예:19990101)");
mb_birth.focus();
return false;
}
if (f.mb_sex.value == "") {
alert("성별을 선택하여 주십시오");
mb_sex.focus();
return false;
}
f.action = "./idfind_check.php";
return true;
}
</script>
//** findid_check.php
include_once("./_common.php");
// 토큰 생성
$token = md5(uniqid(rand(), true));
set_session("ss_token", $token);
$norobot_key = substr($token, 0, rand(4,6));
set_session("ss_norobot_key", $norobot_key);
$mb_name = $_POST['mb_name'];
$mb_birth = $_POST['mb_birth'];
$mb_sex = $_POST['mb_sex'];
if (!$mb_name && !$mb_birth && !$mb_sex)
alert_close("정보가 없습니다.");
$sql = " select mb_id, mb_name, mb_birth, mb_sex, mb_datetime from $g4[member_table] where mb_name = '$mb_name' and mb_birth ='$mb_birth' and mb_sex='$mb_sex' ";
$mb = sql_fetch($sql);
if (!$mb[mb_name])
alert("존재하지 않는 회원입니다.");
else if (is_admin($mb[mb_id]))
alert("관리자 아이디는 접근 불가합니다.");
$g4[title] = "아이디 찾기";
include_once("$g4[path]/head.sub.php");
include_once("_head.php");
$member_skin_path = "$g4[path]/skin/member/$config[cf_member_skin]";
include_once("$member_skin_path/idfind_result.skin.php");
include_once("_tail.php");
include_once("$g4[path]/tail.sub.php");
/* findid_sesult.skin.php
아이디 : <?=substr($mb['mb_id'],0,-2).'**'?>
가입일 : <?=date('Y년 m월 d일',strtotime($mb[mb_datetime)?>
댓글 2개
게시글 목록
| 번호 | 제목 |
|---|---|
| 284508 | |
| 284499 | |
| 284492 | |
| 284490 | |
| 284484 | |
| 284481 | |
| 284478 | |
| 284476 | |
| 284474 | |
| 284472 | |
| 284470 | |
| 284458 | |
| 284457 | |
| 284454 | |
| 284453 | |
| 284447 | |
| 284446 | |
| 284444 | |
| 284441 | |
| 284440 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기