我试图从MySQL数据库中检索图像。我得到这个错误:从数据库中获取图像
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\empinfo.php:13) in C:\xampp\htdocs\empinfo.php on line 39
<?php
header("content_type:" . $row["image_type"]);
?>
<?php echo $info['image']; ?></td>
</tr>
</table>
<?php } ?>
请问*为什么*您为什么*将实际图像存储在数据库中,而不是路径?您的代码无法正常工作,因为您将内容类型设置为图像,然后使用HTML – andy
实际上:您的错误与您在输出内容之后使用'header' *的事实有关:https:// stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php但即使修复它也不会工作 – andy