久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

在 PHP 中回顯 xml 會在瀏覽器中顯示空白頁面

Echoing xml in PHP gives blank pages in Browser(在 PHP 中回顯 xml 會在瀏覽器中顯示空白頁面)
本文介紹了在 PHP 中回顯 xml 會在瀏覽器中顯示空白頁面的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我有一個類似的問題:https://superuser.com/questions/140242/why-my-browsers-display-xml-files-as-blank-pages?rq=1

我在瀏覽器中沒有看到我的 xml,而只是一個空白頁面.我只檢查了 Chrome 和 firefox,但兩者都發生了.不同之處在于我從 MySQL 獲取數據并對其進行響應.所以文件擴展名是 .php 而不是 .xml

I don't see my xml in my browser, but just a blank page. I only checked Chrome and firefox, but it's happening in both. The difference is that I'm getting data from MySQL and echoing it. So the file extension is .php and not .xml

$row = mysqli_fetch_assoc($resource);
echo "<?xml version="1.0" encoding="UTF-8"?>
";
echo "<video>
";
echo "<path>" . $row['path'] . "</path>
";
echo "</video>
";

當我轉到 url 時看到一個空白頁.但是當我查看源代碼"時,我看到了 xml 樹.

I see a blank page when I go to the url. But when I "View Source", I see the xml tree.

<video>
 <path>URLtoVideo.mp4</path>
</video>

我的主要目標是獲取 xml 數據并使用 URLRequest() 在 Flash 中請求它.但是我收到這個錯誤

My main goal is to grab the xml data and request it in Flash using URLRequest(). But I get this error

TypeError: Error #1088: The markup in the document following the root element must be    well-formed.

我認為這可能是我在 Flash 中遇到的錯誤的問題.我只有一個根節點,我認為我的子節點沒有任何問題.所以我唯一的假設是錯誤是因為空白頁.

I think this may be the problem to the error I get in Flash. I only have one root node, and I don't think I have any problems with the child nodes. So my only assumption is that the error occurs because of the blank page.

推薦答案

XML 未顯示,因為瀏覽器會對其進行解釋.

The XML is not displayed because the browser interpret it.

寫作時

<table></table>

在您的 HTML 頁面中,您不會看到字符串

In your HTML page, you will not see the string

"<table><table>"

但是一張空桌子.

這與 XML 內容相同.

This is the same things about XML content.

另一個堆棧溢出帖子得到了這個答案這里

Another Stack overflow post got an answer to this HERE

這里我復制了mellamokb的回答

Here I copy past the answer of mellamokb

簡單的解決方案是嵌入元素內部,這將保留格式和尖括號.我也有刪除了 style="border:none;" 的邊框這使得 textarea看不見.

Simple solution is to embed inside of a element, which will preserve both the formatting and the angle brackets. I have also removed the border with style="border:none;" which makes the textarea invisible.

這是一個示例:xxxx

Here is a sample: xxxx

這篇關于在 PHP 中回顯 xml 會在瀏覽器中顯示空白頁面的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個表)
How to make lt;option selected=quot;selectedquot;gt; set by MySQL and PHP?(如何使lt;option selected=“selectedgt;由 MySQL 和 PHP 設置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數組自動填充選擇框)
PHP SQL SELECT where like search item with multiple words(PHP SQL SELECT where like search item with multiple words)
json_encode produce JSON_ERROR_UTF8 from MSSQL-SELECT(json_encode 從 MSSQL-SELECT 產生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 欧美日韩三级在线观看 | 精品一区国产 | 久久久在线视频 | 久久久久中文字幕 | 国产精品爱久久久久久久 | 国产精品一区久久久 | 天天操天天天干 | 亚洲精品一区二区在线观看 | 视频在线观看一区二区 | 亚洲精品乱码久久久久久9色 | 超碰最新在线 | 久在线观看 | av手机免费在线观看 | 国产成人黄色 | 欧美亚洲一区二区三区 | 久久久久久久久久久久久9999 | 亚洲91精品| 国产免费一区二区三区 | 日韩av免费看 | 日本高清视频在线播放 | 成人国产午夜在线观看 | 久久久久国产 | 欧美一区二区三区四区五区无卡码 | 国产 日韩 欧美 在线 | 日韩欧美一区二区三区免费观看 | 午夜免费网站 | 国产欧美日韩一区二区三区在线 | 久久蜜桃资源一区二区老牛 | 成年人视频在线免费观看 | 天天综合日日夜夜 | 国产精品视屏 | 日本五月婷婷 | 成人午夜免费福利视频 | 91精品国产一区二区三区动漫 | 日韩精品一区二区三区中文字幕 | 精品国产一区二区三区久久 | 国产综合视频 | 午夜噜噜噜 | 波波电影院一区二区三区 | 免费在线成人 | 日韩在线观看网站 |