<?php
require_once("../check.php");
require_once("../../config.php");
isset($_GET['id'])?$id=$_GET['id']:$id=null;
isset($_GET['pr'])?$pr=$_GET['pr']:$pr=null;
if(($pr<"1") or ($pr>"4") or ($pr==null) or ($id==null)){
    echo "error";
    exit;
}
$deltuijiansql = "update dunling_article set tuijian=null where tuijian='$pr'";
$deltuijian = mysql_query($deltuijiansql,$config);
$sql = "update dunling_article set tuijian='$pr' where id='$id'";
$oks = mysql_query($sql,$config)or die("delerror");
mysql_close();
if($oks){
    echo "ok";
}
?>