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

**URL:** <https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905>\
**Category:** programming\
**Created:** [July 26, 2004, 10:44pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905 "2004-07-26T22:44:16Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jingman](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jingman/32/163_2.png) [@jingman](https://forum.kirupa.com/u/jingman)\
**Post date:** [July 26, 2004, 10:44pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/1 "2004-07-26T22:44:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2004, 10:59pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/2 "2004-07-26T22:59:49Z")

</div>

> [@jingman](#):
>
> Everything works dandy on my local machine. I make the query from a database on a seperate server.

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2004, 11:02pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/3 "2004-07-26T23:02:50Z")

</div>

> [@Digitalosophy](#):
>
> 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](http://www.etc.com/flashservices/xxx)…”).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2004, 11:10pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/4 "2004-07-26T23:10:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2004, 11:14pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/5 "2004-07-26T23:14:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2004, 11:21pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/6 "2004-07-26T23:21:07Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 26, 2004, 11:40pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/7 "2004-07-26T23:40:29Z")

</div>

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

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??

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 27, 2004, 9:40pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/8 "2004-07-27T21:40:39Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2004, 11:41pm UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/9 "2004-07-29T23:41:02Z")

</div>

**SOLVED**

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

```auto
//Before (broken on server):

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

//After (working on server):

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

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 1, 2004, 1:04am UTC](https://forum.kirupa.com/t/php-amfphp-remoting-query-fails-when-movie-is-uploaded/58905/10 "2004-08-01T01:04:54Z")

</div>

:lol:

glad it works 🙂
