Heyas。我有一个我正在处理的Flash应用程序,可以嵌入其他网站(如YouTube视频),但我们想知道用户正在查看该网站的网站。有没有办法告诉用户正在查看的应用程序嵌入的网站?
原始应用程序是用flash / actionscript和php在服务器上运行的,如果有帮助的话。感谢。
答案 0 :(得分:1)
您只需通过php检索HTTP referrer header,将其存储在某处,而不是为您的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>