I just realized I could fix this in multiplayer games by having each client do all the calculations and the server wont make a change unless all the clients agree. Probably more effort than I will put in, and it won't work in single player games, but I could separate characters for single and multiplayer I guess. This would increase network traffic and confuse my tracking of the gamestate.

Doing the game logic on the server certainly would work if it was extensive enough. Then the flash interface would be myplayer.attack("north"); instead of myplayer.gainExp(100); (after the attack is finished in the flash game). Just not sure if I want to program the game logic in php or not though...