<?php

$User_ID=$_SESSION['UserId'];
$query = mysql_query("SELECT * FROM Users WHERE UserId='$User_ID'");
$row = mysql_fetch_array($query);
$filename=$row['PicUrl'];
if(isset($_SESSION["UserName"])){?>

        <img src="images/<?php echo $filename?>"  align="left"width="50px" height="50px"/> <?php echo $_SESSION["UserName"];
echo"<li><a href='logout.php'>Click here to Logout.</a></li>";
echo"<li><a href='user_update.php'>edit your account detail</li>";
}

?>

if pic url is empty then hide img scr

Recommended Answers

All 2 Replies

if(!empty($filename)){echo '<img src="images/'.$filename.'"  align="left"width="50px" height="50px"/>';}

thnx alot

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.