Viewing file: index.php (3.88 KB) -rw-rw-r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
include "conn.php";
error_reporting (FATAL + ERROR);
date_default_timezone_set('UTC');
// primero, vemos que vengan parametros correctos.
//one=usuario, two=fecha formato (Y-m-d H) , tree el md5 de los otros dos
if (!$_REQUEST['one'] or !$_REQUEST['two'] or !$_REQUEST['three']){
ECHO "ENTRADA CON PARAMETROS NO ADECUADOS \n";
DIE();
}
$objeto=NEW datos($_REQUEST['one'],$_REQUEST['two'],$_REQUEST['three']);
function showContent($objeto)
{
$conn2=mysql_connect("localhost","fichfilk_papyre","ilvm2rg2");
$sqn="select * from fichfilk_papyre.torrebruno_files where reco IS NULL order by id asc";
$res=mysql_query($sqn ,$conn2);
echo mysql_error();
while ($row=mysql_fetch_array($res)){
if ($row['tipo']=="separador"){
echo "<tr><td><hr><b>".$row['observaciones']."</b><hr><td><td></tr>";
}else{
$external = new Encriptor();
$link=$external->encrypt($row['ruta']."?usuario=".$objeto->usuario."&fecha=".$objeto->fecha);
echo "<tr><td><img src='style/file2.gif' width='16' height='16' alt='file'/><a href='bajando_torr.php?l=$link'>";
echo $row['titulo']."</a></td><td align='right'>".$row['fecha']."</td><td align='right'>";
echo $row['tamano']." bytes</td></tr>";
if ($row['observaciones']){
echo "<tr><td><div class='caption2'><img src='transparente.gif' width='32' height='1'>";
echo $row['observaciones']."</div></td>"
."<td align='right'></td>"
."<td align='right'></td></tr>";
}
}
}
}
class datos
//una peque�a clase para sacar usuario y fecha
//print_r($_REQUEST);
{
public $usuario;
public $fecha;
public $tres;
public function __construct($one,$two,$three){
//one=usuario, two=fecha formato (Y-m-d H) , tree el md5 de los otros dos
$usuarioobj=new Encriptor();
$this->usuario=$usuarioobj->decrypt($one);
$this->fecha=$usuarioobj->decrypt($two);
$this->tres=$usuarioobj->decrypt($three);
unset($usuarioobj);
$conn3=&mysql_connect("localhost","papyrefb_papyre","ilvm2rg2");
$sql="insert into ficfilk_papyre.estadistica(id_book,fecha,nick,accion) values (12345678,'$this->fecha','$this->usuario','directorio')";
// $ris=mysql_query($sql,$conn3);
//echo $sql;
// echo "".mysql_error($ris);
// ahora, $this->tres debe contener $this->usuario y this->fecha
if (!strstr($this->tres,$this->usuario)){
echo "usuario incorrecto";
die();
}
if (!strstr($this->tres,$this->fecha)){
echo "fecha incorrecta";
die();
}
if (restahoras($this->fecha,date("Y-m-d H:i")) > "08:00:00" and restahoras($this->fecha,date("Y-m-d H:i")) <> "23:59:00" and restahoras($this->fecha,date("Y-m-d H:i")) <> "23:58:00" ){
echo $this->fecha."\n";
echo date("Y-m-d H:i")."\n";
echo restahoras($this->fecha,date("Y-m-d H:i"))."\n";
echo "sesion caducada. Vuelva a la p�gina de origen y refresquela para actualizar el enlace";
die();
}
}
}
function restaHoras($horaIni, $horaFin){
return (date("H:i:s", strtotime("00:00:00") + strtotime($horaFin) - strtotime($horaIni) ));
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Micro navegador</title>
<link href="style/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="main">
<div class="caption">MICRO EXPLORADOR RECOPILATORIOS</div>
<div class="caption">Usuario: <?php echo $objeto->usuario ?></div>
<div id="icon"> </div>
<div id="result">
<table width="100%">
<?php
showContent($objeto);
?>
</table>
</div>
<div id="source">Customized By fichfilk</div>
</div>
</body>
|