0
The result of this error page:
Notice: Undefined variable: name in C: xampp htdocs Techphp profile.php on line 57, line 58, line 59 and line 60,
Which are the lines where the user profile data is.
Which I don’t understand why this is working. Is it not connected?
<?php
mysql_connect("localhost", "root", "angola") or die("cannot connect");
mysql_select_db("login_senha");
session_start();
$login = $_SESSION['login_usuario'];
$login = $_SESSION['login_usuario']=$login;
$sql = mysql_query( "SELECT * FROM usuario WHERE login='$login'");
while($linha= mysql_fetch_array($sql)){
$nome=$linha['nome'];
$email=$linha['email'];
$idade=$linha['idade'];
$cidade=$linha['cidade'] ;
$foto=$linha['foto'] ;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="/Techphp/css/estilo.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="/Techphp/css/estilo.css"/>
<title>Untitled Document</title>
</head>
<body>
<div class="container">
<div class="menu">
<ul>
<li>
<a href="index.php">Voltar</a>
</li>
<li>
<a href="#">Administração</a>
</li>
</ul>
</div>
<div class="perfil">
<img src="fotos/<?php echo $foto?>" alt="imagem de perfil" title="imagem de perfil" />
</div>
<div class="dados">
<p>Nome</p><p><?php echo $nome?></p>
<p>Email</p><p><?php echo $email?></p>
<p>idade</p><p>40<?php echo $idade?></p>
<p>Cidade</p><p><?php echo $cidade?></p>
</div>
</div>
</body>
</html>
He managed to solve Bruno?
– Sr. André Baill