관리 메뉴

엉망진창

[펌]실시간 쪽지 PHP 본문

Study_Web/PHP

[펌]실시간 쪽지 PHP

엉망진창 2007. 4. 23. 16:01

원문



실시간 쪽지 소스

<script language='javascript'>

function start()
{
setInterval("alert()",5000);
}

function alert()
{
location.reload();
window.status=" ";
return true;
}

function na_open_window(name, url, left, top, width, height, toolbar, menubar, statusbar, scrollbar, resizable)
{
toolbar_str = toolbar ? 'yes' : 'no';
menubar_str = menubar ? 'yes' : 'no';
statusbar_str = statusbar ? 'yes' : 'no';
scrollbar_str = scrollbar ? 'yes' : 'no';
resizable_str = resizable ? 'yes' : 'no';
window.open(url, name, 'left='+left+',top='+top+',width='+width+',height='+height+',toolbar='+toolbar_str+',menubar='+menubar_str+
',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
}

</script>

<?
include("admin.cfg");
$connect = mysql_connect($DB_Host,$DB_ID,$DB_Passwd);
mysql_select_db($DB_Name,$connect);

if($Member_ID){
$result = mysql_query("SELECT no FROM Memo WHERE receiver='$Member_ID' AND check='N' ORDER BY no DESC",$connect);
if(!$result){
echo("<Script>alert('Memo DataBase Error...');history.go(-1);</Script>");
exit;
}
$num = mysql_num_rows($result);

if($num){
$no = mysql_result($result,0,0);
echo("<bgsound src='alarm.wav'>");
echo("<script>na_open_window('$no','${Program_URL}/Memo/inputmemo.php?type=view&no=$no',100,100,520, 450, 0, 0, 0, 1
, 1);</script>");
}

echo("<script>start();</script>");
}

?>