您好我有一些PHP腳本,顯示了基於客戶的IP國旗顯示PHP頁面的圖像
flags.php
<?
require 'ip.php';
$ip=$_SERVER['REMOTE_ADDR'];
$two_letter_country_code=ip_info("$ip", "Country Code");
//header('Content-type: image/gif');
$file_to_check="flags/$two_letter_country_code.gif";
if (file_exists($file_to_check)){
print "<img src=$file_to_check width=30 height=15><br>";
}
else{
print "<img src=flags/noflag.gif width=30 height=15><br>";
}
然後在我的索引頁,我沒有
index.php
<img src="http://ip.dxing.si/flags/flags.php">
當我單獨運行腳本時,它顯示標誌很好,但是當我想在另一個頁面上顯示它時,它不起作用。
就包括你的'flags.php'在'index.php',你應該罰款 – Daan