I don't have a massive amount of experience using ActiopScript and php together, but do you not have to load that variable into flash in some way? Flash is self contained and that php is gonna run on the server so how is flash going to pick up that variable if you do not specifically pass it? could you us a getURL and then return the value?
I'm not 100% sure, but it's an idea ?