Ver Mensaje Individual
  #3 (permalink)  
Antiguo 07/07/2011, 13:45
Anna Carolina
 
Fecha de Ingreso: febrero-2007
Ubicación: Caracas
Mensajes: 148
Antigüedad: 17 años, 2 meses
Puntos: 6
Respuesta: iniciar seccion a una pagina

CUENTA
Código:
<?php

	$data_root = $_SERVER[DOCUMENT_ROOT];
	include ($data_root . "/site/sec/funciones.php");
	
	session_start();
$menu_links = "";
if (isset($_SESSION['id'])) {
	$userid = $_SESSION['id'];
	$usuario = $_SESSION['usuario'];
	//CREACION DEL MENU AUTOMATICO
	//MENU USUARIOS REGISTRADOS
	$menu_links = '<a href="cuenta.php?id=' . $userid . '">' . $usuario . '</a> &bull; <a href="logout.php">Fin Sesion</a>';
} else {
	//MENU USUARIOS NO REGISTRADOS
	$menu_links = '<a href="registro.php">Registrarse</a> &bull; <a href="login.php">Inicio de Sesion</a>';
	header("location: index.php");
	exit();
}
	if($pag!="") {
		$plantilla = $pag;
	}
	
	if($_GET[pag]!="") {
		$plantilla = $_GET[pag];
	}
	
	if($_POST[pag]!="") {
		$plantilla = $_POST[pag];
	}	
	
	if(!($plantilla)) {
		$plantilla = "home";
	}
	
?>

Código:
|<a href="index.php"> Home </a>|<a href="index.php" >Novedades</a> |<a href="nosotros.php"> &iquest;Qui&eacute;nes Somos? </a>|<a href="registro.php" target="_parent"> Reg&iacute;strate |</a><a href="contactenos.php">Cont&aacute;ctanos</a>|<?php
$menu_links2 = "";
$sql = mysql_query("SELECT * FROM registro WHERE id='$userid'");
while($row = mysql_fetch_array($sql)){
	$nombres = $row["nombres"];
	$apellidos = $row["apellidos"];
	$email = $row["email"];
	$telefono= $row["telefono"];
	$password= $row["password"];
}
?>
<?php echo $menu_links; ?>