亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

Développement PHP d'un système de gestion backend de livres simple, modification et suppression de nouvelles gestions de livres

ContinuerIntroduire le fichier de base de données config.php

et le fichier ly_check.php pour déterminer si l'administrateur est connecté

dans la page HTML Appelez le style css.css

Supprimez le fichier de fonction et définissez-le sur le fichier del.php

<?php
include("config.php");
require_once('ly_check.php');
$SQL = "DELETE FROM yx_books where id='".$_GET['id']."'";
$arry=mysqli_query($link,$sql);
if($arry){
  echo "<script> alert('刪除成功');location='list.php';</script>";
}
else
  echo "刪除失敗";
?>

Modifiez la fonction et définissez-le sur le fichier update.php

<?php
include("config.php");
require_once('ly_check.php');
?>
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>圖書管理系統(tǒng)新書修改</title>
  <link rel="stylesheet" href="css.css" type="text/css">
  <script type="text/javascript">
    <!--
    function myform_Validator(theForm)
    {

      if (theForm.name.value == "")
      {
        alert("請輸入書名。");
        theForm.name.focus();
        return (false);
      }
      if (theForm.price.value == "")
      {
        alert("請輸入書名價格。");
        theForm.price.focus();
        return (false);
      }
      if (theForm.type.value == "")
      {
        alert("請輸入書名所屬類別。");
        theForm.type.focus();
        return (false);
      }
      return (true);
    }

    //--></script>
</head>
<?php
$sql="select * from yx_books where id='".$_GET['id']."'";
$arr=mysqli_query($link,$sql);
$rows=mysqli_fetch_row($arr);
//mysqli_fetch_row() 函數(shù)從結(jié)果集中取得一行,并作為枚舉數(shù)組返回。一條一條獲取,輸出結(jié)果為$rows[0],$rows[1],$rows[2].......
?>
<?php
if($_POST['action']=="modify"){
  $sqlstr = "update yx_books set name = '".$_POST['name']."', price = '".$_POST['price']."', uploadtime = '".$_POST['uptime']."', type = '".$_POST['type']."', total = '".$_POST['total']."' where id='".$_GET['id']."'";
  $arry=mysqli_query($link,$sqlstr);
  if ($arry){
    echo "<script> alert('修改成功');location='list.php';</script>";
  }
  else{
    echo "<script>alert('修改失敗');history.go(-1);</script>";
  }
}
?>
<body>
<form id="myform" name="myform" method="post" action="" onSubmit="return myform_Validator(this)">
  <table width="100%" height="173" border="0" align="center" cellpadding="2" cellspacing="1" class="table">
    <tr>
      <td colspan="2" align="left" class="bg_tr">&nbsp;后臺管理&nbsp;>>&nbsp;新書修改</td>
    </tr>
    <tr>
      <td width="31%" align="right" class="td_bg">書名:</td>
      <td width="69%" class="td_bg">
        <input name="name" type="text" id="name" value="<?php echo $rows[1] ?>" size="15" maxlength="30" />
      </td>
    </tr>
    <tr>
      <td align="right" class="td_bg">價格:</td>
      <td class="td_bg">
        <input name="price" type="text" id="price" value="<?php echo  $rows[2]; ?>" size="5" maxlength="15" />
      </td>
    </tr>
    <tr>
      <td align="right" class="td_bg">入庫時間:
      </td>
      <td class="td_bg">
        <label>
          <input name="uptime" type="text" id="uptime" value="<?php echo $rows[3] ; ?>" size="17" />
        </label>
      </td>
    </tr>
    <tr>
      <td align="right" class="td_bg">所屬類別:
      </td>
      <td class="td_bg"><label>
          <input name="type" type="text" id="type" value="<?php echo $rows[4]; ?>" size="6" maxlength="19" />
        </label></td>
    </tr>
    <tr>
      <td align="right" class="td_bg">入庫總量:</td>
      <td class="td_bg"><input name="total" type="text" id="total" value="<?php echo  $rows[5]; ?>" size="5" maxlength="15" />
        本</td>
    </tr>
    <tr>
      <td align="right" class="td_bg">
        <input type="hidden" name="action" value="modify">
        <input type="submit" name="button" id="button" value="提交"/></td>
      <td class="td_bg">  
        <input type="reset" name="button2" id="button2" value="重置"/></td>
    </tr>
  </table>
</form>
</body>
</html>


Formation continue
||
<?php include("config.php"); require_once('ly_check.php'); $SQL = "DELETE FROM yx_books where id='".$_GET['id']."'"; $arry=mysqli_query($link,$sql); if($arry){ echo "<script> alert('刪除成功');location='list.php';</script>"; } else echo "刪除失敗"; ?>
soumettreRéinitialiser le code