<?
if($_POST['update'] ==null){
$sql ="select Score_friend,Username from member where Username = '$_SESSION[friend]' and status in (1,4)";
$result = mysql_query($sql) or die (mysql_error());
$i=0;
while(($row = mysql_fetch_array($result))!=false){
}
}else{
if((isset($_COOKIE[lastGiveScore])==false&& isset($_SESSION[lastGiveScore]) ==false)||$_SESSION[lastGiveScore] < date(m.d.y))
{
$c = time()+60*60*24;
setcookie('lastGiveScore','1',$c);
$_SESSION['lastGiveScore']=$c;
ob_end_flush();
$sql ="update member set Score_friend=Score_friend+({$_POST[scroe_friend]}) where Username = '$_SESSION[friend]' and status in (1,4)";
//echo $sql;
$result = mysql_query($sql) or die (mysql_error());
}
}
?>