Hello PHP Buddies,
I used this simple php codes to have a section on my page to delete records.
[php]
<a href=’?cmd=delete&ID={$rows[‘ID’]}’>Delete
[/php]
working fine.
I want to add an action so that i when i click delete i have to confirm first.
Right now when i click it deletes the record right away. I dont want that i might misclick and lose data acidentically.
[php]
if ((isset($_GET[‘cmd’])) && (isset($_GET[‘ID’])))
{
include(’…/…/connect_db.php’);
//$header = $_SESSION[md5(“search”)];
if ($_GET['cmd'] == "delete")
{
mysql_query("DELETE FROM `programming_language_snippet_codes_vaults` WHERE `ID` ='".intval($_GET['ID'])."'") or die("Failed to delete Record with ID: ".$_GET['ID']."<br/>".mysql_error());
//header("location: $header") or die("Failed to delete Record with ID:");
}
}
[/php]
So I know this done with javascript but my javascript knowledge stinks