This is my script to delete a record from a table, how do i do a quick confirmation screen wheter or not they want to continue?
<?php require_once('Connections/RecordStorePHP.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
if ((isset($HTTP_GET_VARS['typeID'])) && ($HTTP_GET_VARS['typeID'] != "")) {
$deleteSQL = sprintf("DELETE FROM item_types WHERE typeID=%s",
GetSQLValueString($HTTP_GET_VARS['typeID'], "int"));
mysql_select_db($database_RecordStorePHP, $RecordStorePHP);
$Result1 = mysql_query($deleteSQL, $RecordStorePHP) or die(mysql_error());
$deleteGoTo = "catalog_types.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
?>