entrada2.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>MANTENIMIENTO CLIENTES</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<section id="main_container">
<header class="header">
<h1>MANTENIMIENTO CLIENTES</h1>
<nav class="top_menu">
<ul>
<li><a href="http://192.168.178.104/listado2.php">Listado</a></li>
<li><a href="http://192.168.178.104/entrada2.php#">Entrada</a></li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</nav>
</header>
<section class="content">
<article>
<form method="post" action="graba.php">
NOMBRE......... : <input type="text" name="nombre1" > <br>
POBLACION .. : <input type="text" name="poblacion1" ><br>
SALDO............. : <input type="text" name="saldo1" ><br>
<input type="submit" value="confirmar"><br>
</form>
</section>
<footer class="footer">
<span class="footer_msg"> (c)JOSE PEREZ ASENSIO</span>
</footer>
</article>
</section>
</body>
</html>
*************************************************************
listado2.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ALTAS CLIENTES</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<section id="main_container">
<header class="header">
<h1>ALTAS CLIENTES</h1>
<nav class="top_menu">
<ul>
<li><a href="http://192.168.178.104/listado2.php">Listado</a></li>
<li><a href="http://192.168.178.104/entrada2.php">Entrada</a></li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</nav>
</header>
<section class="content">
<article>
<?php
$mysqli = new mysqli("localhost", "root", "3266root", "prueba");
if ($mysqli->connect_errno) {
echo "Fallo al conectar a MySQL: " . $mysqli->connect_error;
}
$resultado = $mysqli->query('select * from clientes');
while ($fila = $resultado->fetch_assoc())
{ echo $fila['nombre']. ' ' . $fila['poblacion'] . ' ' . $fila['saldo'] .'<br>';
}
?>
</article>
</section>
<footer class="footer">
<span class="footer_msg"> (C)JOSE PEREZ ASENSIO</span>
</footer>
</section>
</body>
</html>
****************************************************************************
graba.php
<!doctype html>
<html>
<head>
<title>Alta</title>
</head>
<body>
<?php
$mysql=new mysqli("localhost","root","3266root","prueba");
if ($mysql->connect_error)
die("Problemas con la conexión a la base de datos");
$mysql->query("insert into clientes values ('$_POST[nombre1]', '$_POST[poblacion1]' , '$_POST[saldo1]' )") or
die($mysql->error);
$mysql->close();
header('location: http://192.168.178.104/entrada2.php');
?>
</body>
.header
{
width:90%;
margin-top:5px;
margin-left:5%;
background:#EE7156;
border: 3px outset;
height: 200px;
float:left;
}
/*Menu */
.top_menu ul
{
list-style:none;
float:left;
border: 1px dashed;
padding: 2%;
width:95%;
background: black;
}
.top_menu ul li
{
float:left;
margin-right:20px;
margin-bottom:10px;
background: #ff812d;
padding:5px;
border-radius: 15%;
}
.top_menu ul li a
{
color: #FFFFFF;
text-decoration:none;
}
.top_menu ul li a:hover
{
color: blue;
}
/*Footer*/
.footer
{
width:90%;
margin-top:5px;
margin-left:5%;
background:#ffffff;
border: 3px outset;
height: 110px;
float:left;
}
.footer_msg
{
margin-top: 40px;
float: left;
margin-left: 5%;
font-size: 0.8em;
color: rgb(126, 126, 126);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>MANTENIMIENTO CLIENTES</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<section id="main_container">
<header class="header">
<h1>MANTENIMIENTO CLIENTES</h1>
<nav class="top_menu">
<ul>
<li><a href="http://192.168.178.104/listado2.php">Listado</a></li>
<li><a href="http://192.168.178.104/entrada2.php#">Entrada</a></li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</nav>
</header>
<section class="content">
<article>
<form method="post" action="graba.php">
NOMBRE......... : <input type="text" name="nombre1" > <br>
POBLACION .. : <input type="text" name="poblacion1" ><br>
SALDO............. : <input type="text" name="saldo1" ><br>
<input type="submit" value="confirmar"><br>
</form>
</section>
<footer class="footer">
<span class="footer_msg"> (c)JOSE PEREZ ASENSIO</span>
</footer>
</article>
</section>
</body>
</html>
*************************************************************
listado2.php
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>ALTAS CLIENTES</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<section id="main_container">
<header class="header">
<h1>ALTAS CLIENTES</h1>
<nav class="top_menu">
<ul>
<li><a href="http://192.168.178.104/listado2.php">Listado</a></li>
<li><a href="http://192.168.178.104/entrada2.php">Entrada</a></li>
<li><a href="#">Item 3</a></li>
<li><a href="#">Item 1</a></li>
<li><a href="#">Item 2</a></li>
<li><a href="#">Item 3</a></li>
</ul>
</nav>
</header>
<section class="content">
<article>
<?php
$mysqli = new mysqli("localhost", "root", "3266root", "prueba");
if ($mysqli->connect_errno) {
echo "Fallo al conectar a MySQL: " . $mysqli->connect_error;
}
$resultado = $mysqli->query('select * from clientes');
while ($fila = $resultado->fetch_assoc())
{ echo $fila['nombre']. ' ' . $fila['poblacion'] . ' ' . $fila['saldo'] .'<br>';
}
?>
</article>
</section>
<footer class="footer">
<span class="footer_msg"> (C)JOSE PEREZ ASENSIO</span>
</footer>
</section>
</body>
</html>
****************************************************************************
graba.php
<!doctype html>
<html>
<head>
<title>Alta</title>
</head>
<body>
<?php
$mysql=new mysqli("localhost","root","3266root","prueba");
if ($mysql->connect_error)
die("Problemas con la conexión a la base de datos");
$mysql->query("insert into clientes values ('$_POST[nombre1]', '$_POST[poblacion1]' , '$_POST[saldo1]' )") or
die($mysql->error);
$mysql->close();
header('location: http://192.168.178.104/entrada2.php');
?>
</body>
**************************************************************************
style.css
*Body*/
body
{
margin:0px;
padding-top:5px;
}
#main_container
{
width:90%;
margin-left:5%;
padding-top:5px;
padding-bottom:5px;
float:left;
border: 3px outset;
}
/*Content*/
.content{
width:90%;
margin-top:5px;
margin-left:5%;
padding-bottom:50px;
background:orange;
border: 1px dashed;
height: auto;
float:left;
}
.content article
{
padding: 3%;
margin-left:5%;
}
.content article h2
{
}
/*Header*/
{
width:90%;
margin-top:5px;
margin-left:5%;
background:#EE7156;
border: 3px outset;
height: 200px;
float:left;
}
/*Menu */
.top_menu ul
{
list-style:none;
float:left;
border: 1px dashed;
padding: 2%;
width:95%;
background: black;
}
.top_menu ul li
float:left;
margin-right:20px;
margin-bottom:10px;
background: #ff812d;
padding:5px;
border-radius: 15%;
}
.top_menu ul li a
{
color: #FFFFFF;
text-decoration:none;
}
.top_menu ul li a:hover
{
color: blue;
}
/*Footer*/
.footer
{
width:90%;
margin-top:5px;
margin-left:5%;
background:#ffffff;
border: 3px outset;
height: 110px;
float:left;
}
.footer_msg
{
margin-top: 40px;
float: left;
margin-left: 5%;
font-size: 0.8em;
color: rgb(126, 126, 126);
}
Comentarios
Publicar un comentario