dongnao2582 2010-12-05 22:46
浏览 158

为什么在将<?xml version =“1.0”encoding =“utf-8”?>添加到网页时无法进行托管?

I am developing a simple webpage at hostgator.com. I have the standard headers, but when I add the following line:

<?xml version="1.0" encoding="utf-8"?> 

the page does not work. I would like why.

This is the full header:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1 /DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es"> 
... rest of code ...

The server returns me a blank page


Issue solved: The PHP short tags was open.

  • 写回答

1条回答 默认 最新

  • dpojoxa5613 2010-12-05 23:06
    关注

    My best guess is that:

    … so the server is trying to process the XML declaration as PHP code. Normally I'd expect an error message, but perhaps there is a PHP setting in play that suppresses errors to the client to avoid leaking data that could be potentially useful to someone trying a security exploit.

    Just remove it.

    • UTF-8 is the default
    • version 1.0 is the default
    • It is optional in the spec
    • Given a text/html content-type, an XML prolog will trigger IE6's quirks mode

    The latter is undesirable. The former all mean it makes no difference.

    评论

报告相同问题?

悬赏问题

  • ¥15 求帮我调试一下freefem代码
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗
  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图