header("content-type:text/html; charset=utf-8"); include("conn.php"); //数据链接 include("common.php"); //引入友好提示自编函数 //写入数据库--------------------------------------- if($_POST[ok]){ if($_POST[username]==''){ErrView("·请输入姓名!",0);exit;} if($_POST[tel]==''){ErrView("·请输入电话!",0);exit;} if($_POST[company]==''){ErrView("·请输入公司名称!",0);exit;} if($_POST[web]==''){ErrView("·请输入公司网址!",0);exit;} if($_POST[email]==''){ErrView("·请输入E-Mail!",0);exit;} if($_POST[city]==''){ErrView("·请选择所在的城市!",0);exit;} if($_POST[hangye]==''){ErrView("·请选择行业!",0);exit;} $sql = "insert into signup (username,tel,company,web,email,city,hangye,intime) values ('$_POST[username]','$_POST[tel]','$_POST[company]','$_POST[web]','$_POST[email]','$_POST[city]','$_POST[hangye]',now())"; mysql_query($sql); mysql_close(); ErrView("·报名成功,我们会尽快与您联系!",1); }else{ //读取城市-------------------------------------- $sql = "select * from city order by id asc"; $result = mysql_query($sql); while($rs = mysql_fetch_object($result)) { $cityid .= "\n"; } mysql_close(); ?>