묻고답하기

로그인 확인이 잘 안되어서 ...???

로그인 쿠키생성후에 로그인 아이디와 등급이 안보여져서 문의드립니다.

******************* 로그인 입력부분과 표출부분 *********************

<!-- 로그전 -->
<script language="JavaScript">

   function check()  {
    if(login.id.value=="")  {
     alert("아이디를 입력하세요.");
     login.id.focus();
     return false;

    } else if (login.passwd.value=="") {
     alert("비밀번호를 입력하세요.");
     login.passwd.focus();
     return false;
    
    }else {
     return true;
    }
   }
   </script>

<?php
if(!$_COOKIE[cgmember_id] || !$_COOKIE[cgmember_name]) {
?>

<table cellpadding=0 cellspacing=0>
<form name=login action="http://caregiver.bbidc.com/log_pro.php" method="post" onSubmit="return check()">
<!-- 스크립트 안먹힐때 부호를 붙혀준다 -->

<tr>
<td width=185 background=http://caregiver.bbidc.com/member/imgs/log_id.gif>
                
<input type=text name="id" size=14 style=border-style:none; background-color:transparent; maxlength=14>
</td>
<td width=181 background=http://caregiver.bbidc.com/member/imgs/log_password.gif>
                  
<input type=password name="passwd" size=14 style=border-style:none; background-color:transparent; maxlength=10>
</td>
<td>
      
<input type=image src=http://caregiver.bbidc.com/member/imgs/log_in.gif width=59 height=34 style=border-style:none; name="Submit" >
        
</td>
<td><a href=http://caregiver.bbidc.com/member/member_lost_id.php><img src=http://caregiver.bbidc.com/member/imgs/log_lost_idpw.gif width=72 height=34 border=0></a>
</td>
<td><a href=http://caregiver.bbidc.com/member/member_write.php><img src=http://caregiver.bbidc.com/member/log_member.gif border=0 width=74 height=34></a>
</td>
</tr>
</form>


</table>
<?
}
else {
?>




<!-- 로그후 -->






<table cellpadding=0 cellspacing=0>
<tr>
<td>

<table cellpadding=0 cellspacing=0>
<tr>
<td width=228  background=http://caregiver.bbidc.com/member/imgs/log_member_bg.gif valign=bottom>
                      
<table align=center cellpadding=0 cellspacing=0 width=92% height=30>
<tr>
<td><p align=center><font color=#00849F>
<?=$_COOKIE[cgmember_id]?></font> 회원님 어서오십시오.
<font color=#ff9999>[Level : ]</font></p>
</td>
</tr>
</table>

</td>
<td>
<p><img src=http://caregiver.bbidc.com/member/imgs/log_myinfo.gif width=75 height=34 border=0></p>
</td>
                              
</tr>
</table>
      
</td>
<td>
<p><img src=http://caregiver.bbidc.com/member/imgs/log_profile.gif border=0 width=80 height=34></p>
</td>
<td>
<p><a href=http://caregiver.bbidc.com/member/log_out.php><img src=http://caregiver.bbidc.com/member/imgs/log_out.gif border=0 width=69 height=34></a></p>
</td>
</tr>
</table>
<?
}
?>





***********************쿠키생성부분************************





<?php
include("dbcon.php");

$query = "select * from cg_member where id='$id'";
$result = mysql_query($query, $connect);
$rows = mysql_num_rows($result);

if(!$rows) {
echo ("
<script>
alert('[error!] 관리자에게 문의하십시오.')
history.go(-1)
</script>

");
exit;
}
else {
$info = mysql_fetch_array($result);

if($info['passwd']  != $passwd) {
  echo("
   <script>
   alert('비밀번호가 다릅니다.')
   history.go(-1)
   </script>
   ");
  exit;
}
else {
  setcookie("cgmember_id", $id, time()+3600);
  setcookie("cgmember_name", $name, time()+3600);
  setcookie("cgmember_email", $email, time()+3600);
  setcookie("cgmember_grade", $grade, time()+3600);
  if($id == 'caregiver')
   echo ("
   <script>
   location='admin/member_admin.php'+ '+ '
  </script>

   ");
   else
    echo("
<meta http-equiv='refresh' content='0;url=index.php'>
    ");
}
}

mysql_close();
exit;

?>



리플것두 적용시켜서 했는데... 잘안되어서...ㅠ.ㅠ

쿠키는 생성되는데...

생성후에 표출되는 부분이 안됩니다.