sono_advertising wrote:Hi ablaye,
Yes thank you I am aware that there needs to be a reference file in order to link the username with the flashpaper file, but I do not know how to write the code that impliments what I am after.
As a mentioned I am a newbie and would appreciate some help from someone who could point me in the right direction whether it be a tutorial or a similar solution.
Here's a snippet that prints out the code for different flashfiles based on the variable "id".
customer1 gets test1.swf, customer2 gets test2.swf and everyone else gets test3.swf
However, there is one drawback: You can still access the swf directly. This could only be prevented with a htaccess / php login or with an actionscript/php check. You might also want to check out LocalConnection(); to retrieve the domain name via actionscript.
aerodromoi
Code: Select all
<?php
$id = $_GET['id'];
function flashfunction($x,$y,$fpath){
echo "<object type="application/x-shockwave-flash" data="".$fpath."" width="".$x."" height="".$y."">
<param name="movie" value="".$fpath."" />
<img src="img/noflash.gif" alt="no flash enabled" /></object><br />";
}
$flashfiles = array(
array("250","120","test1.swf"),
array("322","214","test2.swf"),
array("331","220","test3.swf")
);
switch($id){
case "customer1": $file = 0; break;
case "customer2": $file = 1; break;
default: $file = 2;
}
flashfunction($flashfiles[$file][0],$flashfiles[$file][1],$flashfiles[$file][2]);
?>