Php Sesssion Does not pull image

Asked

Viewed 35 times

0

 <p><img src="<?php echo $_SESSION['picture']; ?>" alt="" 
       style="width:50px;height:50px;"></p>
<p>Bem vindo  <?php echo $_SESSION['username']; ?></p> 
<p>Esta Area é segura.</p>
<p><?php echo date('Y m d H:i:s', $_SESSION['time']); ?><p
<p><a href="dashboard.php">Dashboard</a></p>
<a href="logout.php">Sair</a>

Below the session draws the USER name correctly when logged in, but the image is not loaded.

<p><img src="<?php echo $_SESSION['picture']; ?>" alt="" 
       style="width:50px;height:50px;"></p>
<p>Bem vindo  <?php echo $_SESSION['username']; ?></p> 
<p>Esta Area é segura.</p>
<p><?php echo date('Y m d H:i:s', $_SESSION['time']); ?><p
<p><a href="dashboard.php">Dashboard</a></p>
<a href="logout.php">Sair</a>
  • Which line assigns the image to the session variable picture?

  • How the session variable is defined picture? Could you give an example?

  • $sql = mysql_query("SELECT * FROM usuarios ORDER BY name"); // Displays the information of each user while ($usuario = mysql_fetch_object($sql)) { // Display photo echo "<img src='photos/". $usuario->photo." ' alt='Display photo' /><br />";

  • There in your code the only error is HTML in a tag p that was opened without the proper closure, which does not cause any error, see ..... time']); ? ><p <p><a href="Dashboard.php. In addition, the comment of Magichat is in the sense of assigning a value to Session and not forgetting that at the beginning of the file, first line of php should be session_start(); without which no Session will work

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.