[英]Images display directory in php file
我有一個維護頁面503.php。 我試圖顯示要顯示的圖像,但沒有顯示。 我嘗試了path和html img方式,但是沒有用。 下面是代碼,還有誰能幫助我解釋如何在php文件中包含圖像? 非常感謝
我的網站圖片目錄是這樣的:
在服務器上:pulic_html / website / images
在本地:網站/圖片
php文件目錄:website / 503.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
<?php
header("HTTP/1.1 503 Service Temporarily Unavailable");
header("Status: 503 Service Temporarily Unavailable");
header("Retry-After: 3600");
?>
</title>
<style type="text/css">
body {
background-image: url("../images/black-brick-wall-texture.jpg");
}
</style>
</head>
<body>
<div>
<div>
<p style="text-alignment: middle"><img src="../images/still-under-construction.gif" width="306" height="350" alt="dang duoc bao tri" />" </p>
</div>
<div style="text-align: center; font-size: 24px; color: #FFF;">
<p>BSeveryday.vn hiện <span style="color: #F00">under maintenance</span>, please come back later <span style="color: #F00">30p - 2 giở</span>.</p>
<p>if you have any problem, please send me a message at: <span style="color: #00F">vandekhac@bseveryday.vn</span></p>
</div>
</div>
<p><img src="../images/under_construction.gif" alt="under maintenance" width="350" height="299" align="right" />" </p>
</body>
</html>
在網站根目錄的.htaccess文件中,在RewriteRule行之前插入以下行:
RewriteCond %{REQUEST_FILENAME} !.(gif|jpe?g|png)$
您可能需要將css或js添加到該文件類型列表中,具體取決於保存頁面的需求。
它可以解決您的問題。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.