Good afternoon, I'm a beginner in php and would need a help.
I have this file (index.php) where I want to display the user name logged on the screen after login, but this gives an indefinite variable error ($ _SESSION).
Note: disregard the last div = main line
$usuario = $_SESSION['usuarioSession'];
$senha = $_SESSION['senhaSession'];
$sql = mysql_query("SELECT * FROM syslogin WHERE usuario = '$usuario' AND senha = '$senha'");
while($linha = mysql_fetch_array($sql)){
$usuario = $linha['usuario'];
$senha = $linha['senha'];
}
?>
<div class="bemvindo">Bem Vindo! <strong><?php echo $usuario;?></strong> | Hoje é: <?php echo date('d/m/Y');?></div><!--Bem Vindo-->
<div id="principal">
<h3>Bem Vindo(a).</h3><br /><br />
<img src="css/img/logo1.jpg" alt="logo" />
</div> <!-- Fim da div#principal -->
<?php include('includes/fimerodape.php'); ?>
Please, where am I going wrong?