当前位置: 首页 > news >正文

赶集网网站建设做外贸 网站

赶集网网站建设,做外贸 网站,陈铭生怎么死的,图片瀑布流网站模板题目要求 1.封装类 ?php class DBDA {public $fuwuqilocalhost; //服务器地址public $yonghumingroot;//用户名public $mima;//密码 public $dbconnect;//连接对象//操作数据库的方法//$sql代表需要执行的SQL语句//$type代表SQL语…题目要求   1.封装类 ?php class DBDA {public $fuwuqilocalhost; //服务器地址public $yonghumingroot;//用户名public $mima;//密码 public $dbconnect;//连接对象//操作数据库的方法//$sql代表需要执行的SQL语句//$type代表SQL语句的类型1代表查询2代表增删改//$shujukuming代表数据库的名称//如果是查询返回二维数组//如果是增删改返回true或falsefunction Query($sql,$type1,$shujukuminghouse){//造连接对象$this-dbconnect new MySQLi($this-fuwuqi,$this-yonghuming,$this-mima,$shujukuming);//判断是否出错if(!mysqli_connect_error()){//如果连接成功,执行SQL语句$result $this-dbconnect-query($sql);//根据语句类型判断if($type1){//如果是查询语句,返回二维数组return $result-fetch_all(); }else{//如果是其他语句返回true或falsereturn $result; }}else{return连接失败; } } } ? 2.租房子页面 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlnshttp://www.w3.org/1999/xhtml head meta http-equivContent-Type contenttext/html; charsetutf-8 / title租房子---首页/title /head bodytable width1000px cellpadding1 border1 ellspacing1 trtd关键字/td td区域/td td使用面积/td td租金/td td租贷类型/td td房屋类型/td td/td td/td /tr?phpinclude(DBDA.class.php);$dxnew DBDA();$sqlselect * from house; $r $dx-Query($sql,1); //$attr$result-fetch_all();foreach($r as $v) { echo trtd{$v[1]}/td td{$v[2]}/td td{$v[3]}/td td{$v[4]}/td td{$v[5]}/td td{$v[6]}/td tda hrefbianji.php?id{$v[0]}编辑/a/td tda hrefshanchuchuli.php?id{$v[0]} οnclick\return confirm(确定删除吗)\删除/a/td /tr; }?/table br / br / a hreftianjiashuju.phpinput typebutton value添加数据//a a hrefduotiaojianchaxun.phpinput typebutton value搜索查询 //a /title /body /html 3.删除数据处理界面   ?php $id $_GET[id]; var_dump($newsid);include(DBDA.class.php);$dxnew DBDA();$sql delete from House where id{$id}; $r $dx-Query($sql,2); if($r) {header(location:liebiaoyemian.php); } else {echo 删除失败; } 4.编辑页面 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlnshttp://www.w3.org/1999/xhtml head meta http-equivContent-Type contenttext/html; charsetutf-8 / title修改房屋数据/title /head body !--newsid--center h1修改房屋数据/h1?php$id $_GET[id];include(DBDA.class.php);$dxnew DBDA();//echo id; //var_dump($id);$sqlselect * from house where id{$id}; $r$dx-Query($sql);?form actionbianjichuli.php methodpost input typehidden nameid value?php echo $r[0][0];?/!--id传过的ID-- div关键字:input typetext nameKeyWord value?php echo $r[0][1];?//div div区域input typetext nameArea value?php echo $r[0][2];?//div div使用面积:input typetext nameSquareMeter value?php echo $r[0][3];?//div div租金:input typetext nameRent value?php echo $r[0][4];?//div div租贷类型:input typetext nameRentType value?php echo $r[0][5];?//div div房屋类型:input typetext nameHouseType value?php echo $r[0][6];?//div divinput typesubmit value更新//div /form !--a hrefchakan.phpinput typebutton value查看/a-- /center /body /html 5.编辑处理 假面 ?php//使用加载类include(DBDA.class.php);$db new DBDA();$id$_POST[id];//传ID$KeyWord $_POST[KeyWord];$Area $_POST[Area];$SquareMeter $_POST[SquareMeter];$Rent $_POST[Rent];$RentType $_POST[RentType];$HouseType $_POST[HouseType]; $sqlupdate house set KeyWord{$KeyWord},Area{$Area},SquareMeter{$SquareMeter},Rent{$Rent},RentType{$RentType},HouseType{$HouseType} where id{$id};// where id{$id}//echo $sql;$attr $db-Query($sql,2);//var_dump($attr);if($attr){header(location:liebiaoyemian.php); }else{echo 修改失败; } 6.数据添加 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlnshttp://www.w3.org/1999/xhtml head meta http-equivContent-Type contenttext/html; charsetutf-8 / title添加页面/title/head style.kong{margin:10px 0px 10px 0px;vertical-align: } /style body form actiontianjiachili.php methodposth3添加房屋信息页面/h3 div classkong关键字input typetext nameKeyWord//divdiv classkong区域input typetext nameArea//divdiv classkong使用面积input typetext nameSquareMeter//divdiv classkong租金input typetext nameRent/divdiv classkong租赁类型input typetext nameRentType//divdiv classkong房屋类型input typetext nameHouseType//div divinput typesubmit value确定/!--插入信息--a hrefliebiaoyemian.phpinput typebutton value返回主页 //a /div /form /body /html 7.数据添加的处理界面 ?php //$id $_POST[id]; $KeyWord $_POST[KeyWord]; $Area $_POST[Area]; $SquareMeter $_POST[SquareMeter]; $Rent $_POST[Rent]; $RentType $_POST[RentType]; $HouseType $_POST[HouseType];//造连接对象 include(DBDA.class.php); $dbnew DBDA();//写sql语句 $sqlinsert into house values(,{$KeyWord},{$Area},{$SquareMeter},{$Rent},{$RentType},{$HouseType}); //执行语句 $r$db-Query($sql,2);//($sql,2) 2代表增删改 错在了2上if($r) {header(location:liebiaoyemian.php); } else{echo 执行失败; }? 8.搜索界面 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlnshttp://www.w3.org/1999/xhtml head meta http-equivContent-Type contenttext/html; charsetutf-8 / title租房子----多条件查询/title /headbodybody form actionduotiaojianchaxun.php methodpost div区域input typecheckbox οnclickCheckAll(this,qy) /全选/div div?php include(DBDA.class.php); $db new DBDA();$sqlqy select distinct Area from house; $attrqy $db-Query($sqlqy); //var_dump($attrqy);foreach($attrqy as $v) {echo input classqy typecheckbox value{$v[0]} nameqy[]/{$v[0]} ; } ?/divbr /div租赁类型input typecheckbox οnclickCheckAll(this,zl) /全选/div div?php$sqlzl select distinct RentType from House; $attrzl $db-Query($sqlzl);foreach($attrzl as $v) {echo input classzl typecheckbox value{$v[0]} namezl[]/{$v[0]} ; } ?/divbr /div房屋类型input typecheckbox οnclickCheckAll(this,fw) /全选/div div?php$sqlfw select distinct HouseType from House; $attrfw $db-Query($sqlfw); //var_dump($attrqy);foreach($attrfw as $v) {echo input classfw typecheckbox value{$v[0]} namefw[]/{$v[0]} ; } ?/divbr /div关键字input typetext namekeyword idkey / /form br / input typesubmit value搜索 /br / br / br /table cellpadding1 cellspacing1 border1 width100%trtd关键字/tdtd区域/tdtd面积/tdtd租金/tdtd租赁类型/tdtd房屋类型/td/tr?php$tj ; $tj1 11; $tj2 11; $tj3 11; $tj4 11;if(!empty($_POST[qy])) {$attr $_POST[qy];$str implode(,,$attr);$tj1 Area in ({$str}); }if(!empty($_POST[zl])) {$attr $_POST[zl];$str implode(,,$attr);$tj2 RentType in ({$str}); }if(!empty($_POST[fw])) {$attr $_POST[fw];$str implode(,,$attr);$tj3 HouseType in ({$str}); }if(!empty($_POST[keyword])) {$attr $_POST[keyword];$tj3 keyword like %{$attr}%; }$tj Where {$tj1} and {$tj2} and {$tj3} and {$tj4};//Where 前加空格$sql select * from House.$tj; $attrall $db-Query($sql); //var_dump($attrall);foreach($attrall as $v) {echo trtd{$v[1]}/tdtd{$v[2]}/tdtd{$v[3]}/tdtd{$v[4]}/tdtd{$v[5]}/tdtd{$v[6]}/td/tr; }?/table /body script typetext/javascript function CheckAll(a,b)//this表示该 {var qx a.checked;var ck document.getElementsByClassName(b);for(var i 0;ick.length;i){ck[i].checked qx;} }/script/html /body /html  转载于:https://www.cnblogs.com/chenshanhe/p/6861171.html
http://www.yutouwan.com/news/258186/

相关文章:

  • 滨州 网站建设沧州凯航网络技术有限公司
  • 西安网站公司建设wordpress是cms吗
  • 备案ip 查询网站查询网站查询系统1688代运营
  • 中南建设集团招标网站省建设厅网站建筑材料备案申请
  • 企业电子商务网站有哪些网络优化的工作内容
  • 北京 网站建设600如何在阿里云自主建网站
  • 怎么用2级目录做网站wordpress role
  • 网站描述怎么设置凡科官方网
  • 怎么做网站出肉狗自己做的相册网站
  • 中山模板建站公司企业网络推广的方法有哪些
  • 网站建设调研通知短视频制作软件
  • 网站打开慢是什么原因竞价排名是什么
  • 太平洋建设集团招标网站如何做网站title小标图
  • 国内响应式网站模板WordPress文章资讯主题
  • 继续网站建设长兴县住房建设局网站
  • 哪些公司需要网站建设如何建立自已的购物网站
  • 怎么做刷业网站精准客户数据采集软件
  • 婚恋网网站架构上网建站推广
  • 如何做网站优惠券推广小型网站的建设方案
  • flash手机网站制作怎么做微帮网站
  • 广州建设品牌网站建设银行银行官网网站
  • wordpress多站点 用户同步织梦网站后台文章编辑美化代码
  • 哈尔滨网站建设哪家好郑州做茶叶的网站
  • 长沙建网站理网站标题格式
  • 淘宝客怎么建网站免费的网页域名
  • 网页制作做网站左侧导航北京撒网站设计
  • 做电影网站挣钱微博的网站连接是怎么做的
  • 做淘宝首页初学ps视频网站做网站维护承包合同
  • asp网站怎么做404页面跳转百度竞价排名多少钱
  • 国外的创意设计网站wordpress the field