Strange issue with URLVariables and php file
I've got a strange problem with a php file. I'm trying to get some data from a mysql database and then return it back to the AS3, and that's been going fine, until I did any change whatsoever to one of the php files. The 2 php files are standard php code, to get data from the database so the main file has at the top..
session_start();
require_once 'gSQL.php';
require_once 'fb.php';
And gSQL has various functions relating to my game, like I said all that was working fine, until I literally did anything to the gSQL.php file, even just opening it in DW, saving it with a different name, and then resaving it back to it's original name *without changing the content at all), uploading it to the server stops my AS3 code from working, where as before the re-save, the exact same code allowed my as3 code to work fine!
The as3 line that is acting strange is "if (this.returnvars.scores)", here's the top part of the开发者_Python百科 AS3 function where the line is situated.
function completeGame(event:Event):void
{
this.returnvars = new URLVariables(this._game.data);
if (this.returnvars.scores)
{
With the original gSQL.php file, the line "if(this.returnvars.scores)" works and the program goes into that code block, but with the different (but the same) file "if(this.returnsvars.scores) is false and it jumps over it, i've looked at the contents of "returnvars.scores" and from what I can see it's exactly the same for both files, but something must be different.
The only thing I can think of is the encoding of the file, which DW tells me is UTF-8, and that's what it's being saved back to the server as...if I upload to the server the original gSQL.php file, the one I didn't do anything to (not even resaved the name) the AS3 works fine..any ideas??
Check that the flash file you are embedding has the
allowScriptAccess="sameDomain"
paramater in the embed flash object code, it seems to help with a lot of odd issues.
Failing that, make sure after you upload your PHP file that it has at least 644 permissions.
-Ev
精彩评论