<?php

namespace Addons\Messages\Controller;
use Home\Controller\AddonsController;

class MessagesController extends AddonsController{
	function upmessage() {
		$data['nickname'] = htmlspecialchars($_POST['name']);
		$data['link'] = htmlspecialchars($_POST['link']);
		$data['content'] = htmlspecialchars($_POST['content']);
		$data['starttime'] = NOW_TIME;

			//数据库操作
			$messageDB = M('messages');
			
			$result = $messageDB->add($data);
			
			if($result){
				echo("成功");
				$this->success('操作完成','index.php',3);
				//$this->ajaxReturn('成功记录');
			}else{
				echo("失败");
				//$this->ajaxReturn('失败记录');
			}
	}
}