PHP页面
//初始化act
$_REQUEST['act']=$_REQUEST['act']?$_REQUEST['act']:'';
if($_REQUEST['act']=='add'){
include 'templates/zhiliang_add.php';
}elseif($_REQUEST['act']=='insert'){ //文件上传
//var_dump($new_file_name);
$title=$_POST['title'];
$content=$_POST['content'];
$time=$_POST['time'];
include 'db.class.php';
$db=new db('localhost','root','123','fanyi');
$sql="insert into zhiliang values(null,'$title','$content','$time')";
if(mysql_query($sql)){
echo "添加成功";
}
}
--------------------------------------------------------------------------------------------------------
HTML页面
标题 | * |
时间 | |
文章内容 | |