Instance five rent House

Source: Internet
Author: User

Front desk

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Manage pages

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Delete Processing

<?php$id=$_get["id"]; $db =new mysqli ("localhost", "root", "", "1");! Mysqli_connect_error () or Die ("Connection Error"), $sql = "Delete from house where id= ' {$id} '"; $result = $db->query ($sql); if ($ Result) {header ("location:houtaixianshi.php");} Else{echo "Connection Failed";}

Add a page

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Add Management

<?php$keyword=$_post["keyword"]; $area =$_post["area"; $squaremeter =$_post["Squaremeter"]; $rent =$_post["Rent" ]; $renttype =$_post["Renttype"]; $housetype =$_post["Housetype"];//Build connection $db=new mysqli ("localhost", "root", "", "1") ;//test Connection!mysqli_connect_error () or Die ("Connection Error"),//sql statement $sql= "INSERT INTO house (Keyword,area,squaremeter,rent, Renttype,housetype) VALUES (' {$keyword} ', ' {$area} ', ' {$squaremeter} ', ' {$rent} ', ' {$renttype} ', ' {$housetype} ');// Run sql$result= $db->query ($sql);//Monitor If insert is successful if ($result) {header ("location:houtaixianshi.php");} Else{echo "Insert Failed";}

Modify Page

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">

Modify Processing

<?php$id=$_post["id"]; $keyword =$_post["keyword"; $area =$_post["area"]; $squaremeter =$_post["Squaremeter"];$ rent=$_post["Rent"]; $renttype =$_post["Renttype"]; $housetype =$_post["Housetype"; $db =new mysqli ("localhost", " Root "," "," 1 ");! Mysqli_connect_error () or Die ("Connection error"); $sql = "Update house set keyword= ' {$keyword} ', Area= ' {$area} ', squaremeter= ' {$ Squaremeter} ', rent= ' {$rent} ', renttype= ' {$renttype} ', housetype= ' {$housetype} ' where id= ' {$id} '; $result = $db Query ($sql), if ($result) {header ("location:houtaixianshi.php");} else{  echo "modification failed";}

Instance five rent House

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.