Pagina de Netstore en XML
En este documento se mostrara la forma en que se realizo la pagina de netstore en XML y mediante el cual tu podras implementar y sentirte libre de usar el codigo que aquí se muestra en esete documento
Login
En esta pagina es donde tu podras iniciar sesion para poder acceder a nuestra pagina y de esta forma conocer las promociones que tenemos para ti
A continuacion se presenta el codigo que se utilizo en esta pagina
<?php
$error = false;
if(isset($_POST['login'])){
$username = preg_replace('/[^A-Za-z]/', '', $_POST['username']);
$password = md5($_POST['password']);
if(file_exists('users/' . $username . '.xml')){
$xml = new SimpleXMLElement('users/' . $username . '.xml', 0, true);
if($password == $xml->password){
session_start();
$_SESSION['username'] = $username;
header('Location: index.php');
die;
}
}
$error = true;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Iniciar Sesion</title>
</head>
<body background="fondo.jpg">
<h2>Bienvenido a Net Store: tu tienda de Redes</h2>
<hr />
<h1><p align="center">
<p align="center">
<p align="center">
<p align="center">Iniciar Sesion
</h1>
<form method="post" action="">
<p><p align="center">Usuario <input type="text" name="username" size="20" /></p>
<p align="center">Password <input type="password" name="password" size="20" /></p>
<?php
if($error){
echo '<p><p align="center">Usuario o Passowrd invalido</p>';
}
?><p align="center">
<input type="submit" value="Iniciar Sesion" name="login" />
</form>
<a href="register.php"><p align="center">Registrarse</a>
<hr />
</body>
</html>
Registro
En esta parte podras realizar tu registro en caso de no tener una cuenta con netstore
A continuacion se muestra el codigo que se utilizo para esta seccion
<?php
$errors = array();
if(isset($_POST['login'])){
$username = preg_replace('/[^A-Za-z]/', '', $_POST['username']);
$email = $_POST['email'];
$password = $_POST['password'];
$c_password = $_POST['c_password'];
if(file_exists('users/' . $username . '.xml')){
$errors[] = 'El usuario ya existe';
}
if($username == ''){
$errors[] = 'Usuario esta en blanco';
}
if($email == ''){
$errors[] = 'Email esta blanco';
}
if($password == '' || $c_password == ''){
$errors[] = 'Los passwords estan en blanco';
}
if($password != $c_password){
$errors[] = 'Los passwords no coinciden';
}
if(count($errors) == 0){
$xml = new SimpleXMLElement('<user></user>');
$xml->addChild('password', md5($password));
$xml->addChild('email', $email);
$xml->asXML('users/' . $username . '.xml');
header('Location: login.php');
die;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Register</title>
</head>
<body background="fondo.jpg">
<h1>Registro de Usuario</h1>
<form method="post" action="">
<?php
if(count($errors) > 0){
echo '<ul>';
foreach($errors as $e){
echo '<li>' . $e . '</li>';
}
echo '</ul>';
}
?>
<p>Usuario <input type="text" name="username" size="20" /></p>
<p>E-mail <input type="text" name="email" size="20" /></p>
<p>Password <input type="password" name="password" size="20" /></p>
<p>Confirmar Password <input type="password" name="c_password" size="20" /></p>
<p><input type="submit" name="login" value="Iniciar Sesion" /></p>
</form>
</body>
</html>
Index
En esta pagina podras acceder a los diferentes links que esta conforman
Cambiar de password
En esta pantalla podras realizar los cambios correspondientes a tu cuenta en Netstore
A continuacion se muestra el codigo que se uso en esta pagina
<?php
session_start();
if(!file_exists('users/' . $_SESSION['username'] . '.xml')){
header('Location: login.php');
die;
}
$error = false;
if(isset($_POST['change'])){
$old = md5($_POST['o_password']);
$new = md5($_POST['n_password']);
$c_new = md5($_POST['c_n_password']);
$xml = new SimpleXMLElement('users/' . $_SESSION['username'] . '.xml', 0, true);
if($old == $xml->password){
if($new == $c_new){
$xml->password = $new;
$xml->asXML('users/' . $_SESSION['username'] . '.xml');
header('Location: logout.php');
die;
}
}
$error = true;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>User Page</title>
</head>
<body background="fondo.jpg">
<h1>Cambiar Password</h1>
<form method="post" action="">
<?php
if($error){
echo '<p>Alguno de los passwords no coinciden</p>';
}
?>
<p>Password anterior <input type="password" name="o_password" /></p>
<p>Password nuevo <input type="password" name="n_password" /></p>
<p>Confirmar nuevo password <input type="password" name="c_n_password" /></p>
<p><input type="submit" name="change" value="Cambiar Password" /></p>
</form>
<hr />
<a href="index.php">Inicio</a>
</body>
</html>
Terminar Sesion
En este link podras terminar tu sesion que esta abierta al momento de acceder a Netstore
A continuacion se mostrara el codigo que se utilza en este link
<?php
session_start();
session_destroy();
header('Location: login.php');
Contactanos
En este link podras saber acerca de nosotros mediante correo electronico
Este link esta conformado por el siguiente codigo
<a href="mailto:[email protected]" title="E-mail soporte NetStore">Contactanos</a>
Catalogo
En esta pagina se descargo un plugin de flash que es gratuito y puedes descargarlo tu mismo e insertarlo en alguno de tus proyectos y es de facil configuracion
Se muestra tambien el link de descarga:
http://www.flashpageflip.com/FreeFPF.asp
y en esta podras conocer la forma en la que se puede configurar tu libro virtual en flash para tus proyectos ya que no requiere de grandes conocimientos para su configuracion y ademas es muy interactiva su interface al usuario
Quienes somos?
En esta seccion podras saber acerca de Netstore
Y este es su respectivo codigo de la pagina
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Quienes Somos</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="mm_lodging1.css" type="text/css" />
<style type="text/css">
<!--
.Estilo1 {
font-size: 14px;
font-weight: bold;
}
.Estilo2 {
font-size: 14px;
color: #000000;
}
-->
</style>
</head>
<body bgcolor="#999966">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15" nowrap="nowrap"> </td>
<td height="60" colspan="3" class="logo" nowrap="nowrap">Net Store tu tienda de redes </td>
<td width="100%"> </td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="5"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr bgcolor="#a4c2c2">
<td width="15" nowrap="nowrap"> </td>
<td height="36" colspan="2" id="navigation" class="navText"><a href="javascript:;" class="Estilo2">Inicio</a></td>
<td> </td>
<td width="100%"> </td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="5"><img src="mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
</tr>
<tr bgcolor="#ffffff">
<td valign="top" width="15"><img src="mm_spacer.gif" alt="" width="15" height="1" border="0" /></td>
<td valign="top" width="140"><img src="mm_spacer.gif" alt="" width="134" height="1" border="0" /></td>
<td width="505" valign="top"><br />
<table border="0" cellspacing="0" cellpadding="2" width="440">
<tr>
<td class="pageName">Quienes somos </td>
</tr>
<tr>
<td class="bodyText"><p class="Estilo1">Net Store es una empresa con mas de 5 años en el mercado, tiempo durante el cual se ha preocupado por mantener dentro de su equipo de trabajo a personal calificado con experiencia en el Ramo de la Informática y Redes, lo que le ha valido para obtener la confianza de nuestros clientes, ya que los resultados de nuestro trabajo satisfacen las expectativas creadas.</p>
<p> </p>
<p> </p>
<br /></td>
</tr>
</table>
<br />
<br /> </td>
<td valign="top"> </td>
<td width="100%"> </td>
</tr>
<tr>
<td width="15"> </td>
<td width="140"> </td>
<td width="505"> </td>
<td width="100"> </td>
<td width="100%"> </td>
</tr>
</table>
</body>
</html>