Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Hoje o site que estou desenvolvendo foi bloqueado e o provedor me mandou um e-mail dizendo que foi devido a sobrecarga no servidor web.
O site ainda não está aberto para o público então não sei o que causou essa sobrecarga...
alguém já passou pelo mesmo problema e pode me dizer o que pode causar essa sobrecarga? pois não faço a mínima idéia
abaixo segue o codigo da pagina que mais apareceu no log que me mandaram, pode ser que o problema seja nela:
<?php
foreach($_POST AS $key => $value) { ${$key} = $value; }
foreach($_GET AS $key => $value) { ${$key} = $value; }
include_once("classes/db.class.php");
include_once("classes/login.class.php");
$login = new Usuario();
$login->Verifica();
$sql = new ConectaBD();
$sql->conecta();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>.:: Módulo de Controle ::.</title>
<style type="text/css"> a {text-decoration:none;} </style>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.maskMoney.0.2.js"></script>
<script type="text/javascript">
function apagar(id){
if(confirm("Deseja excluir esse registro? Ao excluí-lo todos os planos relacionados também serão excluídos!")){
window.location.href="adicionar-plano.php?xacao=apagar&id="+id;
}
}
$(document).ready(function(){
$("#btnCad").click(function(){
var preco = $("#preco").val();
if(preco == ""){
alert("Digite o Preço!");
$("#preco").focus();
return false;
}
var qtd_dias = $("#qtd_dias").val();
if(qtd_dias == ""){
alert("Digite a quantidade de Dias!");
$("#qtd_dias").focus();
return false;
}
var dias_gratis = $("#dias_gratis").val();
if(dias_gratis == ""){
alert("Digite a quantidade de Dias grátis!");
$("#dias_gratis").focus();
return false;
}
var qtd_anun = $("#qtd_anun").val();
if(qtd_anun == ""){
alert("Digite a quantidade de Anúncios!");
$("#qtd_anun").focus();
return false;
}
});
});
</script>
<script type="text/javascript">
$(function(){
$("#dolar").maskMoney()
$("#preco").maskMoney({symbol:"R$",decimal:".",thousands:""})
$("#precision").maskMoney({decimal:",",thousands:" ",precision:3})
})
function removeMask(){
$("#dolar").unmaskMoney();
}
</script>
</head>
<body bgcolor="#FFFFFF" link="#000000" vlink="#000000" alink="#000000" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0" marginwidth="0">
<div align="center">
<table width="1000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><?php include ("topo.php"); ?></td>
</tr>
</table>
<table width="1000" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="153" height="450" align="left" valign="top">
<?php
include ("menu.php");
?>
</td>
<td width="850" align="center" valign="top" class="textonormal"><strong>Cadastro Opções do Plano de anúncio</strong>
<br>
<br>
<?php
if($xacao != "alterar"){
$sql->query("SELECT * FROM planos_anuncio WHERE id_planoanuncio = '".$id."'");
$row = $sql->resultado();
echo $row['nome'];
?>
<table width="324" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" style="border-collapse:collapse">
<tr>
<td width="293" bgcolor="#F9F9F9">
<form action="adicionar-plano.php?xacao=cadastrar" method="post">
<br>
<table width="270" border="0" align="center" cellpadding="1" cellspacing="1" class="textonormalpq">
<tr>
<td width="76"><strong>Preço:</strong></td>
<td width="187"><input name="preco" type="text" class="textonormalpq" id="preco" size="10"></td>
</tr>
<tr>
<td><strong>Qtd. dias:</strong></td>
<td><input name="qtd_dias" type="text" class="textonormalpq" id="qtd_dias" size="10"></td>
</tr>
<tr>
<td><strong>Dias grátis:</strong></td>
<td><input name="dias_gratis" type="text" class="textonormalpq" id="dias_gratis" size="10"></td>
</tr>
<tr>
<td><strong>Qtd. anúncio:</strong></td>
<td><input name="qtd_anun" type="text" class="textonormalpq" id="qtd_anun" size="10"></td>
</tr>
<tr>
<td><strong>Descrição:</strong></td>
<td><label>
<input name="descricao" type="text" id="descricao" size="30">
</label></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="btnCad" value="Cadastrar" style="border:1px solid #CCCCCC;background:#F2F2F2">
<input type="hidden" name="idplano" value="<?php echo $id ?>"></td>
</tr>
</table>
</form>
<br>
</td>
</tr>
</table>
<br>
<img src="imagens/previous.png" width="10" height="10" border="0"> <a href="cadastro-planos.php"><strong>Voltar</strong></a>
<?php
}
elseif($xacao == "alterar"){
?>
<table width="324" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" style="border-collapse:collapse">
<tr>
<td width="293" bgcolor="#F9F9F9">
<form action="adicionar-plano.php?xacao=altera-plano" method="post">
<br>
<?php
$sql->query("SELECT * FROM opcoes_plano WHERE idopcoes_plano = '".$id."'");
$resp = $sql->resultado();
?>
<table width="270" border="0" align="center" cellpadding="1" cellspacing="1" class="textonormalpq">
<tr>
<td width="76"><strong>Preço:</strong></td>
<td width="187"><input name="preco" type="text" class="textonormalpq" id="preco" value="<?php echo $resp['preco'] ?>" size="10"></td>
</tr>
<tr>
<td><strong>Qtd. dias:</strong></td>
<td><input name="qtd_dias" type="text" class="textonormalpq" id="qtd_dias" value="<?php echo $resp['qtd_dias'] ?>" size="10"> </td>
</tr>
<tr>
<td><strong>Dias grátis:</strong></td>
<td><input name="dias_gratis" type="text" class="textonormalpq" id="dias_gratis" value="<?php echo $resp['dias_gratis'] ?>" size="10"></td>
</tr>
<tr>
<td><strong>Qtd. anúncio:</strong></td>
<td><input name="qtd_anun" type="text" class="textonormalpq" id="qtd_anun" value="<?php echo $resp['qtd_anuncio'] ?>" size="10"></td>
</tr>
<tr>
<td><strong>Descrição:</strong></td>
<td><input name="descricao" type="text" id="descricao" size="30" value="<?php echo $resp['descricao'] ?>"></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="button" id="btnCad" value="Alterar" style="border:1px solid #CCCCCC;background:#F2F2F2">
<input type="hidden" name="idopcao" value="<?php echo $id ?>"></td>
</tr>
</table>
</form>
<br>
</td>
</tr>
</table>
<br>
<img src="imagens/previous.png" width="10" height="10" border="0"><a href="adicionar-plano.php?id=<?php echo $resp['id_planoanuncio'] ?>"><strong> Voltar</strong></a>
<?php
}
?>
<br>
<br>
<?php if($xacao != "alterar"){ ?>
<table width="500" border="1" cellpadding="2" cellspacing="0" bordercolor="#CCCCCC" class="textonormalpq" style="border-collapse:collapse">
<?php
$sql->query("SELECT * FROM opcoes_plano WHERE id_planoanuncio = '".$id."' ORDER BY idopcoes_plano ");
if($sql->numrows()==0){
}else{
?>
<thead>
<tr>
<td width="75" bgcolor="#444444"><div align="center" class="txt">
<div align="left"></div>
</div></td>
<td width="91" bgcolor="#444444"><div align="center" class="txt"><strong>Valor</strong></div></td>
<td width="66" bgcolor="#444444"><div align="center" class="txt"><strong>Dias</strong></div></td>
<td width="63" bgcolor="#444444"><div align="center" class="txt"><strong>Dias Grátis</strong></div></td>
<td width="83" bgcolor="#444444"><div align="center" class="txt"><strong>Qtd. Anúncios</strong></div></td>
<td width="39" bgcolor="#444444"><div align="center" class="txt"><strong>Alterar</strong></div></td>
<td width="39" bgcolor="#444444"><div align="center" class="txt"><strong>Excluir</strong></div></td>
</tr>
</thead>
<tbody>
<?php
$i = 1;
while($row = $sql->resultado()){
?>
<tr>
<td bgcolor="<?php $sql->zebraLinha($i, "#EEEEEE")?>" align="center"><strong><?php echo "Opção ". $i ?></strong></td>
<td bgcolor="<?php $sql->zebraLinha($i, "#EEEEEE")?>" align="center"><?php echo "R$ ".number_format($row['preco'],2,',','.') ?></td>
<td bgcolor="<?php $sql->zebraLinha($i, "#EEEEEE")?>" align="center"><?php if($row['ilimitado'] == "S"){echo "ilimitado";}else{echo $row['qtd_dias'];} ?></td>
<td bgcolor="<?php $sql->zebraLinha($i, "#EEEEEE")?>" align="center"><?php echo $row['dias_gratis'] ?></td>
<td bgcolor="<?php $sql->zebraLinha($i, "#EEEEEE")?>" align="center"><?php if($row['qtd_anuncio'] == "1000"){echo "ilimitado";}else{ echo $row['qtd_anuncio'];} ?></td>
<td bgcolor="<?php $sql->zebraLinha($i, "#EEEEEE")?>" align="center"><div align="center"><a href="adicionar-plano.php?xacao=alterar&id=<?php echo $row['idopcoes_plano']?>"><img src="imagens/alterar.gif" width="16" height="16" border="0"></a></div></td>
<td bgcolor="<?php $sql->zebraLinha($i, "#EEEEEE")?>"><div align="center"><a onClick="apagar(<?php echo $row['idopcoes_plano']?>)" style="cursor:pointer"><img src="imagens/logo_excluir.gif" width="16" height="16" border="0"></a></div></td>
</tr>
<?php
$i++;
}
}
$sql->fechar();
?>
</table>
<?php
}
?>
</td>
</tr>
</table>
<?php include ("rodape.php"); ?>
</div>
</body>
</html>
<?php
if($xacao == "cadastrar"){
$sql = new ConectaBD();
$sql->conecta();
$insere = $sql->query("INSERT INTO opcoes_plano(id_planoanuncio,preco,qtd_dias,dias_gratis,qtd_anuncio,ilimitado)
VALUES('".$idplano."','".$preco."','".$qtd_dias."','".$dias_gratis."','".$qtd_anun."','".$ilimitado."')");
if($insere){
echo '<script>history.back()</script>';
}
$sql->fechar();
}
if($xacao == "apagar"){
$sql = new ConectaBD();
$sql->conecta();
$deleta = $sql->query("DELETE FROM opcoes_plano WHERE idopcoes_plano = '".$id."'");
if($deleta){
echo '<script>history.back()</script>';
}
$sql->fechar();
}
if($xacao == "altera-plano"){
$sql = new ConectaBD();
$sql->conecta();
$update = $sql->query("UPDATE opcoes_plano SET
preco = '".$preco."',
qtd_dias = '".$qtd_dias."',
dias_gratis = '".$dias_gratis."',
qtd_anuncio = '".$qtd_anun."',
ilimitado = '".$ilimitado."'
WHERE idopcoes_plano = '".$idopcao."'");
if($update){
echo '<script>history.back()</script>';
}
$sql->fechar();
}
?>
classe de conexão
<?php
class ConectaBD {
var $host = "xxx";
var $usuario = "xxx";
var $senha = "xxx";
var $banco = "xx";
var $conexao;
var $sql; function conecta(){
try {
$this->conexao = @mysql_connect($this->host, $this->usuario, $this->senha);
}
catch(Exception $e){
return $e->getMessage();
}
try{
$db = @mysql_select_db($this->banco);
}
catch(Exception $e){
return $e->getMessage();
}
}
function fechar(){
if($this->conexao){
@mysql_close($this->conexao);
}
} function query($sql){
$this->sql = mysql_query($sql)or die(mysql_error());
return $this->sql;
}
function resultado(){
return mysql_fetch_array($this->sql);
}
function numrows(){
return mysql_num_rows($this->sql);
}
function ultimoID(){
$this->sql = mysql_query("SELECT LAST_INSERT_ID() as id");
return $this->sql;
}
}
?>Carregando comentários...