회원로그인
16년 전
새창에서 검색결과를 부모창에 값 넘겨주기
##### test.php #####
<script type="text/javascript">
<!--
function newwindow2(URL,width,height) {
var str,width,height;
str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,";
str=str+"width="+width;
str=str+",height="+height+"'";
window.open(URL,'remote',str);
}
//-->
</script>
<input name="freecode" type="text" class="input" id="free" style="width:70px" class="hp_input" readonly>
<img src="./img/zipcode_find.gif" border="0" align="absmiddle" onclick="newwindow2('test_find.php',400,180)">
##### dbconfig.php #####
<?
$mysql_host = "DB주소";
$mysql_user = "DB아이디";
$mysql_password = "DB비밀번호";
$mysql_db = "DB네임";
$dbconn = mysql_connect("$mysql_host","$mysql_user","$mysql_password") or die("데이터베이스 연결에 실패하였습니다.");
mysql_select_db($mysql_db,$dbconn);
?>
##### test_find.php #####
<?
// php.ini 의 register_globals=off 일 경우 (php >= 4.1.0)
@extract($_GET);
@extract($_POST);
@extract($_SERVER);
include "dbconfig.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>HappyJung.com</title>
<script type="text/javascript">
<!--
function ok() {
if (document.WriteForm.freecode.value=="" ) {
alert("\ 인증할 번호를 입력하여 주시기바립니다.");
return;
}
document.WriteForm.submit();
}
function InStrData(freecode){
opener.document.WriteForm.freecode.value = '<?=$freecode?>';
window.close();
}
//-->
</script>
<style>
body { margin: 0; font-size:12px; }
td { font-size:12px; }
a:link { font-family:"돋움"; text-decoration:none; color:#000000; line-height: 18px;}
a:active { font-family:"돋움"; text-decoration:none; color:#000000; line-height: 18px;}
a:visited { font-family:"돋움"; text-decoration:none; color:#000000; line-height: 18px;}
a:hover { font-family:"돋움"; text-decoration:underline; color:#000000; line-height: 18px;}
</style>
</head>
<body>
<center>
<table width="400" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="33" bgcolor="#d82d25"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"> </td>
<td> <strong><font color="#FFFFFF">무료 코드번호</font></strong></td>
</tr>
</table></td>
</tr>
<tr>
<td valign="top"><table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" style="padding:20px 0 20px 0;">
<?
if ($freecode == "") {
echo "무료 코드번호를 입력하여주세요";
} else {
$query = "select * from 테이블이름 where free='$freecode'";
//echo $query;
$result = mysql_query($query);
$data = mysql_fetch_array($result);
//echo "free = ". $data[free];
if ($data[free] <> "") {
if ($data[wdate] <> "") {
echo "입력하신 <b>". $freecode ."</b>는 이미 등록된 번호<br><br><script type='text/javascript'><!-- self.close(); } --></script><a href='#' onclick='javascript:window.close();'><b>[ 창닫기 ]</b></a>";
} else {
?>
입력하신 <b> <?=$freecode?></b>가 인증되었습니다. <br>등록된 번호는 재신청이 불가합니다.<br>신청을 계속하시겠습니까?<br><br>
<center><a href="javascript:InStrData('<?=$freecode?>')"><b>[ 사용하기 ]</b></a></center>
<?
}
} else {
echo "입력하신 <b>". $freecode ."</b>는 사용할수 없습니다.<br><br><script type='text/javascript'><!-- self.close(); } --></script><a href='#' onclick='javascript:window.close();'><b>[ 창닫기 ]</b></a>";
}
}
?></td>
</tr>
<tr>
<td height="40" align="center" bgcolor="#f1f1f1">
<form action="test_find.php" method="post" name="WriteForm" style="margin:0;">
무료 코드번호
<input name="freecode" type="text" class="input_box" size="20" maxlength="12" />
<input type="button" class="input_box" value="인증하기" onClick="ok()" />
</form>
</td>
</tr>
</table></td>
</tr>
</table>
</center>
</body>
</html>
추천 : 388
추천
목록