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>