kiko
V2EX  ›  问与答

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

  •  
  •   kiko · Aug 25, 2017 · 2693 views
    This topic created in 3361 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
    fahai
    Aug 25, 2017❤️1
    1
    <?php

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