Esempio n. 1
0
@header("Content-type: text/html; charset=utf-8");
include "db.php";
if (isset($_GET['do'])) {
    $do = $_GET['do'];
    $cid = $_GET['cid'];
} else {
    die("invild action");
}
switch ($do) {
    case "del":
        DoDelete();
        echo "<script>location.href='shenhe.php';</script>";
        break;
    case "shenhe":
        DoShenhe();
        echo "<script>location.href='shenhe.php';</script>";
        break;
    case "del_all":
        DoDel_all();
        echo "<script>alert('操作成功,你的微信墙已经焕然一新哦!');location.href='shenhe.php';</script>";
        break;
}
function DoShenhe()
{
    $cid = $_GET['cid'];
    $sql_num = "SELECT * FROM  `weixin_wall_num` ";
    $query_num = mysql_query($sql_num);
    $q = mysql_fetch_row($query_num);
    $num = $q[0];
    $sql1 = "UPDATE  `weixin_wall` SET  `ret` =  '1',`num` = '{$num}',`status` =  '0' WHERE  `id` = '{$cid}'";
Esempio n. 2
0
function addmassage()
{
    $data = $_GET['data'];
    $nickname = bin2hex('系统公告');
    $data = bin2hex($data);
    $sql_add = "INSERT INTO `weixin_wall` (`id`,`messageid`,`fakeid`,`num`,`content`,`nickname`,`avatar`,`ret`,`fromtype`,`image`) VALUES (NULL,'0','123','-1','{$data}','{$nickname}','../img/0.jpg','0','weixin','')";
    mysql_query($sql_add);
    $cidD = mysql_query('select id from `weixin_wall` WHERE id =(select max(id) from `weixin_wall`)');
    $row = mysql_fetch_array($cidD, MYSQL_ASSOC);
    $maxid = $row['id'];
    DoShenhe($maxid);
}