include("conn.php"); //数据链接 include("common.php"); //引入友好提示自编函数 //写入数据库--------------------------------------- if($_POST[ok]){ if($_POST[username]==''){ErrView("·请输入姓名!",0);exit;} if($_POST[email]==''){ErrView("·请输入电子邮箱!",0);exit;} if($_POST[tel]==''){ErrView("·请输入电话!",0);exit;} if($_POST[mobile]==''){ErrView("·请输入手机!",0);exit;} if($_POST[company]==''){ErrView("·请输入公司名称!",0);exit;} if($_POST[city]==''){ErrView("·请选择所在的城市!",0);exit;} if($_POST[usertype]==''){ErrView("·请输入用户类型!",0);exit;} if($_POST[feedback]==''){ErrView("·请输入反馈内容!",0);exit;} $sql = "insert into signup (username,email,tel,mobile,company,city,usertype,feedback,intime) values ('$_POST[username]','$_POST[email]','$_POST[tel]','$_POST[mobile]','$_POST[company]','$_POST[city]','$_POST[usertype]','$_POST[feedback]',now())"; mysql_query($sql); mysql_close(); ErrView("·报名成功,我们会尽快与您联系!",2); }else{ //读取城市-------------------------------------- $sql = "select * from city order by id asc"; $result = mysql_query($sql); while($rs = mysql_fetch_object($result)) { $cityid .= "\n"; } mysql_close(); ?>