kiko
V2EX  ›  问与答

显示随机图片的问题: html 里面怎么把 PHP 文件作为一个图像文件来读取

  •  
  •   kiko · Aug 25, 2017 · 2456 views
    This topic created in 3216 days ago, the information mentioned may be changed or developed.
    我想<img src="bg.php">来显示图片,

    bg.php 我想读取已知的 http://www.example.com/1.jpg (可能是随机的)这样的文件

    bg.php 我可以怎么写,让这个<img src="bg.php">代码可以正常显示我想要的图片呢
    3 replies    2017-08-25 17:51:36 +08:00
    fahai
        1
    fahai  
       Aug 25, 2017   ❤️ 1
    <?php

    header("Location: 图片地址");
    b821025551b
        2
    b821025551b  
       Aug 25, 2017   ❤️ 1
    header("Content-type: image/jpg");
    kiko
        3
    kiko  
    OP
       Aug 25, 2017
    谢谢楼上两位!
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3927 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 04:17 · PVG 12:17 · LAX 21:17 · JFK 00:17
    ♥ Do have faith in what you're doing.