<?php
require_once("../../config.php");
require_once("../check.php");
isset($_POST['img'])?$images = $_POST['img']:$images = null;
isset($_POST['content'])?$content = $_POST['content']:$content = null;
isset($_POST['fenlei'])?$fenlei = $_POST['fenlei']:$fenlei = null;
isset($_POST['title'])?$title = $_POST['title']:$title = null;
$imgarray1 = array(".jpg",".gif",".png");
$imgarray2 = array("a.jpg","a.gif","a.png");
$img = str_replace($imgarray1,$imgarray2,$images);
ini_set("date.timezone","PRC");
$datetime = time();
$urlid = md5($datetime);
$rand = rand(5,10);
$urlid = substr($urlid,5,10);
$content = stripslashes($content);
$arsql = "insert into dunling_article (title,editor,img,images,content,urlid,pv,shenhe,datetime,fenlei) values ('$title','admin','$img','$images','$content','$urlid','0','1','$datetime','$fenlei')";
$arery = mysql_query($arsql,$config)or die(mysql_error());
mysql_close();
if($arery){
    echo "ok";
    exit;
}else{
    echo 'Error';
}
?>