links.php 571 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. // 获取传递的ID
  3. $id = $_GET['goodsid'];
  4. include_once("../untils/conn.php");// 引入数据库连接配置文件
  5. $sql = "SELECT * FROM list WHERE id =" . $id;
  6. $result = mysqli_query($con, $sql);
  7. if ($result) {
  8. $row = mysqli_fetch_assoc($result);
  9. $downtel = $row['downtel'];
  10. switch ($downtel) {
  11. case 'one':
  12. include 'one.php';
  13. break;
  14. case 'two':
  15. include 'two.php';
  16. break;
  17. default:
  18. include 'one.php';
  19. break;
  20. }
  21. } else {
  22. // 处理查询失败的情况
  23. }
  24. // 关闭数据库连接
  25. mysqli_close($con);
  26. ?>