-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcargar.php
More file actions
48 lines (43 loc) · 1.4 KB
/
cargar.php
File metadata and controls
48 lines (43 loc) · 1.4 KB
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
<?php require_once ('conexion.php');
//valdidar formulario
//
if (!isset($_POST['paginar']) || $_POST['paginar'] == '') {exit;
}
$_SESSION['paginacion'] += $porpagina;
$indice = $_SESSION['paginacion'];
$accion_cargar = "SELECT * FROM post ORDER BY id DESC LIMIT $indice,$porpagina";
$consulta_cargar = mysqli_query($conexion, $accion_cargar);
$datos_cargar = mysqli_fetch_assoc($consulta_cargar);
$cantidad_cargar = mysqli_num_rows($consulta_cargar);
?>
<?php if ($cantidad_cargar != 0) {
do {
$imagenes = $datos_cargar['image'];
$partes = explode('####', $imagenes);
// $cantidad = count($partes);
// echo $cantidad;
?>
<div class="ed-container">
<div class="ed-item m-25 l-25">
<?php if ($imagenes != '') {?>
<img src="static/img/upload/<?php echo $partes[0];?>">
<?php } else {?>
<img src=static/img/HELMI1.png">
<?php }?>
</div>
<div class="ed-item m-75 l-75">
<h2><a class="title-pub" href=" <?php echo $dato[0];?>post/<?php echo $datos_cargar['seo'];?> "><?php echo $datos_cargar['title'];
?></a> </h2>
<p class="content-pub">
<?php echo substr($datos_cargar['content'], 0, 1000);?></p>
<br> <br>
<div class="etiqueta etiqueta-pequenia fecha">
<p>
Publicado el dia <strong><?php echo date('d/m/Y H:i', strtotime($datos_post['fecha']));?></strong>
</p></div>
</div>
</div>
<?php } while ($datos_cargar = mysqli_fetch_assoc($consulta_cargar));
}?>
<?php
mysqli_free_result($consulta_cargar);