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

在 Flash 中讀取 php 生成的 XML?

Reading php generated XML in flash?(在 Flash 中讀取 php 生成的 XML?)
本文介紹了在 Flash 中讀取 php 生成的 XML?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

這是我們問題的第 1 部分 (在 Flash 中將動態生成的 XML 文件加載為 PHP).

Here is part 1 of our problem (Loading a dynamically generated XML file as PHP in Flash).

現在我們能夠讓 Flash 讀取 XML 文件,但是我們只能在實際 Flash 程序中測試(測試電影)時才能正確看到 Flash 渲染.但是,當我們在線上傳文件進行預覽時,Flash 無法正確呈現,缺少一些重要信息(縮略圖、標題、視頻等).

Now we were able to get Flash to read the XML file, but we can only see the Flash render correctly when tested(test movie) from the actual Flash program. However, when we upload our files online to preview the Flash does not render correctly, missing some vital information(thumbnails, titles, video etc..).

SWF 文件存在于域 1XML &PHP 文件都存在于域 2帶有嵌入代碼的 HTML 文件位于域 3

The SWF file exists on Domain 1 The XML & PHP file both exists on Domain 2 And the HTML file with the embed code lies on Domain 3

想知道這是否可能是跨域問題?我們在域 1 & 上有這些文件之一.2 我們也可以訪問,但是對于域 3,我們不能在那里有 crossdomain.xml 文件.

Wondering if this could be a crossdomain issue? We have one of those files in place on Domain 1 & 2 where we have access too, however for Domain 3 we can't have a crossdomain.xml file there.

$xml = new XMLWriter();
$xml->openMemory();
$xml->setIndent(true);
$xml->setIndentString("	");
$xml->startDocument();
$xml->startElement('data');
$xml->startElement('config');
    $xml->startElement('hex');
        $xml->writeCData('0x' . $widget_profile['background_color']);
    $xml->endElement();
    $xml->startElement('width');
        $xml->writeCData($widget_profile['width']);
    $xml->endElement();
    $xml->startElement('height');
        $xml->writeCData($widget_profile['height']);
    $xml->endElement();
    $xml->startElement('fullscreen');
        $xml->writeCData('false');
    $xml->endElement();
    $xml->startElement('special');
        $xml->writeCData('false');
    $xml->endElement();
    $xml->startElement('specialName');
        $xml->writeCData('Tools & Offers');
    $xml->endElement();
    $xml->startElement('specialLink');
        $xml->writeCData('XXXXXX');
    $xml->endElement();
    $xml->startElement('client');
        $xml->writeCData($widget_profile['site_url']);
    $xml->endElement();
$xml->endElement();

if (count($widget_content) > 0) {
    foreach ($widget_content as $tab) {
        $xml->startElement('tab');
        $xml->writeAttribute('id', $tab['tabname']);

        if (count($tab['video']) > 0) {
            foreach ($tab['video'] as $video) { 
                $video_sql = "select VID, flvdoname, title
                              from video 
                              where VID='" . $video . "'";

                $video_result = $howdini->query($video_sql);

                if ($video_result->rowCount() > 0) {
                    foreach ($video_result as $video_row) {

                        $video_row['flvdoname'] = substr($video_row['flvdoname'], 35, -4);

                        $xml->startElement('vid');
                        $xml->writeAttribute('flv', $video_row['flvdoname']);
                        $xml->writeAttribute('thumb', 'XXXXXXXXX' . $video_row['VID'] . '.jpg');
                        $xml->writeAttribute('title', $video_row['title']);
                        $xml->endElement();
                    }
                }

            }
        }

        $xml->endElement();
    }
}
$xml->endElement();
$xml->endDocument();
header('Content-Type: text/xml; charset=UTF-8');
echo $xml->flush();

預先感謝您的任何答案!我已經包含了更改,現在 Firebug 可以看到 XML.現在它只是看不到 swf 文件,但我可以在頁面的其他部分看到 swf 文件.

Thanks in advance for any answers! I have included the change and now Firebug sees the XML. Now it's just not seeing the swf file but I can see the swf file in other parts of the page.

推薦答案

不是一個完整的解決方案,而只是一個數據點(因為編碼問題很糟糕).當我通過靜態文件和 PHP 文件下載你的 XML 并比較它們時,我得到了以下結果

Not a full solution, but just a data point (because encoding issues suck). When I downloaded your XML via the static file and PHP file and diffed them, I got the following results

% diff php.xml static.xml
1c1
< <?xml version="1.0"?>
---
> ???<?xml version="1.0"?>
10a11
>
19a21
>

您的靜態文件的開頭有一個額外的非 ASCII"字符.

Your static file has an extra "non-ASCII" character at the start of it.

我猜你的靜態 XML 文件有一個 UTF-8 BOM,而 PHP 生成的文件沒有,而且你的 Flash 電影需要一個 UTF-8 文件.我會嘗試使用您的 PHP XML 文件生成 BOM 并查看它幫助或擺弄服務器的編碼設置.

My guess is your static XML file has a UTF-8 BOM that PHP generated file doesn't, and that your flash movie is expecting a UTF-8 file. I'd try generating a BOM with your PHP XML file and seeing it it helps, or fiddling with your server's encoding settings.

嘗試更改您的 PHP,使其輸出以下標題(與嵌入電影的網頁匹配).

Try changing you PHP so it outputs the following header (matching the web page the movie is embedded in).

header('Content-Type: text/html; charset=UTF-8') 

這篇關于在 Flash 中讀取 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)
主站蜘蛛池模板: 在线观看成年视频 | 国产精品久久久久久久久久 | 日韩av一二三区 | 国产一级电影在线观看 | 91精品国产91久久久久久 | 无码日韩精品一区二区免费 | 国产精品1区2区3区 欧美 中文字幕 | 99影视| 午夜性色a√在线视频观看9 | 国产精品成人一区二区三区夜夜夜 | 精品免费国产一区二区三区 | www.操com| 91免费在线看 | 国产激情精品 | 国产一区二区黑人欧美xxxx | 亚州成人| 午夜电影福利 | 国产精品视频一二三区 | 亚洲天堂久久新 | 久久国产精品一区 | 999国产精品视频 | 一区二区三区在线免费观看视频 | 免费一区二区 | 国产精品美女久久久久aⅴ国产馆 | 九九综合| 亚洲成人av一区二区 | 在线小视频 | 国产成人综合网 | 国产精品视频网 | 91精品国产一区二区三区 | 国产日韩欧美综合 | 欧美日韩午夜精品 | 亚洲欧美aⅴ| 国产在线视频在线观看 | 一级做受毛片免费大片 | 日韩在线精品强乱中文字幕 | 欧美一区二区网站 | 国产美女网站 | 中文字幕免费中文 | 日本福利一区 | 北条麻妃一区二区三区在线视频 |