Discussions of secure PHP coding. Security in software is important, so don't be afraid to ask. And when answering: be anal. Nitpick. No security vulnerability is too small.
You need to design a way for your PHP script to know that the data it receives comes from your Flash application and that the data has not been changed en route. This might involve some kind of encryption, obfuscation, or tokens. Whatever it is, it needs to be implementable in both PHP and ActionScript.
For example, in ActionScript, you might calculate a numeric token based on the user id, numeric values of characters in the name, components of the time, and a secret number (known as a salt). When you send the request to your PHP script, include the token along with the other variables. In PHP, calculate another token using the same rules, and compare the two tokens. If the tokens are the same, you can be confident that the request has not been tampered with.
Be aware that it may be possible to decompile Flash applications; so change the salt as often as practical.
you can use php to create flash now programatically.
the token idea (shared seed) is an excellent approach as well as keyed encryption/decryption of any streaming data..
that way it will be unique for each request, comparable against databased values, and harder to reverse engineer.
additionally, when posting back high scores you want to use encryption with a unique key for ever request.
I had similar concerns with some gambling sites I was contracted to develop based on a flash animation front end for various casino games. My approach was to complete every critical and compromisable computation server side then send results to the flash front end with the server databasing the results ahead of time, therefore eliminating the ability of any user cheating.
For fool proof anti-cheat gaming, I would recommend the latter system. As long as your servers are secure, the system is secure.