Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/01/2013, 11:39
santi2892009
 
Fecha de Ingreso: mayo-2012
Mensajes: 363
Antigüedad: 12 años
Puntos: 0
dudas crear seccion y cerrarlas

olaa tengo otro tema abierto pero me gustaria cerrarlo,y preguntar este:

- como hacer que el usuario cuando inicie seccion se guarde en la base de datos para que cuando vuelva a entrar empiece donde lo dejo

y tambien como cerrar la session.tengo esto:

un sistema de registro el cual habro sesion y la guardo con;
index.php(para abrir session y guardarla):
<?php
session_start();
// store session data
$_SESSION['views']=1;
?>

<html>
<body>

<?php
//retrieve session data
echo "Pageviews=". $_SESSION['views'];
?>

</body>
</html>
----------------
para cerrar session:puede ser con esto
<?php
session_start();
if(isset($_SESSION['views']))
unset($_SESSION['views']);
?>
el tema q tengo un html con un boton cerrar q seria esto mas o menos:(dondo coloco el cerrar session
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
</head>

<body>
<input type='Submit' value=salir name=Accion id=Accion OnClick="window.location.href='index.php'"> <?php
session_start();
if(isset($_SESSION['views']))
unset($_SESSION['views']);
?>
</body>
</html>