clint从数据库中删除文件 功能指定(sat、sat1) { 如果(确认(“您确定要完全删除所选人员详细信息吗?”) { document.form1.action=“student.php?cedit=“+sat+”&did=“+sat1// document.form1.submit();//调用表单的替代方法 } }

clint从数据库中删除文件 功能指定(sat、sat1) { 如果(确认(“您确定要完全删除所选人员详细信息吗?”) { document.form1.action=“student.php?cedit=“+sat+”&did=“+sat1// document.form1.submit();//调用表单的替代方法 } },php,Php,要通过clint删除数据库中的内容,我已经成功地完成了这项工作,但我并不完全了解语句1document.form1.action=“student.php?cedit=“+st+”&did=“+st1 和声明2 document.form1.submit() 有人能解释一下吗? 你能推荐一本好的参考书来澄清这些疑问吗 function appoint_del(sat,sat1) { if(confirm("Are You Sure To delete Selected Person Deta

要通过clint删除数据库中的内容,我已经成功地完成了这项工作,但我并不完全了解语句1
document.form1.action=“student.php?cedit=“+st+”&did=“+st1
和声明2
document.form1.submit()

有人能解释一下吗? 你能推荐一本好的参考书来澄清这些疑问吗

function appoint_del(sat,sat1)
{
  if(confirm("Are You Sure To delete Selected Person Details Completely?"))
  {     
     document.form1.action="student.php?cedit="+sat+"&did="+sat1;//
     document.form1.submit();//an alternative to call form
  }
}

<?
   if($_GET['did']!="")
   {
     $del=executeupdate("delete from table2 where id=".$_GET[did]);     
     redirect("student.php?succ=3");
   }
?>
这行JavaScript将html表单的操作设置为student.php页面,并将两个参数“cedit”和“did”与其值一起追加。我想你的页面上某处有一张表格

document.form1.action="student.php?cedit="+sat+"&did="+sat1;
提交该表格。我不知道去哪里或者用什么方法(POST,GET),因为你没有在表单上提供任何细节。我假设它提交回同一页,因为下一行是处理程序:

document.form1.submit();
这通过检查“did”参数是否存在来检测表单是否已提交

if($_GET['did']!="")
这似乎执行了一个带有大量SQL注入漏洞的数据库查询。非常危险

$del=executeupdate("delete from table2 where id=".$_GET[did]); 
再次重定向回同一页,这次传入一个不同的“succ”参数,我认为该参数是通过您未提供的其他代码处理的

redirect("student.php?succ=3");