Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 在变量中存储图像路径_Php_Database_Image_Variables_Profile - Fatal编程技术网

Php 在变量中存储图像路径

Php 在变量中存储图像路径,php,database,image,variables,profile,Php,Database,Image,Variables,Profile,我有一个存储用户图像路径的数据库,如images/profile/950baasfaa88c.jpg。现在,当我试着把它放进一个变量中,并用图像标签包围它时,只会出现一个空白图像,而不是图像本身 $profile_picture = $row['profile_image']; <img src="'.$profile_picture.'" width=50 height=50 /> $profile\u picture=$row['profile\u image'];

我有一个存储用户图像路径的数据库,如images/profile/950baasfaa88c.jpg。现在,当我试着把它放进一个变量中,并用图像标签包围它时,只会出现一个空白图像,而不是图像本身

    $profile_picture = $row['profile_image'];

<img src="'.$profile_picture.'" width=50 height=50 />
$profile\u picture=$row['profile\u image'];
您还没有回显PHP

<img src="'.$profile_picture.'" width=50 height=50 />

应该是

<img src="<?= $profile_picture ?>" width=50 height=50 />
“宽度=50高度=50/>

您需要回显该值

<img src="<?php echo $row['profile_image']; ?>" width=50 height=50 />
“宽度=50高度=50/>

呈现页面上的“查看源代码”是什么样子?(从浏览器)您确定相应的图像放置在正确的位置吗?当找不到标记所指的图像时,浏览器会显示空白图像。在询问此类问题时,请尝试提供更多详细信息。是否可以通过获取页面源发布服务器返回的内容