Passing data from PHP to Flash and vice versa

Well, I know how to pass data. I use a simple echo like this:


echo "&stats=$stats";
echo "&dates=$dates";

And I know how to pass data on to php, i.e. by calling the URL of the script with Post or Get. It all works fine as long as I embed the swf in the file containing the script, or part of the script that will then call another file. However, if I only open the .swf (outside the browser) and send data, the script will be called but receives no data. Why is that? What makes the difference and why does the data not reach the script? Is there some basic principle I’m missing?

Also another question is, when I pass data to flash, either with print or echo, the data gets printed on the screen. Is there any way to avoid this? I only need the data in flash for functionality.
I’m only just starting on this whole business of getting data from a data base to use it in flash and I’m a little lost with how to link all these files that I got. That’s why I tried how it works when the swf is embedded in the script file and how it works when I never open my browser.
What I eventually want is to have the swf online and pass data back and forth without the user ever noticing that. How do I accomplish that?

I’ve read most of the tutorials here and did not find an answer to this particular problem. Any help is much appreciated.