No problem, Paul.

I'm glad you sorted it out!


Cheers
Juan Pablo Califano

2010/11/26 Paul Steven <paul_ste...@btinternet.com>

> Awesome! Thank you Juan - that worked perfectly! I did get caught out for a
> while by not adding
>
> require_once "HttpClient.class.php"
>
> But once I realised I had omitted this, it worked a treat.
>
> Many thanks!
>
> Paul
>
>
>
> On 26 Nov 2010, at 02:25, Juan Pablo Califano <
> califa010.flashcod...@gmail.com> wrote:
>
> > I think the easiest option would be creating some sort of proxy in php,
> if
> > that's what's available to you on your server.
> >
> > The only potential problem is (your) server configuration. Sometimes,
> > external connections are not allowed, so calling functions like
> > file_get_contents() with an external url won't work.
> >
> > Also, it seems you need to POST your data, so it's a bit more complex but
> > not too much.
> >
> > A week ago or so I had a similar scenario. Though there was a crossdomain
> > allowing connections from the production server, there was no crossdomain
> > policy for the staging and dev environments. I also had to receive and
> send
> > cookies, so I googled a bit and found this class, which was easy to use
> and
> > worked nicely for me
> >
> > http://scripts.incutio.com/httpclient/
> >
> > Some sample code for a POST request (taken from the project I worked on,
> > just slightly modified) :
> >
> >        $client = new HttpClient("theotherserver.com");
> >    //  this will print out useful info, enable it when debugging!
> >    // $client->setDebug(true);
> >
> >        $client->post("/theservice.ashx", array(
> > 'first_var'    => 'foo',
> > 'second_var'    => 'bar',
> >                        'etc'           => 'blah',
> > ));
> >
> >                //  check status code here...
> > if($client->getStatus() == 200) {
> >                        //  a string with the server's response
> > $response_raw_data = $client->getContent();
> > }
> >
> > Maybe you can give this a try, it's very simple to install and use (just
> > download and include the php file; you can find more code examples in the
> > site).
> >
> > Again, in some configurations this code could not work; if any external
> > connection in your server is rejected, then there's not much you can do.
> But
> > even in the worst case, maybe you could find a third server that you have
> > control over and that allows you to open external connections, so you
> could
> > add a crossdomain there and run the php http client over there. Then,
> > instead of talking directly to the ad server or a local php script, you'd
> > call a third server that you control, which will proxy the communication
> > between flash and the ad server.
> >
> > Hope it makes sense!
> >
> > Cheers
> > Juan Pablo Califano
> >
> > 2010/11/25 Paul Steven <paul_ste...@btinternet.com>
> >
> >> Thanks for all your help Henrik
> >>
> >> I will ask the site in question in the morning. I was under the
> impression
> >> it would be like every person who used Microsoft Office asking Microsoft
> to
> >> add a cross domain file for their particular scenario. To be honest I
> just
> >> panicked when the client reported tonight that this functionality didn't
> >> work and after trying to create a php file that would call the ashx file
> >> for
> >> me without success and doing a good bit of searching on google, I
> thought
> >> perhaps if there was a simple solution to this that someone on Flash
> Coders
> >> may know and be able to help me in my hour of need.
> >>
> >> Anyway I will email the site now though as it is UK based assume that I
> >> will
> >> not get any reply until tomorrow (which is too late!)
> >>
> >> Thanks for the advice
> >>
> >>
> >>
> >> -----Original Message-----
> >> From: flashcoders-boun...@chattyfig.figleaf.com
> >> [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Henrik
> >> Andersson
> >> Sent: 25 November 2010 20:34
> >> To: Flash Coders List
> >> Subject: Re: [Flashcoders] Advice on calling subscriber script on
> another
> >> server
> >>
> >> Paul Steven skriver:
> >>> Thought I could get some help here not labelled lazy!
> >>>
> >>
> >> You do realize that it takes just as long to simply ask the site in
> >> question right?
> >> _______________________________________________
> >> Flashcoders mailing list
> >> Flashcoders@chattyfig.figleaf.com
> >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >>
> >> _______________________________________________
> >> Flashcoders mailing list
> >> Flashcoders@chattyfig.figleaf.com
> >> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
> >>
> > _______________________________________________
> > Flashcoders mailing list
> > Flashcoders@chattyfig.figleaf.com
> > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> _______________________________________________
> Flashcoders mailing list
> Flashcoders@chattyfig.figleaf.com
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to