-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrear-entradas.php
49 lines (35 loc) · 1.91 KB
/
crear-entradas.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
<?php require_once 'includes/cabecera.php'; ?>
<?php require_once 'includes/redireccion.php'; ?>
<?php require_once 'includes/lateral.php'; ?>
<div id="contenedor">
<!-- CAJA PRINCIPAL -->
<div id="principal">
<h1>Crear Entradas</h1>
<p>Añade nuevas entradas al blog para que los suarios puedan leerlas y disfrutar el contenido</p><br/>
<form action="guardar-entrada.php" method="post">
<label for="titulo">Nombre Titulo:</label>
<input type="text" name="titulo">
<?php echo isset($_SESSION['errores_entrada']) ? mostrarErrores($_SESSION['errores_entrada'], 'titulo') : ' ';?>
<label for="descripcion">Descripción de la entrada:</label>
<textarea name="descripcion"></textarea>
<?php echo isset($_SESSION['errores_entrada']) ? mostrarErrores($_SESSION['errores_entrada'], 'descripcion') : ' ';?>
<label for="categoria">Categoría:</label>
<select name="categoria">
<?php
$categorias = conseguirCategirias($db);
if(!empty($categorias)):
while ($categoria = mysqli_fetch_assoc($categorias) ) :
?>
<option value="<?= $categoria['id']?>"><?=$categoria['nombre']?></option>
<?php
endwhile;
endif;?>
</select>
<?php echo isset($_SESSION['errores_entrada']) ? mostrarErrores($_SESSION['errores_entrada'], 'categoria') : ' ';?>
<input type="submit" name="guardar" value="Guardar">
</form>
<?php borrarErrores();?>
</div><!-- Fin principal -->
<div class="clearfix"></div>
</div><!-- Fin del contenedor -->
<?php require_once 'includes/pie.php';?>