我已经使用此代码将图像从数据库访问到网页。但调试后图像标签中没有图像。
此代码打印正确的路径....但无法在图像标签中返回正确的图像...
echo $_SESSION['user_image'];
如何在图像标签中获取图像?请帮助我。
while($row = mysql_fetch_assoc($result))
{
$_SESSION['user_id'] = $row['user_id'];
$_SESSION['user_name'] = $row['user_name'];
$_SESSION['user_level'] = $row['user_level'];
//$_SESSION['user_image'] = $row['image'];
$image=$row['image'];
$user_image= trim('C:/xampp/htdocs/source/img/' . $image);
//$user_image = imagecreatefromstring($user_image);
$_SESSION['user_image']=$user_image;
echo $_SESSION['user_image'];
}
echo "<img src='".$row['image']."'>";
echo 'Welcome, <img src= "'.$_SESSION['user_image'].'" alt="" width="50"
height="40" /> ' . $_SESSION['user_name'] . '. <br /><a href="index.php">Proceed to
the forum overview</a>.';