<?
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{
echo $_POST['scroe_friend'];
echo $_SESSION['friend'];
if((isset($_COOKIE[lastGiveScore])==false&& isset($_SESSION[lastGiveScore]) ==false)||$_SESSION[lastGiveScore] < date()+60*60*24)
{
$t = time()+60*60*24;
setcookie('lastGiveScore','1',$t);
$_SESSION['lastGiveScore']=$t;
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());
}
}
?>
<?
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{
echo $_POST['scroe_friend'];
echo $_SESSION['friend'];
if((isset($_COOKIE[lastGiveScore])==false&& isset($_SESSION[lastGiveScore]) ==false)||$_SESSION[lastGiveScore] < date(60*60*24))
{
$t = time(60*60*24);
setcookie('lastGiveScore','1',$t);
$_SESSION['lastGiveScore']=$t;
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());
}
}
?>