PHP内容类型MIME和HTML标签

发布于 2025-02-03 02:49:55 字数 363 浏览 2 评论 0原文

我正在使用PHP并发送带有content-type:mime的标头,因此我可以使用ReadFile命令在Navigator上打印图像。

我的问题是:有没有办法在显示图像的窗口上添加HTML?我想在读取图像和显示图像的选项卡窗口上添加标题和一个favicon。

一旦添加HTML代码,一切都停止工作。

这是我的代码:

$ImageRoute = "images/photo.png";
$MyImage = getimagesize($ImageRoute);
header("Content-type: {$MyImage['mime']}");
readfile($ImageRoute);

预先感谢:)

I'm using PHP and sending a header with Content-type:mime so I can print an image on the navigator with readfile command.

My question is: Is there a way to add html on the window that displays the image? I want to add a title and a favicon on the tab window where the image is read and displayed.

As soon as I add html code everything stops working.

This is my code:

$ImageRoute = "images/photo.png";
$MyImage = getimagesize($ImageRoute);
header("Content-type: {$MyImage['mime']}");
readfile($ImageRoute);

Thanks in advance :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文