List Info

Thread: Proxy Script




Proxy Script
user name
2006-11-03 13:26:16
Eric,

An example of a proxy script looks like the following in
php:



<?
/////////////////////////////////////
//Get Variable from URL String//
////////////////////////////////////
function getPOSTorGETValue($key)
{
    $value = $_POST[$key];
    if (!isset($value))
    {    
        $value = $_GET[$key];
    }        
    return $value;
}



$url     = getPOSTorGETValue("url");
readfile($url);
?> 

The example above is the most flexible because it will allow
you to
dynamically call any feed if needed through pulling the
variable "url" from
the url string. But if you just need to call one static
external file that
wont  change you don't need the getPOSTorGETValue method.
Just make the $url
variable equal to the static xml address. ie:

<?
$url  
="http://newsrss.bbc.co.uk/rss/newson
line_world_edition/americas/rss.xml";
readfile($url);
?>

Load this onto the server then edit your AS to call your
proxy script and
load your published flash onto the same server:
var proxy:String       = "http://yourdomain.com/proxy.php?url=yourfeed.xml"
yourxmlobject.load(proxy);

Ultimately, PHP is just reading the file as the proxy and
making flash think
the data is really coming from the same domain.

-Lamar





_______________________________________________
FlashCodersNY mailing list
FlashCodersNYflashcodersny.org
http://mail.flashcodersny.org/mail
man/listinfo/flashcodersny_flashcodersny.org
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )