웹마짱구's 블로그

그누보드 회원 성인여부 체크함수

Linux/PHP : 2007/02/23 15:34


아래 함수를 /lib/common.lib.php 하단에 삽입하고
원하는 페이지에서 함수를 호출하여 리턴값에 따라 처리한다.

function is_adult()
{
 $mb_id = get_session("ss_mb_id");
 if($mb_id)
 {
  if(is_admin($mb_id)) return true;
  else
  {
   $row = get_member(get_session("ss_mb_id"), "mb_birth");
   $mb_birth = substr($row["mb_birth"], 0, 4);
   $age = date(Y) - (int) ($mb_birth);

   if($age >= 19) return true;
   else return false;
  }
 }
 return false;
}

top

Linux/PHP : 2007/02/23 15:34 Trackback. : Comment. : view 1252

Trackback Address :: http://jjangu.pe.kr/blog/trackback/359

Write a comment.




: 1 : ... 220 : 221 : 222 : 223 : 224 : 225 : 226 : 227 : 228 : ... 543 :