为了账号安全,请及时绑定邮箱和手机立即绑定

弹出确认删除php

弹出确认删除php

PHP
天涯尽头无女友 2021-06-18 18:02:17
所以我的代码在下面,它从 dmgeqdelete.php 读取,它将立即从数据库中删除数据。 <td align="center"><a href="dmgeqdelete.php?damagedID=<?php echo $row["damagedID"]; ?>" >Delete</a></td>我试图为上面的代码添加一个弹出确认。我试过<td align="center"><a href="dmgeqdelete.php?damagedID=<?php echo $row["damagedID"]; ?>" onclick="return confirm('Are you sure?')">Delete</a></td>最终没有任何动作发生dmgeqdelete.php<?phpinclude('dbConfig.php');$damagedID=$_REQUEST['damagedID'];$query = "DELETE FROM damagedeq WHERE damagedID=$damagedID"; $result = mysqli_query($conn,$query) or die ( mysqli_error());header("Location: dmgeqview.php"); ?>所以我的代码在下面,它从 dmgeqdelete.php 读取,它将立即从数据库中删除数据。 <td align="center"><a href="dmgeqdelete.php?damagedID=<?php echo $row["damagedID"]; ?>" >Delete</a></td>我试图为上面的代码添加一个弹出确认。我试过<td align="center"><a href="dmgeqdelete.php?damagedID=<?php echo $row["damagedID"]; ?>" onclick="return confirm('Are you sure?')">Delete</a></td>最终没有任何动作发生dmgeqdelete.php<?phpinclude('dbConfig.php');$damagedID=$_REQUEST['damagedID'];$query = "DELETE FROM damagedeq WHERE damagedID=$damagedID"; $result = mysqli_query($conn,$query) or die ( mysqli_error());header("Location: dmgeqview.php"); ?>展开片段完整代码<?phpinclude('dbConfig.php');?><!DOCTYPE html><html><head>  <meta charset="utf-8">  <title>View Damaged Equipment Records</title>  <link rel="stylesheet" href="css/style.css" /></head><body>  <div class="form">    <p><a href="report.php">Home</a> | <a href="index.php">Logout</a></p>    <h2>View Records</h2>    <table width="100%" border="1" style="border-collapse:collapse;">      <thead>        <tr>          <th><strong>No</strong></th>          <th><strong>Damage ID's</strong></th>          <th><strong>EQ ID's</strong></th>          <th><strong>Student ID's</strong></th>          <th><strong>Staff ID's</strong></th>          <th><strong>Date reported</strong></th>    /tr>          <?php $count++; } ?>      </tbody>    </table>  </div></body></html>
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 166 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号