Hey...
Wow, you must be frustrated. I see this mistake a lot but unless you're looking for it, it's easy to miss. Through your testing, you've seen that everything seems to be working independently, just not together.
The fact is that everything is working. But you're not calling the PHP script via Flash. The tip off? The fact that you're able to get the value of
val1 whether your server is on or not. This suggest that the value isn't derived from the server-side script.
Because you're using the ampersand-separated notation in your PHP script to test for the value of
val1, Flash is parsing script.php as a normal text file. For this, it doesn't need server-side script to run.
To fix this, add an absolute path to your PHP script. If you're testing locally, your absolute URI probably will look something like
http://localhost/script.php.
If you're still confused, I have an example up somewhere. I can hunt it down for you, if you'd like. I believe it's in both ActionScript 2.0 and ActionScript 3.0 (AS3 is a lot more robust to do this in)
Bookmarks