erro em excluir um album em php
to criando um php e nao ta dando certo alguem ai poderia dar uma olhadinha e me ajudar...
<?php if ($_GET['IDAlb'] != "69" ) { ?>
<?php require_once('../Connections/connGalerifica.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php require_once('../ScriptLibrary/incAddOnDelete.php'); ?>
<?php
// Delete Before Record Addon 1.0.3
if ((isset($HTTP_GET_VARS['IDAlb'])) && ($HTTP_GET_VARS['IDAlb'] != "")) {
mysql_select_db($database_connGalerifica, $connGalerifica);
$dbr_result = mysql_query("SELECT Foto FROM isdez_fotos WHERE IDAlb=".$HTTP_GET_VARS['IDAlb'], $connGalerifica) or die(mysql_error());
$dbr = new deleteFileBeforeRecord();
$dbr->sqldata = mysql_fetch_array($dbr_result);
$dbr->path = "../images";
$dbr->pathThumb = "../thumbs";
$dbr->naming = "prefix";
$dbr->suffix = "";
$dbr->checkVersion("1.0.3");
$dbr->deleteFile();
}
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['IDAlb'])) && ($HTTP_GET_VARS['IDAlb'] != "")) {
$deleteSQL = sprintf("DELETE FROM isdez_albs WHERE IDAlb=%s",
GetSQLValueString($HTTP_GET_VARS['IDAlb'], "int"));
mysql_select_db($database_connGalerifica, $connGalerifica);
$Result1 = mysql_query($deleteSQL, $connGalerifica) or die(mysql_error());
$deleteGoTo = "index.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
mysql_select_db($database_connGalerifica, $connGalerifica);
$query_rsAlbID = "SELECT * FROM isdez_albs WHERE IDAlb = colname";
$rsAlbID = mysql_query($query_rsAlbID, $connGalerifica) or die(mysql_error());
$row_rsAlbID = mysql_fetch_assoc($rsAlbID);
$totalRows_rsAlbID = mysql_num_rows($rsAlbID);
?>
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="IDAlb" type="hidden" id="IDAlb" value="<?php echo $row_rsAlbID['IDAlb']; ?>" />
</form>
</body>
</html>
<?php
mysql_free_result($rsAlbID);
?>
<?php }; ?>
<?php if ($_GET['IDAlb'] != "69" ) { ?>
<?php require_once('../Connections/connGalerifica.php'); ?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "../index.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php require_once('../ScriptLibrary/incAddOnDelete.php'); ?>
<?php
// Delete Before Record Addon 1.0.3
if ((isset($HTTP_GET_VARS['IDAlb'])) && ($HTTP_GET_VARS['IDAlb'] != "")) {
mysql_select_db($database_connGalerifica, $connGalerifica);
$dbr_result = mysql_query("SELECT Foto FROM isdez_fotos WHERE IDAlb=".$HTTP_GET_VARS['IDAlb'], $connGalerifica) or die(mysql_error());
$dbr = new deleteFileBeforeRecord();
$dbr->sqldata = mysql_fetch_array($dbr_result);
$dbr->path = "../images";
$dbr->pathThumb = "../thumbs";
$dbr->naming = "prefix";
$dbr->suffix = "";
$dbr->checkVersion("1.0.3");
$dbr->deleteFile();
}
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['IDAlb'])) && ($HTTP_GET_VARS['IDAlb'] != "")) {
$deleteSQL = sprintf("DELETE FROM isdez_albs WHERE IDAlb=%s",
GetSQLValueString($HTTP_GET_VARS['IDAlb'], "int"));
mysql_select_db($database_connGalerifica, $connGalerifica);
$Result1 = mysql_query($deleteSQL, $connGalerifica) or die(mysql_error());
$deleteGoTo = "index.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
$deleteGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $deleteGoTo));
}
mysql_select_db($database_connGalerifica, $connGalerifica);
$query_rsAlbID = "SELECT * FROM isdez_albs WHERE IDAlb = colname";
$rsAlbID = mysql_query($query_rsAlbID, $connGalerifica) or die(mysql_error());
$row_rsAlbID = mysql_fetch_assoc($rsAlbID);
$totalRows_rsAlbID = mysql_num_rows($rsAlbID);
?>
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name="form1" id="form1" method="post" action="">
<input name="IDAlb" type="hidden" id="IDAlb" value="<?php echo $row_rsAlbID['IDAlb']; ?>" />
</form>
</body>
</html>
<?php
mysql_free_result($rsAlbID);
?>
<?php }; ?>
comentários (0)
suspender