0byt3m1n1-V2
Path:
/
home
/
bangtoey
/
domains
/
bangtoey.go.th
/
public_html
/
itas
/
[
Home
]
File: delete_comment.php
<?php session_start(); if($_SESSION[user]==""){ session_destroy(); $message = "¡ÃØ³Ò Login ¡è͹."; $url = "../admin/index.php"; include("../admin/alert.php"); exit; } require_once('../admin/Connections/conndb.php'); mysql_select_db($database_conndb, $conndb); $query_rsNews = "SELECT * FROM ita_comment where comment_id= '$comment_id'"; $rsNews = mysql_query($query_rsNews, $conndb) or die(mysql_error()); $row_rsNews = mysql_fetch_assoc($rsNews); $totalRows_rsNews = mysql_num_rows($rsNews); ?> <?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['comment_id'])) && ($_GET['comment_id'] != "")) { $deleteSQL = sprintf("DELETE FROM ita_comment WHERE comment_id=%s", GetSQLValueString($_GET['comment_id'], "int")); mysql_select_db($database_conndb, $conndb); $Result1 = mysql_query($deleteSQL, $conndb) or die(mysql_error()); // $deleteGoTo = "admin.php"; if (isset($_SERVER['QUERY_STRING'])) { $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?"; $deleteGoTo .= $_SERVER['QUERY_STRING']; } // header(sprintf("Location: %s", $deleteGoTo)); echo "<meta http-equiv='refresh' content='0;URL=detail.php?id=$id'>"; } if($conndb) { mysql_close($conndb); unset($conndb); } ?>
©
2018.