<?php
session_start();
include("../conn.php");
include("../function.php");
$id=sqlstr($_GET["id"]);
$sid=sqlstr($_GET["sid"]);
$uinfo=mysql_fetch_array(mysql_query("select * from pic where picid='$id'"));
$ding=$uinfo["zan"]+1;
if($_SESSION['sid']!=$sid || $_SESSION['id']!=$id){
$_SESSION['sid']=$sid;
$_SESSION['id']=$id;
mysql_query("UPDATE pic SET zan='$ding' WHERE picid='$id'");
header("Location:../pic/index.php");
exit;//执行完返回影像
}else{
header("Location:../pic/index.php");
exit;//执行完返回影像
}
?>