Hola resulta que quiero sacar unos datos por pantalla y no lo consigo y creo que la consulta esta bien hecha pero no debe de coger bien el loginn y pass de la sesión o algo y el caso es que no da el resultado esperado, los datos son simplemente datos del Cliente que se loguea...Para administradores que es otra tabla si que me funciona por eso me mosquea a ver si podeis ver que falla, he puesto una salida de varios campos asi...
printf("<tr><td><td> %s</td><td><td> %s </td><td> </tr>", $row["nombre"],$row["apellido1"], $row["apellido2"]);
pero nada....
Código PHP:
<?php
include("conectarse_bd.php");
include("login.php");
$result = mysql_query("SELECT * FROM Clientes WHERE login='".$HTTP_COOKIE_VARS["usNick"]."' AND pass='".$HTTP_COOKIE_VARS["usPass"]."'");
while($row = mysql_fetch_array($result)) {
}
if($loginCorrecto)
{
//echo "<p style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; font-weight: bold; float:right;' > Bienvenido Administrador $nickUsuarioL </p>";
$mostrar = "Bienvenido !!!!";
}
else
{
//echo "Bienvenido visitante, el sistema no te ha reconocido, sino te autentificas no podras realizar ninguna de las funciones";
$mostrar = 'Bienvenido visitante, el sistema no te ha reconocido, sino te autentificas no podras realizar ninguna de las funciones';
//falla
header("Location: acceso.html");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Nogues | Arquitecto</title>
<script type="text/javascript" src="Funciones.js"></script>
<link rel="stylesheet" type="text/css" href="Estilo.css"/>
</head>
<body>
<div id="Contenedor">
<div id="Capa_titulo_admin">
<div id="logo" onclick="location='index.html'" title="Inicio" ></div>
</div>
<div id="Capa_admin">
<?php echo "<p style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; font-weight: bold; float:right;' > Zona Clientes </p>";
printf("<tr><td><td> %s</td><td><td> %s </td><td> </tr>", $row["nombre"],$row["apellido1"], $row["apellido2"]);
?>
<form id="form1" method="post" action="">
<fieldset class="clase1"><legend>Datos Personales</legend>
<label for="nombre">Nombre</label><input name="nombre" type="text" id="nombre" value= "<?php echo $nombreUsuarioL;?>" size="40" readonly="readonly"/>
<br />
<label for="apellidom">Apellido </label><input name="apellido1" type="text" id="apellido1" value= "<?php echo $apellido1UsuarioL;?>" size="40" readonly="readonly"/>
<br />
<label for="apellidop">Apellido </label><input name="apellido2" type="text" id="apellido2" value= "<?php echo $apellido2UsuarioL;?>" size="40" readonly="readonly" />
<br />
<label for="Email">Email</label>
<input name="mail" type="text" id="mail" value= "<?php echo $emailUsuarioL;?>" size="40" readonly="readonly"/>
<br />
<label for="telefono">Telefono</label><input name="telefono" type="text" id="telefono" value= "<?php echo $telefonoUsuarioL;?>" size="40" readonly="readonly" />
<br />
<label for="direccion">Dirección</label><input name="direccion" type="text" id="direccion" value= "<?php echo $direccionUsuarioL;?>" size="40" readonly="readonly" />
<br />
</fieldset>
<fieldset class="clase1"><legend>Trabajos en curso</legend>
<?php
$sql="SELECT * FROM Expedientes WHERE dni='$dniUsuarioL'";
$link = "<a href=\"cuenta2.php?expediente=%s\">%s<br></a>";
$result = mysql_query($sql);
if(isset($result) && mysql_num_rows($result)>0)
{
while($fila=mysql_fetch_assoc($result))
{
echo sprintf( $link, $fila['expediente'], $fila['nombre'] );
echo "<br>";
}
}
?>
</fieldset>
</form>
<?
//si hay resultados crea tabla
if ($row = mysql_fetch_array($result)){
echo "<table border = '1'> \n";
//Mostramos los nombres de las tablas
mysql_field_seek($result,0);
echo "<tr> \n";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; font-weight: bold;' <b>Fecha</b></td> \n";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; font-weight: bold;' <b>Nombre</b></td> \n";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; font-weight: bold;' <b>Ver</b></td> \n";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; font-weight: bold;' <b>Eliminar</b></td> \n";
echo "<td style='font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; font-weight: bold;' <b>Modificar</b></td> \n";
echo " </tr> \n";
echo "</tr> \n";
do {
echo "<tr> \n"; //para ver el cliente entero
?><form name="form1" method="post" action="datos_expedientes.php">
<?
echo "<td>"?>
<textarea cols="22" rows="1" name="fecha" readonly style="overflow:auto; border-width: 2px; font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; text-align:center;"><?php echo $row["fecha"];?></textarea>
</TD>
<? "</td> \n";
echo "<td>"?>
<textarea cols="70" rows="1" name="nombre" readonly style="overflow:auto; border-width: 2px; font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; text-align:center;"><?php echo $row["nombre"];?></textarea>
<? "</td> \n";
?>
<?
echo "<td>"?>
<input type="submit" name="Submit" value="Ver detalles" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; text-align:center;"></TD>
</form>
<? echo "<td>"?>
<form name="form" method="post" action="confirmacion_baja_exp.php">
<input name="expediente" type="hidden" value="<? echo $row["expediente"]; ?>">
<input type="submit" name="Submit2" value="Eliminar" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; text-align:center;"></TD>
</form>
<? echo "<td>"?>
<form name="form" method="post" action="modificar_expediente.php">
<input name="expediente" type="hidden" value="<? echo $row["expediente"]; ?>">
<input type="submit" name="Submit2" value="Modificar" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size: 11px;color: #000000; text-align:center;"></TD>
</form>
<?
"</td> \n"; ?>
<?
echo "</tr> \n";
} while ($row = mysql_fetch_array($result));
}
?>
</table>
</p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p><a href="cerrar_sesion.php">Cerrar sesión</a> </p>
</div>
</div>
</body>
</html>
La tabla es donde quiero que se me muestren...