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

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

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

問題描述

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

我在瀏覽器中沒有看到我的 xml,而只是一個空白頁面.我只檢查了 Chrome 和 firefox,但兩者都發(fā)生了.不同之處在于我從 MySQL 獲取數(shù)據(jù)并對其進行響應(yīng).所以文件擴展名是 .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>
";

當(dāng)我轉(zhuǎn)到 url 時看到一個空白頁.但是當(dāng)我查看源代碼"時,我看到了 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>

我的主要目標(biāo)是獲取 xml 數(shù)據(jù)并使用 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 中遇到的錯誤的問題.我只有一個根節(jié)點,我認為我的子節(jié)點沒有任何問題.所以我唯一的假設(shè)是錯誤是因為空白頁.

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 內(nèi)容相同.

This is the same things about XML content.

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

Another Stack overflow post got an answer to this HERE

這里我復(fù)制了mellamokb的回答

Here I copy past the answer of mellamokb

簡單的解決方案是嵌入元素內(nèi)部,這將保留格式和尖括號.我也有刪除了 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

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

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

相關(guān)文檔推薦

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 設(shè)置?)
Auto populate a select box using an array in PHP(使用 PHP 中的數(shù)組自動填充選擇框)
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 產(chǎn)生 JSON_ERROR_UTF8)
MySQL ORDER BY rand(), name ASC(MySQL ORDER BY rand(),名稱 ASC)
主站蜘蛛池模板: 日韩三区在线 | 久久福利电影 | 久久精品免费观看 | 看av片网站 | 国产福利91精品一区二区三区 | 日韩无 | 国产精品日韩欧美一区二区三区 | 在线中文视频 | 怡红院成人在线视频 | 日韩免 | 欧美国产日韩在线观看成人 | www.日韩欧美 | h片在线播放 | 欧美激情一区二区 | 国产精品入口久久 | 亚洲精品二三区 | 一区二区三区欧美大片 | 欧美一区二区三区在线观看视频 | 久久精品久久久久久 | 粉嫩一区二区三区性色av | 日本久久久久久久久 | 国产精彩视频 | 精品久久久久久久久久久 | 免费观看的av | 一区二区国产精品 | 超碰人人艹 | 999久久久免费精品国产 | 精品一区二区三区在线播放 | 91精品久久久久久久久久入口 | 国产精品久久久久久久久免费高清 | 一级做a爰片性色毛片视频停止 | 国产成人精品一区二区三区四区 | 国产日韩欧美中文字幕 | 精品一区二区三区四区五区 | 中文字幕欧美一区二区 | 久久精品91久久久久久再现 | 国产乱码精品一品二品 | 国产亚洲精品久久久久动 | 亚洲自拍偷拍av | 亚洲人在线观看视频 | 一区二区日本 |