PHP Login Page:
Where dengluchuli.php is under the prescribed path.
Login Jump page:
<?php $yonghuming = $_post["UID"]; $mima = $_post["pwd"]; $db = new mysqli ("localhost", "root", "" "," 12345 "), $sql =" Select password from login where username= ' { $yonghuming} ' "; $result = $db->query ($sql); $atter = $result->fetch_row (); if ($atter [0]== $mima &&!empty ($mima)) {header ("location:xinxi.php");} Else{echo "User name or password error";}? >
This page is used for login interface after successful login to find the corresponding data by user name.
Login Main interface:
<?php$de = new Mysqli ("localhost", "root", "" "," 12345 "), $e =" SELECT * from info "; $result = $de->query ($e); $atter = $ Result->fetch_all (); echo "<table border=1>"; echo "<tr><td> Code </td><td> name </td ><td> Gender </td><td> Ethnicity </td><td> date of birth </td><td> action </td> </tr > "; for ($i =0; $i <count ($atter); $i + +) {echo" <tr> "; for ($j =0; $j <count ($atter [$i]); $j + +) {if ($j ==4) { echo "<td>". $atter [$i] [$j]. " </td> <td><a href= ' shanchu.php?code={$atter [$i][1]} ' onclick=\ ' return confirm (' OK delete? ') \ "> Delete </a></td>";} Else{echo "<td>". $atter [$i] [$j]. " </td> ";}} echo "</tr>";} echo "</table>", echo "<a href= ' tianjia.php ' > Add Data </a>"?>
Add Data (tianji.php):
zeng.php:
<?php$code = $_post["Daihao"]; $name = $_post["xinming"]; $sex = $_post["Xinbie"]; $nation = $_post["Minzu"]; $birthday = $_post["Shengri"]; $db = new mysqli ("localhost", "root", "" "," 12345 "), $sql =" INSERT into info values (' {$code} ', ' {$name} ') , ' {$sex} ', ' {$nation} ', ' {$birthday} ') ", $r = $db->query ($sql), if ($r) {header (" location:xinxi.php ");} Else{echo "Add failed";}? >
Add success:
shanchu.php
<?php $name = $_get["code"]; $db = new mysqli ("localhost", "root", "" "," 12345 "), $sql =" Delete from info where name= ' { $name} ' "; $result = $db->query ($sql); if ($result) {header (" location:xinxi.php ");} Else{echo "Delete failed";}? >
PHP background and delete changes to jump