[php/amfphp/remoting] Query fails when movie is uploaded

I do a simple query with flash remoting.

Everything works dandy on my local machine. I make the query from a database on a seperate server.

When I upload the movie, the query fails.

I swear I’ve heard about these “doesn’t work online” problems before, but I’ve searched and cannot find the answer.

What gives? Any ideas?

Thanks.

Does that mean you have the database on a different server then the flash files?

When the flash files are local, it works. When I upload the flash files to the server (the one with the DB), they stop working.

All of the service calls are absolute (“http://www.etc.com/flashservices/xxx…”).

Hmm not sure then, I had a problem with something somewhat similar and it was a flash player security issue.

What did you do to fix it? I’ll try anything.

Well I didn’t actually. I made a google search that used google’s web service. Problem being is that Google apparanetly doesn’t allow access to a crossdomain.xml file. So the file works locally but when uploaded, it doesn’t return google’s search data.

Now I’m not sure what your doing, but if your using a web service or getting data from another domain I would suggest looking on macromedia’s site.

I may be a bit off with what I’m saying but I know this was a huge problem that I had, and never found a solution but MM’s site did help.

So what are you doing anyway?

I’m doing a full-out ecommerce type site, but am getting hung up on this secure login part :frowning:

Did some more testing and found that this problem occurs whenever the file is run off of a webserver - of any kind, in any location. It works just dandy when you open the files on a local computer, but as soon as you upload them somewhere, they die.

It seems like this might be an access problem indeed. But why would flash let me access services from a remote computer and not from the local one??

It seems like everyone should have this problem so I’m wondering why it’s only me.

I’ve now tried it with the flash files hosted on 3 different servers, and it continues to fail.

Does anyone know anything about flash securities getting in the way? I just really can’t see why it would work only when you run the files locally (and I’ve checked all the paths, they are fine).

Just to go over exactly what combinations I’ve tried:

Flash files on,Database on,Ran it from,Result
A, Q, B, Failed
A, Q, C, Failed
A, Q, A, Worked
B, Q, A, Failed
B, Q, A, Failed
B, Q, C, Failed
B, Q, B, Worked

So you see, it only works when I open the files directly, on my local machine. The moment they get put on any other server, the queries stop being returned. This really seems like an access issue, but I can’t find anything in any documentation. Please help!

SOLVED

Simple solution, can’t believe I missed it, but oh well.

//Before (broken on server):

NetServices.setDefaultGatewayUrl("http://www.domain.com/flashservices/gateway.php");

//After (working on server):

NetServices.setDefaultGatewayUrl("../../flashservices/gateway.php");

:lol:

glad it works :slight_smile: