我需要幫助才能從我的public_html目錄中的目錄圖像顯示我的圖像。它已經上傳了,但是當我運行下面的php腳本時它不會出現。請有誰知道爲什麼?顯示目錄中的圖像
<?php
include_once("connect.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>Untitled Document</title>
</head>
<body>
<?php
//Retrieves data from MySQL
$data = mysql_query("SELECT * FROM authors") or die(mysql_error());
//Puts it into an array
while($info = mysql_fetch_array($data))
{
Echo "<img src=http://giveaway.comli.com/public_html/images/".$info['photo']."> <br>";
Echo "<b>Name:</b> ".$info['name'] . "<br> ";
Echo "<b>Title:</b> ".$info['title'] . " <br>";
Echo "<b>Phone:</b> ".$info['description'] . " <br>";
Echo "<b><a href=".$info['url'] . ">Link</a><br>";
Echo "<b>Country:</b> ".$info['country'] . " <hr>";
}
?>
</body>
</html>
你是對的..你可以看看在該文件夾.. HTTP圖片:// giveaway.comli.com/images/ – SERPRO
與此無關:( – Kelvin
@Kelvin then'$ info ['photo']'不是你期望的那樣。查看你的頁面源代碼,我可以直接鏈接到' http:// giveaway.comli.com/images/LS_The%20Beginning.jpg',所以你需要在'/ images'後面提供正確的文件名 –