先介绍<img href="./test.php?test=1" />是符合xhtml规范的。
但是 有的时候对于不支持cookie的浏览器访问使用session的网站,
会产生 <img href="./test.php?test=1&PHPSESSID=fdsafdsafdsafds" /> 这个是不符合xhtml规范的。需要把里面的&换成&
解决方法有几个。
编辑 php.ini
arg_separator.output = "&"
Apache 配置
php_value arg_separator.output &
对于虚拟主机最简单的是
在每个php文件上面从新定义arg_separator.output
<?php ini_set(‘arg_separator.output’,’&’); ?>
参考:http://www.w3.org/QA/2005/04/php-session