这是显示fb样式的php代码/ like,在手动插入数据库之后可以正常工作..但我想在执行脚本后自动插入数据库并将其存储在数据库中
include('db.php');
if($_REQUEST['postId'])
{
$userip = $_SERVER['REMOTE_ADDR'];
mysql_query("update likes set likes=likes+1 where post_id= ".$_REQUEST['postId']);
mysql_query("INSERT INTO ip (userip,post_id) VALUES('".$userip."','".$_REQUEST['postId']."')");
$total_likes = mysql_query("SELECT * FROM facebook_collapsed_likes where post_id = ".$_REQUEST['postId']." ");
$likes = mysql_fetch_array($total_likes);
$likes = $likes['likes'];
}
echo $likes;