hola sabes que ahora quiero hacer otra cosa, pero es paresida es lo siguiente:
usuario.html
<head>
<title>INGRESAR USUARIO</title>
</head>
<body bgcolor=#ffffff>
<div style="position:absolute; top:20px;left:140px;">
<IMG src=inicia1.jpg>
</DIV>
<font face="courier new" color=000000>
<form name=ingresar action =ingreso_ok.php method=post>
<DIV STYLE="POSITION:absolute; LEFT:400px; TOP:150px;">
<a><input type=text name=nombre_user size=13></a>
</DIV>
<DIV
STYLE="POSITION:absolute; LEFT:400px; TOP:130px; font-family:arial,verdana; font-size:7pt; font-weight:600; color:black">
Nombre Usuario
</DIV>
<DIV
STYLE="POSITION:absolute; LEFT:530px; TOP:150px;">
<a><input type=password name=clave_user size=9></a>
</DIV>
<DIV
STYLE="POSITION:absolute; LEFT:530; TOP:130px; font-family:arial,verdana; font-size:7pt; font-weight:600; color:black">
Clave
</DIV>
<div
style="position:absolute;left:400px;top:180px;">
<input onClick="#" type=submit value="Entrar" name="entrar"
style="BORDER: rgb(128,128,128) 1px solid; FONT-SIZE: 8pt; FONT-FAMILY: Verdana;
BACKGROUND-COLOR: rgb(208,247,253)">
</div>
</font>
</form>
</body>
</head>
en ingreso_ ok.php
<?php
session_start();
$link=mysql_connect("localhost","root","");
if(!$link)
{
echo "ERROR AL CONECTARSE ";
}
mysql_select_db('biblioteca',$link);
$resultado=mysql_query("select *from usuario where nombre_user='$nombre_user'",$link);
$resul= mysql_fetch_assoc($resultado);
if(!$nombre_user=="")
{
if($resul['nombre_user']!=$nombre_user||$resul['codigo_user']!=$clave_user)
{
echo "No se encuentra ese usuario";
}
else
{
?>
<body >
<DIV STYLE="POSITION:absolute; LEFT:150px; TOP:50px;">
<img src=ventana.jpg>
</DIV>
<div style="position:absolute;left:185px; top:100px;color=#11ffff; font-size=8pt">
<a>Bienvenido : <?php echo $resul['nombre_user']?></a>
</div>
</body>
<a href=ingresar_codigos.php>Prestar</a>
// este es el link que no esta funcionando (creo yo)
//creo que aqui se prapaga el sid pero no se como hacerlo
<?PHP
$_SESSION['usuario']=true;
}
}
else
{
session_destroy();
echo "Usted no ha iniciado una sesion";
}
?>
y en ingresar_codigos.php (es el codigo del libro no el del usuario)
<?php
session_start();
echo $_SESSION['usuario'];
// $_SESSION siempre es vaerdadero, no se porque
if($_SESSION['usuario']!=true)
{
echo $_SESSION['usuario'];
echo "ERROR NO HAS INICIADO UNA SESSION";
}
else
{
?>
<html>
<head>
<title>Ingresar datos</title>
</head>
<body>
<div style="position:absolute;left:150px;top:120">
<img src=ventana.jpg>
</div>
<form action=prestar_libro.php method =post>
<div style="position:absolute; left:180px; top:160px;font-family:arial; font-size: 8pt;color:#11ff11">
Numero Lector
</div>
<div style="position:absolute; left:180px;top:180px;width:300; overflow:hidden">
<input type=text name=num_lector size =8>
</div>
<div style="position:absolute; left:300px; top:160px;font-family:arial; font-size: 8pt;color:#11ff11">
Codigo Libro
</div>
<div style="position:absolute; left:300px;top:180px;width:400; overflow:hidden">
<input type=text name=codigo_libro size=8>
</div>
<div style="position:absolute; left:400px;top:180px;width:300; overflow:hidden">
<input type=submit value =ok name=enviar>
</div>
</body>
</head>
</html>
<?php
}
?>
eso es no me esta funcionando si me puedes decir que el lo que tengo mal porfa