Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php require_once('Connections/connection.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['idpeserta'])) && ($_GET['idpeserta'] != "")) {
- $deleteSQL = sprintf("DELETE FROM daftar_acara WHERE idpeserta=%s",
- GetSQLValueString($_GET['idpeserta'], "text"));
- mysql_select_db($database_connection, $connection);
- $Result1 = mysql_query($deleteSQL, $connection) or die(mysql_error());
- $deleteGoTo = "papargame.php";
- if (isset($_SERVER['QUERY_STRING'])) {
- $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
- $deleteGoTo .= $_SERVER['QUERY_STRING'];
- }
- header(sprintf("Location: %s", $deleteGoTo));
- }
- $colname_q_hapusgame = "-1";
- if (isset($_GET['idpeserta'])) {
- $colname_q_hapusgame = (get_magic_quotes_gpc()) ? $_GET['idpeserta'] : addslashes($_GET['idpeserta']);
- }
- mysql_select_db($database_connection, $connection);
- $query_q_hapusgame = sprintf("SELECT * FROM daftar_acara WHERE idpeserta = '%s'", $colname_q_hapusgame);
- $q_hapusgame = mysql_query($query_q_hapusgame, $connection) or die(mysql_error());
- $row_q_hapusgame = mysql_fetch_assoc($q_hapusgame);
- $totalRows_q_hapusgame = mysql_num_rows($q_hapusgame);
- ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
- <title>Untitled Document</title>
- </head>
- <body>
- </body>
- </html>
- <?php
- mysql_free_result($q_hapusgame);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement