[PHP] 默认界面 →→→→→进入此内容的聊天室

来自 , 2019-11-13, 写在 PHP, 查看 101 次.
URL http://www.code666.cn/view/30192e93
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>商品显示页面</title>
  6. <style type="text/css">
  7. table,th,td{
  8.         border:#000 solid 1px;
  9. }
  10. table{
  11.        
  12.         width:980px;
  13.         margin:auto;
  14.         font-size:14px;
  15. }
  16. caption{
  17.         font-size:24px;
  18.         font-weight:bold;
  19. }
  20. </style>
  21. </head>
  22. <script type="text/javascript">
  23. //提示删除确认函数
  24. function jump(id){
  25.         if(confirm('确定要删除吗?')){
  26.                 //跳转至del.php并提交要删除的产品id
  27.         location.href='del.php?id='+id;
  28.                         }
  29.                 }
  30.         </script>
  31. <body>
  32. <?php
  33. //连接数据库
  34. require "../public/dbcn.php";
  35. $dbcn->exec('set names utf8');
  36. $rs=$dbcn->query('select * from products');
  37. ?>
  38. <a href="add.php">添加商品</a>
  39. <table width="980" border="1">
  40. <tr>
  41.         <th>编号</th>
  42.     <th>商品名称</th>
  43.     <th>商品规格</th>
  44.     <th>价格</th>
  45.     <th>库存量</th>
  46.     <th>图片</th>
  47.     <th>网站</th>
  48.     <th>修改</th>
  49.     <th>删除</th>
  50. </tr>
  51. <?php
  52. //循环匹配成关联数组
  53. while($rows=$rs->fetch(PDO::FETCH_ASSOC)){//返回结果读取为关联数组
  54.         echo'<tr>';
  55.         echo'<td>'.$rows['proID'].'</td>';
  56.         echo'<td>'.$rows['proname'].'</td>';
  57.         echo'<td>'.$rows['proguide'].'</td>';
  58.         echo'<td>'.$rows['proprice'].'</td>';
  59.         echo'<td>'.$rows['proamount'].'</td>';
  60.         echo'<td>'.$rows['proimages'].'</td>';
  61.         echo'<td>'.$rows['proweb'].'</td>';
  62.         echo'<td><input type="button" value="修改" onclick="location.href
  63.               =\'modify.php ? id='.$rows['proID'].'\'"/></td>';
  64.         echo'<td><input type="button" value="删除" onclick="jump
  65.         ('.$rows['proID'].')" /></td>';
  66.         echo'</tr>';
  67. }
  68. ?>
  69. </table>
  70. </body>
  71. </html>

回复 "默认界面"

这儿你可以回复上面这条便签

captcha