although my confirm deleted page is jumping straight to the
confirm deleted page, without me having to press the button to
confirm. that page looks like :
<?php require_once('Connections/ConnDatabaseTest.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($_GET['Contact'])) && ($_GET['Contact'] !=
"")) {
$deleteSQL = sprintf("DELETE FROM Contacts WHERE
ContactID=%s",
GetSQLValueString($_GET['Contact'], "int"));
mysql_select_db($database_ConnDatabaseTest,
$ConnDatabaseTest);
$Result1 = mysql_query($deleteSQL, $ConnDatabaseTest) or
die(mysql_error());
$deleteGoTo = "contactdeleted.php";
if (isset($_SERVER['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
$colname_Recordset1 = "1";
if (isset($_GET['Contact'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ?
$_GET['Contact'] : addslashes($_GET['Contact']);
}
mysql_select_db($database_ConnDatabaseTest,
$ConnDatabaseTest);
$query_Recordset1 = sprintf("SELECT * FROM Contacts WHERE
ContactID = %s", $colname_Recordset1);
$Recordset1 = mysql_query($query_Recordset1,
$ConnDatabaseTest) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="" method="get">
<input name="hiddenField" type="hidden" value="<?php
echo $row_Recordset1['ContactID']; ?>">
<?php echo $row_Recordset1['ContactID']; ?>
<?php echo $row_Recordset1['Contact']; ?>
<input type="submit" name="Submit" value="Confirm
delete">
</form>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>