0

Hi I really really really need your help since I have no idea about this.

How can I insert the Javascript Confirmation Alert into the del.php file?


I have this del.php file

<?php
require ("include/config.php");
$id=$_REQUEST['id'];

$strSQL = "DELETE FROM change WHERE id = '".$id."' ";  
 $objQuery = odbc_exec($conn,$strSQL);  
 if($objQuery)  
 {  
 
 echo "<script language='Javascript'>alert('Deleted.'); 
	 window.location=\""."index.php?action=syif\"</script>";

 }  
 else  
 {  
 echo "Error Delete [".$strSQL."]";  
 }  
 odbc_close($conn);  


?>

This is the confirmation javascript

<html>
<head>
<script type="text/javascript">
function show_confirm()
{
var r=confirm("Delete?");
if (r==true)
  {
  alert("Deleted!");
  }
else
  {
  alert("Cancelled!");
  }
}
</script>
</head>
<body>

<input type="button" onclick="show_confirm()" value="Show confirm box" />

</body>
</html>
3
Contributors
3
Replies
7
Views
5 Years
Discussion Span
Last Post by pritaeas
0

Normally, we will run the confirmation script to delete data before we proceed into the delete.php

0

Normally, we will run the confirmation script to delete data before we proceed into the delete.php

I see. But is it possible to add the javascript confirmation into the del.php file?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.