日期:2014-05-16 浏览次数:20488 次
if(empty($grouptypeid)){这要怎么写才简单呢?
ShowMsg('请指定所属考试!', '-1');
exit();
}if(empty($content)){
ShowMsg('内容不能为空!','-1');
exit();
}if(empty($teachername)){
ShowMsg('请选择教师!','-1');
exit();
}if(empty($years)){
ShowMsg('请选择日期','-1');
exit();
}if(empty($isupdate)){
ShowMsg('请选择更新日期','-1');
exit();
}
$dict = array(
'grouptypeid' => '请指定所属考试!',
'content' => '内容不能为空!',
'teachername' => '请选择教师!',
'years' => '请选择日期',
'isupdate' => '请选择更新日期',
);
foreach($_POST as $k=>$v) {
if(empty($v)) {
ShowMsg($dict[$k], '-1');
exit;
}
$$k = $v;
}