modificar.php
Código PHP:
Ver original<?php
include('acceso_db.php');
$texto8 = $_POST['texto8'];
$texto5 = $_POST['texto5'];
$texto6= $_POST['texto6'];
$texto7 = $_POST['texto7'];
$q = "UPDATE usuarios SET usuario_email='".$texto5."', Nombres='".$texto6."',Apellidos='".$texto7."' WHERE usuario_nombre='".$texto8."'";
if($rs) {
echo '<script language="JavaScript" type="text/javascript">
alert("Datos ingresados correctamente..");
function redirection(){
window.location ="perfil.php";
} setTimeout ("redireccionar()", 5000000000000000);
</script>';
}else {
echo "ha ocurrido un error y no se registraron los datos.";
}
}
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<table style="margin: 0 auto width="221" cellspacing="7" cellpadding="7" border="8" bgcolor="#1E679A">
<tr>
<td><font color="#FFFFFF" face="arial, verdana, helvetica">
<div style="text-align:center;">
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<label>Usuario:</label><br />
<input type="text" name="texto8" maxlength="50" /><br />
<label>Correo:</label><br />
<input type="text" name="texto5" maxlength="50" /><br />
<label>Nombres:</label><br />
<input type="text" name="texto6" maxlength="50" /><br />
<label>Apellidos:</label><br />
<input type="text" name="texto7" maxlength="50" /><br />
<input type="submit" name="enviar" value="Modificar" />
<input type="reset" value="Borrar" />
<a href="acceso.php" target="_self"> <input type="button" name="boton" value="Ingresar" />
</table>
</font></td>
</tr>
</div>
</form>
pagina_restringida.php
Código PHP:
Ver original<?php
include('acceso_db.php'); // incluímos los datos de acceso a la BD
// comprobamos que se haya iniciado la sesión
if(isset($_SESSION['usuario_nombre'])) { ?>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
Hola <?=$_SESSION['usuario_nombre']?> esta es una página restringida
</body>
</html>
<?php
}else {
echo "Estás accediendo a una página restringida, para ver su contenido debes estar registrado.<br />
<a href='acceso.php'>Ingresar</a> / <a href='registro.php'>Regitrarme</a>";
}
?>
perfil.php
Código PHP:
Ver original<?php
include('acceso_db.php');
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<?php
$id = $row["usuario_id"];
$nick = $row["usuario_nombre"];
$email = $row["usuario_email"];
$freg = $row["usuario_freg"];
$nombre = $row["Nombres"];
$apell= $row["Apellidos"];
?>
<form action="<?=$_SERVER['PHP_SELF']?>" method="post">
<tr>
<strong>Nombres:</strong> <?=$nombre?><br />
<strong>Apellidos:</strong> <?=$apell?><br />
<strong>Usuario:</strong> <?=$nick?><br />
<strong>Correo:</strong> <?=$email?><br />
<strong>Registrado el:</strong> <?=$freg?><br />
<strong><a href="cambiar_contrasena.php">Cambiar contraseña</a></strong>
</tr>
</form>
<a href="logout.php"><strong>Cerrar Sesión</strong></a><br>
<a href="acceso.php"><strong>Acceso</strong></a><br>
<a href="modificar.php"><strong>Modificar datos de usuario</strong></a><br>
<a href="eliminar.php"><strong>Eliminar usuario</strong></a>
<?php
}else {
?>
<p>El perfil seleccionado no existe o ha sido eliminado.</p>
<?php
}
?>
</body>
</html>
continuo en Eliminacion,modificacion,ingreso de usuarios en php 3