Tema: Consultas
Ver Mensaje Individual
  #21 (permalink)  
Antiguo 18/01/2009, 15:35
majony
(Desactivado)
 
Fecha de Ingreso: diciembre-2008
Mensajes: 421
Antigüedad: 15 años, 4 meses
Puntos: 0
Respuesta: Consultas

Bueno para poder enterder mejor pase a lo mismo pero a un version mas reducida como un prototipo de lo que puede hacer en mi sistema me cre lo siguiente:

1::: Este es el de presentacion::

<html>
<!-- true.html-->
<head>

</head>
<body>
<form action="control.php" method="post">
nombre:<input type="text" name="usuario" size="20" maxlength="256">
contraseña <input type="text" name="contrasena" size="20" maxlength="256">
<input type="submit" value="listo">


</form>

<a href="ojo.html"> Registrate</a>


</body>
</html>

2:::: ESTE ES EL CONTROL DE USUARIOS:: control.php

<?php
include ("../conectar.php");
$link = Conectarse();
$ssql = "SELECT * FROM login3 WHERE nick='$usuario' and contrasena='$contrasena'";
$rs = mysql_query($ssql,$link);
if (mysql_num_rows($rs)!=0){

session_start();
session_register("autentificado");
$autentificado = "SI";

$_SESSION[nombre] = $usuario;
header("Location: carlos.php");

}else {

echo "Datos incorrectos por favor intentelo de nuevo";

}
mysql_free_result($rs);
mysql_close($link);
?>

3::: SI NO ESTAN SE REGISTRAN AUI::

<html>
<!-- ojo.html -->
<head>

</head>
<body>
<form action="mira.php" method="get">
nick<br>
<input type="text" name="nick" size="20" maxlength="256"><br>
contraseña: <br>
<input type="password" name="contrasena" size="20" maxlength="256"><br>
nombre<br>
<input type="text" name="nombre" size="20" maxlength="256">
<input type="submit" value="listo">

</form>
</body>
</html>


4:: Mira.php este es el q insertar login y contrasena nueva para poder entrar:::
<html>
<body>
<?php
include("../conectar.php");
$link = Conectarse();
$id = $_GET['id'];
$nick = $_GET['nick'];
$contrasena = $_GET['contrasena'];
$nombre = $_GET['nombre'];

// $result_ultimo=mysql_query("SELECT * FROM vista where veo = 0",$link);
//echo $result;
// if ($result == 0 ){
$resultt = mysql_query("insert into login3(nick,contrasena,nombre) values ('$nick','$contrasena','$nombre')",$link);

echo "inserto correctamente";

//}
//else
//{
//echo "ya lo hizo";
//}
?>
<a href=true.html> vuelve a</a>
</body>
</html>

5:::: ESTE ES EL MENU PERSONAL DE CADA PERSONA AL INICIAR SU SESION:: carlos.php

<html>
<!-- Created on: 17/01/2009 -->
<head>

</head>
<body>
Hola mundo
<center> llena tu menu </center>
<?php
include("../conectar.php");
$link = Conectarse();
$id = $_GET['id'];
$nick = $_GET['nick'];
$contrasena = $_GET['contrasena'];
$nombre = $_GET['nombre'];
$result = mysql_query("select veo from login3 where nombre = '$nombre'",$link);
$vista = mysql_result($result ,0);
// echo $vista;
if ($vista == 0){
?>
<li><a href=carlos2.html> tu formualrio </a></li>

<?php
mysql_query("Update login3 Set veo = '1' where nick = '$nick'");
}

else
{
echo "ya esta";
}

?>
<li><a href=#> Modificalo </a></li>
<li><a href=salir.php> Salir de Session </a></li>

</body>
</html>

5::: ESTE ES EL LINK QUE TIEEN Q LLEnAR Y DESPUES DESACTIVARSE::

<html> carlos2.php
<head>

<title></title>

</head>
<body>
<form action="minombre.php" method="post">
nombre
<input type="text" name="nombre" size="40" maxlength="256">
apellido <input type="text" name="apellido" size="40" maxlength="256">
<input type="submit" value="listo">

</form>
</body>
</html>

6:: este es de inserte en carlos2
minombre.php
<?php /* Created on: 17/01/2009 */ ?>
<html>
<body>
<?php
include("../conectar.php");
$link = Conectarse();
$id =$_POST['id'];
$nombre = $_POST['nombre'];
$apellido = $_POST['apellido'];



// $result_ultimo=mysql_query("SELECT * FROM vista where veo = 0",$link);
//echo $result;
// if ($result == 0 ){
$resultt = mysql_query("insert into nombres(nombre,apellido) values ('$nombre','$apellido')",$link);

echo "inserto correctamente";

//}
//else
//{
//echo "ya lo hizo";
//}
?>
<a href=carlos.php> vuelve a tu menu </a>
</body>

</body>
</html>

7:: el de salir::::

salir.php

<?
session_start();
session_destroy();
?>
<html>
<head>
<title>Has salido!!</title>
</head>
<body style="background-color: #BAD4FF">
Gracias por tu acceso
<br>
<br>
<a href=true.html>Formulario de autentificación</a>
</body>
</html>