forked from jawpa/carrito-de-compras-php-jquery-crud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
45 lines (40 loc) · 1.21 KB
/
index.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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="utf-8"/>
<title>Carrito de Compras</title>
<!-- las rutas pivotean con index.php -->
<link rel="stylesheet" type="text/css" href="./css/estilos.css">
<script type="text/javascript" src="./js/scripts0.js"></script>
</head>
<body>
<header>
<h1>Carrito De Compras</h1>
<!-- el path siempre toma como pivot index.php -->
<a href="./carritodecompras.php" title="ver carrito de compras">
<img src="./imagenes/carrito.png">
</a>
</header>
<section>
<?php
include 'conexion.php';
// seleccionamos a todos los registros de la base
$resultado = mysqli_query($con,"select * from productos")or die(mysqli_error());
while ($f = mysqli_fetch_array($resultado)) {
?>
<div class="producto">
<center>
<!-- mostramos cada registro -->
<img src="./productos/<?php echo $f['imagen'];?>"><br>
<span><?php echo $f['nombre'];?></span><br>
<!-- vamos a la página detalle con un valor en la url -->
<!-- dicho valor, mostrará un contenido específico -->
<a href="./detalles.php?id=<?php echo $f['id'] ?>">ver</a>
</center>
</div>
<?php
}
?>
</section>
</body>
</html>