묻고답하기
page_full_width" class="col-xs-12" |cond="$__Context->page_full_width">
여기 가입 팝업처럼.......가입하고 나서 바로 로그인되게 하는 방법!좀 가르켜 주세요! <소스 있슴>
2002.08.27 18:38
여기 가입 팝업처럼.......가입하고 나서 바로 로그인되게 하는 방법!좀 가르켜 주세요!
여기 회원가입처럼 가입용 팝업을 등록하고 바로 창닫히면서.부모페이지가 리로드되면서.......
정보를 입력하고 창을 닫을떄 부모창이 리로드 되면서 세션을 받아와서 자동 로그인 되는건 어케 해야 되요!
join.asp(가입창)로그인이라는 링크를 눌렀을때 가입팝업이 뜨고,정보입력하면 join_ok.asp(가입처리)되고,
처리하면서 세션 생성.....창이 닫히면서 부모 창은 자동으로 로그인......소스 올립니다!
프레임5개 나누었구여! 레프트 로그인창은 인클루드했어여!
join.asp//
<html>
<head>
<link rel="stylesheet" href="http://net-in.co.kr/spacefirst/style.css" type="text/css">
<Script Language="javascript" src="http://net-in.co.kr/spacefirst/join.js">
</Script>
</head>
<body onLoad="document.join.id.focus()">
<table border=1 bordercolor=darkblue cellspacing=0 width=530>
<tr>
<td>
<form method="POST" action="join_ok.asp" name="join" onSubmit="return selftest()">
<table border="0" width="500" height="305" cellspacing="0" cellpadding="2" align=center>
<tr>
<td width="486" height="16" colspan="2" class=red align=center>회원가입
<br><br><br><br></td>
</tr>
<tr>
<td colspan="4" bgcolor="darkblue" align="center" height="3"></td>
</tr>
<tr>
<td width="107" height="23">id</td>
<td width="379" height="23">
<input type="text" name="id" size="12" class=input>
<input type="button" value="중복확인하기" class=submit
onClick="idcheck()"></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">name</td>
<td width="379" height="23"><input type="text" name="name" size="10"
class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">password</td>
<td width="379" height="23">
<input type="password" name="passwd" size="12"
class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">Check Password</td>
<td width="379" height="23"><input type="password" name="passwd1"
size="12" class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">주민등록번호</td>
<td width="379" height="23">
<input type="text" name="jumin1" size="7" class=input> -
<input type="password" name="jumin2" size="8"
class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">adress</td>
<td width="379" height="23">
<input type="text" name="zipcode1" size="3" class=input>-
<input type="text" name="zipcode2" size="3" class=input>
<input type="button" value="자동입력하기" onClick="inputaddr()"
class=submit><br>
<input type="text" name="addr" size="50" class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="43">phone</td>
<td width="379" height="43">
<input type="text" name="tel1" size="5" class=input>-
<input type="text" name="tel2" size="5" class=input>-
<input type="text" name="tel3" size="5" class=input>
</td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="43">hphone</td>
<td width="379" height="43">
<input type="text" name="hp1" size="5" class=input>-
<input type="text" name="hp2" size="5" class=input>-
<input type="text" name="hp3" size="5" class=input>
</td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">email</td>
<td width="379" height="23">
<input type="text" name="mail" size="30" class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">job</td>
<td width="379" height="23">
<select size="1" name="job" >
<option>선택--</option>
<option value="학생">학생</option>
<option value="교사">교사</option>
<option value="직장인">직장인</option>
<option value="주부">주부</option>
<option value="기타">기타</option>
</select></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="492" height="25" colspan="2" align="center">
<input type="submit" value="가입하기" class=submit>
<input type="reset" value="취소하기" class=submit></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
join_ok.asp//
<!-- #Include File="../../connect/DbCon.inc" -->
<%
Set db = Server.Createobject("ADODB.Connection")
db.open(connstring)
id = request("id")
name = request("name")
passwd = request("passwd")
jumin = request("jumin1") & "-" & request("jumin2")
zipcode = request("zipcode1")& "-" & request("zipcode2")
addr = request("addr")
tele = request("tel1") & "-" & request("tel2") & "-" & request("tel3")
hp = request("hp1") & "-" & request("hp2") & "-" & request("hp3")
mail = request("mail")
job = request("job")
savedate = date
Set rs = Server.Createobject("ADODB.Recordset")
sqlquery = "select * from member where id like '" & request("id") & "'"
rs.open sqlquery, db, 1
if rs.EOF or rs.BOF then
sqlQuery = "insert into member values
('"&id&"','"&name&"','"&passwd&"','"&jumin&"','"&zipcode&"','"&addr&"','"
&tele&"','"&hp&"','"&mail&"','"&job&"','"&savedate&"')"
db.execute sqlquery
%>
<%
else
%>
<Script Language="javascript">
alert("<%=request("id")%>는 사용중인 아이디입니다.다른 아이디로 등록하세요.");
history.back();
</Script>
<%
end if
%>
<script language="javascript">
window.close()
</script>
<%
rs.close
db.close
set rs= nothing
set db = nothing
%>
조인.asp에서 서브밋 했을때 팝업창이 닫히구 index.asp가 리로드가 되면 되는데요! 쩝! 그게 잘안되네요!
부탁하겠슴다! 글달아주신분 감사드리구요!
여기 회원가입처럼 가입용 팝업을 등록하고 바로 창닫히면서.부모페이지가 리로드되면서.......
정보를 입력하고 창을 닫을떄 부모창이 리로드 되면서 세션을 받아와서 자동 로그인 되는건 어케 해야 되요!
join.asp(가입창)로그인이라는 링크를 눌렀을때 가입팝업이 뜨고,정보입력하면 join_ok.asp(가입처리)되고,
처리하면서 세션 생성.....창이 닫히면서 부모 창은 자동으로 로그인......소스 올립니다!
프레임5개 나누었구여! 레프트 로그인창은 인클루드했어여!
join.asp//
<html>
<head>
<link rel="stylesheet" href="http://net-in.co.kr/spacefirst/style.css" type="text/css">
<Script Language="javascript" src="http://net-in.co.kr/spacefirst/join.js">
</Script>
</head>
<body onLoad="document.join.id.focus()">
<table border=1 bordercolor=darkblue cellspacing=0 width=530>
<tr>
<td>
<form method="POST" action="join_ok.asp" name="join" onSubmit="return selftest()">
<table border="0" width="500" height="305" cellspacing="0" cellpadding="2" align=center>
<tr>
<td width="486" height="16" colspan="2" class=red align=center>회원가입
<br><br><br><br></td>
</tr>
<tr>
<td colspan="4" bgcolor="darkblue" align="center" height="3"></td>
</tr>
<tr>
<td width="107" height="23">id</td>
<td width="379" height="23">
<input type="text" name="id" size="12" class=input>
<input type="button" value="중복확인하기" class=submit
onClick="idcheck()"></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">name</td>
<td width="379" height="23"><input type="text" name="name" size="10"
class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">password</td>
<td width="379" height="23">
<input type="password" name="passwd" size="12"
class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">Check Password</td>
<td width="379" height="23"><input type="password" name="passwd1"
size="12" class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">주민등록번호</td>
<td width="379" height="23">
<input type="text" name="jumin1" size="7" class=input> -
<input type="password" name="jumin2" size="8"
class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">adress</td>
<td width="379" height="23">
<input type="text" name="zipcode1" size="3" class=input>-
<input type="text" name="zipcode2" size="3" class=input>
<input type="button" value="자동입력하기" onClick="inputaddr()"
class=submit><br>
<input type="text" name="addr" size="50" class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="43">phone</td>
<td width="379" height="43">
<input type="text" name="tel1" size="5" class=input>-
<input type="text" name="tel2" size="5" class=input>-
<input type="text" name="tel3" size="5" class=input>
</td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="43">hphone</td>
<td width="379" height="43">
<input type="text" name="hp1" size="5" class=input>-
<input type="text" name="hp2" size="5" class=input>-
<input type="text" name="hp3" size="5" class=input>
</td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">email</td>
<td width="379" height="23">
<input type="text" name="mail" size="30" class=input></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="107" height="23">job</td>
<td width="379" height="23">
<select size="1" name="job" >
<option>선택--</option>
<option value="학생">학생</option>
<option value="교사">교사</option>
<option value="직장인">직장인</option>
<option value="주부">주부</option>
<option value="기타">기타</option>
</select></td>
</tr>
<tr>
<td colspan="5" bgcolor="darkblue" align="center"></td>
</tr>
<tr>
<td width="492" height="25" colspan="2" align="center">
<input type="submit" value="가입하기" class=submit>
<input type="reset" value="취소하기" class=submit></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
join_ok.asp//
<!-- #Include File="../../connect/DbCon.inc" -->
<%
Set db = Server.Createobject("ADODB.Connection")
db.open(connstring)
id = request("id")
name = request("name")
passwd = request("passwd")
jumin = request("jumin1") & "-" & request("jumin2")
zipcode = request("zipcode1")& "-" & request("zipcode2")
addr = request("addr")
tele = request("tel1") & "-" & request("tel2") & "-" & request("tel3")
hp = request("hp1") & "-" & request("hp2") & "-" & request("hp3")
mail = request("mail")
job = request("job")
savedate = date
Set rs = Server.Createobject("ADODB.Recordset")
sqlquery = "select * from member where id like '" & request("id") & "'"
rs.open sqlquery, db, 1
if rs.EOF or rs.BOF then
sqlQuery = "insert into member values
('"&id&"','"&name&"','"&passwd&"','"&jumin&"','"&zipcode&"','"&addr&"','"
&tele&"','"&hp&"','"&mail&"','"&job&"','"&savedate&"')"
db.execute sqlquery
%>
<%
else
%>
<Script Language="javascript">
alert("<%=request("id")%>는 사용중인 아이디입니다.다른 아이디로 등록하세요.");
history.back();
</Script>
<%
end if
%>
<script language="javascript">
window.close()
</script>
<%
rs.close
db.close
set rs= nothing
set db = nothing
%>
조인.asp에서 서브밋 했을때 팝업창이 닫히구 index.asp가 리로드가 되면 되는데요! 쩝! 그게 잘안되네요!
부탁하겠슴다! 글달아주신분 감사드리구요!
그냥 자바 스크립트로 해도 괜찮습니다. 조인.asp에서 서브밋 했을때 타겟이 되는 소스 마지막에 출력 함수를 써서 이걸 넣어보세요.
<script>
opener.location.reload(true);
self.close();
</script>
부모창을 리로드한 다음에 자신을 닫는거죠. 도움이 됬으면 좋겠습니다 - _-/