Código PHP:
Advertencia: mysql_close (): ningún recurso MySQL-Link suministrado en /home/u928112783/public_html/panel/identificarse/index.php on line 128
Código PHP:
<?php
session_start();
if (isset($_SESSION['servidor']) || isset($_SESSION['operador']))
{
header("Location: ..");
return;
}
if ($_POST['volver']) {
header("Location: ../..");
return;
}
include("cfg/mysql.php");
?>
<!--
Desarrollado por Bruno Donadío
-->
<!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>Identificarse - GamingSamp</title>
<link rel="icon" href="img/favicon.png" type="image/png" />
<link href="css/estilo.css" rel="stylesheet" type="text/css" />
<!-- jQuery -->
<script type="text/javascript" src="js/jquery-1.6.4.min.js"></script>
<!-- Cargando -->
<script type="text/javascript">
function TerminarCarga($resultado) {
if ($resultado) {
document.location = "..";
} else {
$('#cargando').animate({
opacity:0
});
document.getElementById('cargando').style.zIndex = -1;
document.getElementById('servidor').className = 'campo_error';
document.getElementById('contraseña').className = 'campo_error';
}
}
</script>
</head>
<body><?php if ($_POST['identificarse']) { ?><div id="cargando"><img src="img/cargando.gif" style="margin-top: 25%;" width="100" height="100" border="0" /></div>
<script type="text/javascript">
$(document).ready(function(){
<?php if (!$_POST['servidor'] || !$_POST['contraseña']) { ?>
setTimeout("TerminarCarga(0);", 2000);
<?php } else if (strpos($_POST['servidor'], "A") !== true) {
$query = mysql_query("SELECT * FROM servidores WHERE Servidor = '" . mysql_real_escape_string($_POST['servidor']) . "' AND Clave = MD5(MD5(MD5(MD5(MD5('" . mysql_real_escape_string($_POST['contraseña']) . "'))))) AND Estado = 1");
if (mysql_num_rows($query)) {
$_SESSION['servidor'] = $_POST['servidor'];
if ($_POST['recordar'] == "ok") {
$query = mysql_query("SELECT * FROM recordar WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "'")or die(mysql_error());
if (mysql_num_rows($query)) {
mysql_query("UPDATE Recordar SET Servidor = '" . $_POST['servidor'] . "', Clave = '" . $_POST['contraseña'] . "' WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "'");
} else {
mysql_query("INSERT INTO Recordar VALUES('" . $_SERVER['REMOTE_ADDR'] . "', '" . $_POST['servidor'] . "', '" . $_POST['contraseña'] . "')");
}
} else {
mysql_query("DELETE FROM Recordar WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "'");
} ?>
setTimeout("TerminarCarga(1);", 2000);
<?php } else { ?>
setTimeout("TerminarCarga(0);", 2000);
<?php }
}
else if (strpos($_POST['servidor'], "OP") !== true) {
$query = mysql_query("SELECT * FROM operadores WHERE Operador = '" . mysql_real_escape_string($_POST['servidor']) . "' AND Clave = MD5(MD5(MD5(MD5(MD5('" . mysql_real_escape_string($_POST['contraseña']) . "')))))")or die(mysql_error());
if (mysql_num_rows($query)) {
$_SESSION['operador'] = $_POST['servidor'];
if ($_POST['recordar'] == "ok") {
$query = mysql_query("SELECT * FROM recordar WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "'");
if (mysql_num_rows($query)) {
mysql_query("UPDATE Recordar SET Servidor = '" . $_POST['servidor'] . "', Clave = '" . $_POST['contraseña'] . "' WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "'");
} else {
mysql_query("INSERT INTO Recordar VALUES('" . $_SERVER['REMOTE_ADDR'] . "', '" . $_POST['servidor'] . "', '" . $_POST['contraseña'] . "')");
}
} else {
mysql_query("DELETE FROM Recordar WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "'");
} ?>
setTimeout("TerminarCarga(1);", 2000);
<?php } else { ?>
setTimeout("TerminarCarga(0);", 2000);
<?php }
}
else { ?>
setTimeout("TerminarCarga(0);", 2000);
<?php }
mysql_close(); ?>
});
</script><?php } ?>
<div id="logo"></div>
<div id="cuerpo">
<form method="post">
<?php if (!$_POST['identificarse']) {
$query = mysql_query("SELECT * FROM recordar WHERE IP = '" . $_SERVER['REMOTE_ADDR'] . "'")or die(mysql_error());;
if (mysql_num_rows($query)) {
while ($row = mysql_fetch_array($query)) {
$servidor = $row['Servidor'];
$contraseña = $row['Clave'];
$checked = 1;
}
}
mysql_close();
} else {
$servidor = htmlentities($_POST['servidor']);
$contraseña = htmlentities($_POST['contraseña']);
if ($_POST['recordar'] == "ok") $checked = 1;
} ?>
<span class="campo">SERVIDOR:</span><br />
<input id="servidor" name="servidor" type="text" size="20" class="campo_reposo" value="<?= $servidor ?>" onfocus="this.className='campo_sobre'" onblur="this.className='campo_reposo'" />
<br /><br />
<span class="campo">CONTRASEÑA:</span><br />
<input id="contraseña" name="contraseña" type="password" size="20" class="campo_reposo" value="<?= $contraseña ?>" onfocus="this.className='campo_sobre'" onblur="this.className='campo_reposo'" />
<br /><br />
<input name="recordar" style="line-height: 11px; vertical-align: bottom;" type="checkbox" value="ok"<?php if ($checked) { ?>checked="checked"<?php } ?> /> <span class="recordar">Recordar contraseña</span>
<br /><br />
<input name="identificarse" type="submit" value="IDENTIFICARSE" class="boton_reposo_cont" onmouseover="this.className='boton_sobre_cont'" onmouseout="this.className='boton_reposo_cont'" />
<input name="volver" type="submit" value="VOLVER AL SITIO" class="boton_reposo_cont" onmouseover="this.className='boton_sobre_cont'" onmouseout="this.className='boton_reposo_cont'" />
</form>
</div>
</body>
</html>
<?php mysql_close(); ?>//Esta Es La Linea que Tiene El Erro La Linea 127