在 Internet Explorer (10) 中加载图像时出现问题,而在 chrome 和 firefox 中则正常 当 username 参数为希伯来语(rtl 语言)时 css 和 html 出现问题:
background: 0 url('php/ajax/ajax-user-image-read.php?username=רועי') no-repeat';
img src="php/ajax/ajax-user-image-read.php?username=רועי" alt=""
英语都可以
background: 0 url('php/ajax/ajax-user-image-read.php?username=roee') no-repeat';
img src="php/ajax/ajax-user-image-read.php?username=roee" alt=""
当希伯来语我收到用户名参数时????在服务器端。
我的 html 页面有 meta charset="UTF-8"
并且所有其他希伯来语工作正常。
我不认为 php 代码在这里有帮助,因为它收到问号而不是有效数据,但这里是:
<?php
session_start();
require_once '../gw-database.php';
require_once '../gw-functions/gw-functions-user.php';
if (isset($_SESSION['username'])) {
if (isset($_GET['username'])) {
if (!empty($_GET['username'])) {
$username = ('current' === $_GET['username']) ? $_SESSION['username'] : $_GET['username'] ;
$image = userImageGet($username);
if (false !== $image) {
header('Content-Type: '.$image['type']);
echo $image['image'];
}
else {
logRunTimeMessage($_SESSION['username'], 'server', $error, 'In file '.strrchr(__FILE__, "\\").' at line '.__LINE__.' - Error fail to get user image', time());
}
}
}
}
最佳答案
示例:
$username = 'רוע';
/*... some code ...*/
src="php/ajax/ajax-user-image-read.php?username=<?php echo urlencode($username);?>" alt=""
关于css - 在 "Internet Explorer"中加载图像 - 服务器的参数是 "????",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20957263/