Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 查找flash应用程序的嵌入站点_Php_Flash_Embed - Fatal编程技术网

Php 查找flash应用程序的嵌入站点

Php 查找flash应用程序的嵌入站点,php,flash,embed,Php,Flash,Embed,海亚斯。我有一个我正在开发的flash应用程序,可以嵌入到其他网站(如YouTube视频),但我们想知道用户在哪个网站上查看该网站。是否有任何方法可以告诉用户在哪个网站上观看应用程序 如果有帮助的话,最初的应用程序是用flash/actionscript和运行在服务器上的php编写的。谢谢。您只需通过php检索,将其存储在某个地方,然后提供您的flash内容 <?php // served from http://yoursite.net/your_flash.php //r

海亚斯。我有一个我正在开发的flash应用程序,可以嵌入到其他网站(如YouTube视频),但我们想知道用户在哪个网站上查看该网站。是否有任何方法可以告诉用户在哪个网站上观看应用程序


如果有帮助的话,最初的应用程序是用flash/actionscript和运行在服务器上的php编写的。谢谢。

您只需通过php检索,将其存储在某个地方,然后提供您的flash内容

 <?php

 // served from  http://yoursite.net/your_flash.php


 //read the referer header
 $referer_url = (isset($_SERVER['HTTP_REFERER']))?  $_SERVER['HTTP_REFERER'] : ""; 
 //store it somewhere...

 //read the swf file
 $swf=file_get_contents('flash_app.swf');
 //spit the flash content out with the proper header
 header('Content-type: application/x-shockwave-flash');
 echo $swf;
 ?>

嵌入代码,由第三方网站在其HTML中粘贴:

<object width="550" height="400">
 <embed src="http://yoursite.net/your_flash.php" width="550" height="400">
 </embed>
</object>


如果flash嵌入到其他人的博客中,我无法运行HTTP\u REFERER。他们只需要接受提供给他们的嵌入式代码。我不能在他们的服务器上运行任何东西。@justJon,我刚才发布的代码是由分发swf文件的服务器执行的,而不是由嵌入您的内容的第三方执行的。@。对于浏览器来说,由于标题的原因,这看起来像本机flash。将其命名为myflash.php并将其交给用户以供包含。或者叫它myflash.swf并使用mod_rewrite。@然后什么时候调用该代码?用户具有直接嵌入到swf文件的权限。嵌入会调用通过swf的php文件吗?@justJon,没错!这样,用户就可以在不知情的情况下访问您的站点:)