我有这段代码:
<?php
include 'connectDb.php';
header("Cache-Control: no-cache, must-revalidate");
header("Expires: Mon, 26 Jul 2997 05:00:00 GMT");
header("Content-Type: text/html; charset=utf-8");
echo file_get_contents('li.gif');
sleep(3);
$id = $_GET['id'];
$row = $conn->query('SELECT picture,img FROM contacts WHERE id=\''.$id.'\' LIMIT 1');
$result = $row->fetch_assoc();
if(!empty($result['picture'])){
header("Content-type: image/".$result['img']);
echo($result['picture']);
}
我正在尝试做什么:显示li.gif
,直到mysql加载了echo($result['picture'])
。
有没有办法在没有javascript的情况下执行此操作?