PHP之路

来源:互联网 发布:2015编程语言排行 编辑:程序博客网 时间:2024/06/10 13:16

 if(!empty($_POST['submit'])){
 $cid = intval($_POST['cid']);
 $uid = intval($_POST['uid']);
 $count = 0;
 $count= $_SGLOBAL['db']->result($_SGLOBAL['db']->query("SELECT COUNT(*) FROM ".tname('estimates')." WHERE cid='$cid' AND uid='$uid'"));
 if($count>10 ){
 
 showmessage('the_shangpingcishu_succuss','commodity.php?ac=three','2');
 
 }
 else{
 
       $setarr = array(
     'cname' => getstr($_POST['cname'],50),
     'cid' => intval($_POST['cid']),
     'uid' => intval($_POST['uid']),
     'username' => getstr($_POST['username']),
     'price' => intval($_POST['price']),
     'ctime' => time()
    );
    inserttable('estimates',$setarr, 0, true);
    showmessage('the_commoditypingjia_succuss','commodity.php?ac=three','1');
   
   }
  }