【php开源代码栏目提醒】:网学会员鉴于大家对php开源代码十分关注,论文会员在此为大家搜集整理了“deletedName.php”一文,供大家参考学习
<?php
include_once('../Connections/config.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($_POST['deletionName'])) && ($_POST['deletionName'] != "")) {
$deleteSQL = sprintf("DELETE FROM guestbook WHERE `date`=%s",
GetSQLValueString($_POST['deletionName'], "text"));
mysql_select_db($database_adesGBook, $link_id);
$Result1 =
mysql_query($deleteSQL, $link_id) or die(my
sql_error());
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD
HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>删除</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../forText.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {
color: #FF3300;
font-size: 12px;
}
-->
</style>
</head>
<body>
<table width="600" border="0" cellspacing="1" cellpadding="2">
<tr>
<td height="30" class="forTableBgLeft"><div align="center">删除
</div></td>
</tr>
<tr>
<td class="forTableBgRight"><div align="center">删除时间为 [ <?php echo $_POST['deletionName']; ?> ] 的留言 </div></td>
</tr>
</table>
</body>
</html>