-
Notifications
You must be signed in to change notification settings - Fork 0
/
editar.php
57 lines (36 loc) · 1.41 KB
/
editar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
require_once('includes/Editor.php');
$sesion = new Sesion();
$sesion->Validar();
$bytes = 4096000; // 1kb = 1024 * 4000 cáracteres (bytes)
$registro = new Editor('Texto','Enviar','Archivo.txt', $bytes);
$texto = $registro->Procesar();
$guardado = $registro->guardado;
$errorFatal = $registro->error;
?>
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8">
<title>Editar</title>
<script> function autoCerrar() { location.href= "cerrar.php"; } setTimeout(autoCerrar,500000); /** 5 minutos **/ </script>
<style> textarea{ width:900px; } </style>
</head>
<body>
<section>
<h3>Bienvenido <?php echo $sesion->actual;?></h3>
Total de operaciones permitidas <?php echo $sesion->contador; ?>
<?php if($guardado) : ?>
<h3>¡Guardado!</h3>
<?php endif ?>
<form method="POST" class="" action="editar.php" autocomplete="off">
<textarea maxlength="<?php echo $bytes - 1?>"
class="" name="Texto" rows="11"><?php echo $texto ?></textarea>
<?php if(!$errorFatal) : /*** No errores ***/ ?>
<button class="" type="submit" name="Enviar">Guardar</button>
<?php endif ?>
</form>
<a href="cerrar.php"> Salir </a>
</section>
</body>
</html>