Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
script_deletar_informativo.php
Está gerando "Erro 500" ! Pra mim, o código está correto ! Por favor me ajudem a identificar o problema !
Eis o código:
<?php
session_start();
if(isset($_SESSION['usuario']) and isset($_SESSION['senha'])){
} else{ include("Erro_Nao_Logado.php"); exit; }
?>
<?php
//---------------------------------------------------------
include "conecta_mysql_douglas_simiao.php";
$ID = $_GET['ID'];
$resultado = mysql_query("SELECT * FROM lista_informativos");
$num_rows = mysql_num_rows($resultado);
$resultado = mysql_query("SELECT `DIV VALIDO`,`DIV INVALIDO` FROM lista_informativos WHERE ID='$ID'");
$Div_valido = mysql_result($resultado,0,"DIV VALIDO");
$Div_invalido = mysql_result($resultado,0,"DIV INVALIDO");
mysql_query("DELETE FROM lista_informativos WHERE ID='$ID'");
//---------------------------------------------------------
mysql_query("DELETE FROM script_informativos WHERE ID='$ID'") or die(mysql_error());
//---------------------------------------------------------
$ID2 = $ID + 1;
mysql_query("UPDATE lista_informativos SET `DIV VALIDO`='$Div_valido',`DIV INVALIDO`='$Div_invalido' WHERE ID='$ID2'") or die(mysql_error());
$ID3 = $ID2 + 1;
$a = 1;
$num_rows = $num_rows - $ID3;
for($i=0;$i<=$num_rows;$i++){
mysql_query("UPDATE lista_informativos SET `DIV VALIDO`='$Div_invalido',`DIV INVALIDO`='$Div_valido' WHERE ID='$ID3'");
$ID3 = $ID3 + 1;
$resultado = mysql_query("UPDATE lista_informativos SET `DIV VALIDO`='$Div_valido',`DIV INVALIDO`='$Div_invalido' WHERE ID='$ID3'");
$ID3 = $ID3 + 1;
}
?>
<?php
$resultado_ordem = mysql_query("SELECT * FROM lista_informativos");
$num_rows = mysql_num_rows($resultado_ordem);
$a = 1;
for($i=0;$i<=$num_rows;$i++) {
@$ID0 = mysql_result($resultado_ordem,$i,'ID');
@$TITULO = mysql_result($resultado_ordem,$i,'TITULO');
@$DATA = mysql_result($resultado_ordem,$i,'DATA');
@$DIV_VALIDO = mysql_result($resultado_ordem,$i,'DIV VALIDO');
@$DIV_INVALIDO = mysql_result($resultado_ordem,$i,'DIV INVALIDO');
mysql_query("UPDATE lista_informativos SET ID='$a' WHERE ID='$ID0'") or die(mysql_error());
$a++;
}
?>
<?php
$resultado_ordem = mysql_query("SELECT * FROM script_informativos");
$num_rows = mysql_num_rows($resultado_ordem);
$a = 1;
for($i=0;$i<=$num_rows;$i++) {
@$ID0 = mysql_result($resultado_ordem,$i,'ID');
@$TITULO = mysql_result($resultado_ordem,$i,'TITULO');
@$DATA = mysql_result($resultado_ordem,$i,'DATA');
@$DIV_VALIDO = mysql_result($resultado_ordem,$i,'DIV VALIDO');
@$DIV_INVALIDO = mysql_result($resultado_ordem,$i,'DIV INVALIDO');
mysql_query("UPDATE script_informativos SET ID='$a' WHERE ID='$ID0'") or die(mysql_error());
$a++;
}
?>
<?php
//---------------------------------------------------------
$sql_MAX_ID = mysql_query("SELECT MAX(ID) AS MAX_ID FROM lista_informativos;");
$MAX_ID = mysql_result($sql_MAX_ID,0,'MAX_ID');
$a = 1;
for($i=0;$i<=$MAX_ID;$i++){
$sql = mysql_query("SELECT * FROM script_informativos WHERE ID='$a'");
$Tipo = mysql_result($sql,0,'TIPO');
$Titulo = mysql_result($sql,0,'TITULO');
$Autor = mysql_result($sql,0,'AUTOR');
$Data_escrita = mysql_result($sql,0,'DATA ESCRITA');
$Resumo = mysql_result($sql,0,'RESUMO');
$Conteudo = mysql_result($sql,0,'CONTEUDO');
$Caminho_imagem0 = mysql_result($sql,0,'CAMINHO IMAGEM');
if(file_exists("Informativo_$a.php")){
unlink("Informativo_$a.php");
$Tipo_escrita = "Informativo - $a";
$handle_comeco = file_get_contents("script0_Comeco.php");
$handle2 = fopen("Informativo_$a.php","w+");
fwrite($handle2,$handle_comeco);
$handle3 = fopen("Informativo_$a.php","r+");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Tipo_escrita);
$handle_comeco2 = file_get_contents("script0_Comeco2.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_comeco2);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Titulo);
$handle_autor = file_get_contents("script0_Autor.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_autor);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Autor);
$handle_data = file_get_contents("script0_Data.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_data);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Data_escrita);
if(empty($Resumo2) and empty($Conteudo2)){
goto a;
}
if(empty($Resumo2)){
$handle_resumo = file_get_contents("script0_Resumo_empty.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_resumo);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Resumo2);
$handle_conteudo = file_get_contents("script0_Conteudo.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_conteudo);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Conteudo2);
goto a;
}
if(empty($Conteudo2)){
$handle_resumo = file_get_contents("script0_Resumo.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_resumo);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Resumo2);
$handle_conteudo = file_get_contents("script0_Conteudo_empty.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_conteudo);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Conteudo2);
goto a;
}
$handle_resumo = file_get_contents("script0_Resumo.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_resumo);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Resumo2);
$handle_conteudo = file_get_contents("script0_Conteudo.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_conteudo);
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$Conteudo2);
a:
$handle_imagem = file_get_contents("script0_Caminho_imagem.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_imagem);
fseek($handle3, 0, SEEK_END);
$Caminho_imagem = "<img src='$Caminho_imagem0'>";
fwrite($handle3,$Caminho_imagem);
$handle_listagem = file_get_contents("script0_Listagem.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_listagem);
$handle_final0 = file_get_contents("script0_Final0.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_final0);
$handle_final1 = file_get_contents("script0_Final1.php");
fseek($handle3, 0, SEEK_END);
fwrite($handle3,$handle_final1);
$a++;
}
//---------------------------------------------------------
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>:: Envio de Textos - Painel de Controle - MODIFICAR ARTIGOS - ARTIGO DELETADO ::</title>
</head>
<body background="Imagens/balanca_fundo.jpg" onload="noBack();" onpageshow="if (event.persisted) noBack();" onunload="" vlink="#0000FF">
<br>
<br>
<br>
<br>
<br>
<div align="center">
<table border="0" width="576" cellspacing="0" cellpadding="0" background="Imagens/script_deletar_artigo_form_fundo.jpg" height="256">
<tr>
<td>
<br>
<table border="0" width="560" cellspacing="0" cellpadding="0">
<tr>
<td width="27"> </td>
<td width="76">
<img border="0" src="Imagens/script_deletar_x.jpg" width="35" height="36"></td>
<td><b><font face="Arial" size="5">Informativo deletado com sucesso !</font></b></td>
</tr>
</table>
<p><b><font face="Arial" size="4">
<br>
•
<a href="script_Painel_MODIFICAR_INFORMATIVOS.php">Voltar à página
MODIFICAR INFORMATIVOS</a><br>
<font face="Arial"><br></font> •
<a href="Painel_de_controle.php">Voltar ao Painel de
Controle</a></font></b><br>
<br>
<b><font face="Arial" size="4"> •
<a href="desconectar.php"><font color="#FF0000">Desconectar</font></a></font></b></td>
</tr>
</table>
</div>
<p> </p>
</body>
</html>
Vá debugando o código daí você encontrará o erro