PHP - 无法显示src来自数据库的图像

<i><img src="<?php echo $path ;?>" alt="<?php echo $path;?>" style="width:250px;height:250px;"></i>

Here $path is an absolute path to that image on a separate drive(E:/)

As you are running your script from the server, cause a PHP script. Lets say you have your script in the directory named myFirstScript, inside this folder you have a file named script.php where you wrote your this code.

<i><img src="<?php echo $path ;?>" alt="<?php echo $path;?>" style="width:250px;height:250px;"></i>

So the question is what is the $path here? OK, don't worry, because you are using this $path to the src of an image so it is a image file. And this image file must in the same directory named myFirstScript. Say you have the image named image.jpg. so your path is: $path = 'image.jpg';

Example:

<?php $path = 'image.jpg';?>
<i><img src="<?php echo $path ;?>" alt="<?php echo $path;?>" style="width:250px;height:250px;"></i>

Real time Example:

<?php $path = 'http://placehold.it/350x150';?>
<i><img src="<?php echo $path ;?>" alt="<?php echo $path;?>" style="width:250px;height:250px;"></i>