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

在 PHP 中回顯 xml 會(huì)在瀏覽器中顯示空白頁(yè)面

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

問(wèn)題描述

我有一個(gè)類(lèi)似的問(wèn)題:https://superuser.com/questions/140242/why-my-browsers-display-xml-files-as-blank-pages?rq=1

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

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 中請(qǐng)求它.但是我收到這個(gè)錯(cuò)誤

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.

我認(rèn)為這可能是我在 Flash 中遇到的錯(cuò)誤的問(wèn)題.我只有一個(gè)根節(jié)點(diǎn),我認(rèn)為我的子節(jié)點(diǎn)沒(méi)有任何問(wèn)題.所以我唯一的假設(shè)是錯(cuò)誤是因?yàn)榭瞻醉?yè).

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 未顯示,因?yàn)闉g覽器會(huì)對(duì)其進(jìn)行解釋.

The XML is not displayed because the browser interpret it.

寫(xiě)作時(shí)

<table></table>

在您的 HTML 頁(yè)面中,您不會(huì)看到字符串

In your HTML page, you will not see the string

"<table><table>"

但是一張空桌子.

這與 XML 內(nèi)容相同.

This is the same things about XML content.

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

Another Stack overflow post got an answer to this HERE

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

Here I copy past the answer of mellamokb

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

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.

這是一個(gè)示例:xxxx

Here is a sample: xxxx

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

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

相關(guān)文檔推薦

Joining 2 tables in SELECT(MYSQL/PHP)(在 SELECT(MYSQL/PHP) 中加入 2 個(gè)表)
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ù)組自動(dòng)填充選擇框)
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(),名稱(chēng) ASC)
主站蜘蛛池模板: 日韩视频免费 | 亚洲欧美日韩久久久 | 欧美5区 | 国产精品久久久久久久久久了 | 精品一区精品二区 | 九九久久精品 | 国产a视频| 青青操av| 天天天久久久 | 99pao成人国产永久免费视频 | av片在线观看 | 黄色成人在线网站 | 欧美精品久久久久久久久老牛影院 | 91精品国产91久久久久游泳池 | 四色永久 | 亚洲国产精品久久久久婷婷老年 | 国产精品成人久久久久 | 国产精品视频专区 | 久久久久国产精品一区 | 欧美精品成人一区二区三区四区 | 免费视频一区二区三区在线观看 | 一级大黄 | 麻豆va| 国产一区在线免费观看视频 | 国产精品毛片一区二区三区 | 国产性网 | 在线观看视频你懂得 | 91成人影院 | 国产综合一区二区 | 国产美女视频 | 久久久久免费观看 | 天天拍天天操 | 中文在线一区 | 日本一二三区在线观看 | 亚洲天堂影院 | 国产在线一区二区 | 久久久久久av | 国产精品成人一区二区三区 | 最新国产在线 | 日韩av手机在线观看 | 91精品国产91久久久久久密臀 |