Op verzoek van B-Top post ik mijn vonds hier ook maar ff, copy/paste uit de originele mailing die ik heb verzonden aan Flashcoders.
Misschien heb je er wat aan!

----
For the past 2 hours i've been banging my head against the wall because of the following:
When you have a Flash form, and use any of the following:
loadVariables, getURL with the POST method, it actually fakes a POST request. It will send a GET request, and attaches the form data as name/value pairs in the body.
So let's say you wrote a simple php file, and explicitly checks for POST data, the vars are always NULL or empty.
example:
Then call this script from within your Flash environment:
or
It will send the following request ( found out by watching the raw data from the request ):
Notice the first line, that says GET? It fakes a POST request by adding the name / value pairs in the body request (like a normal POST method)
I have yet to find a workaround, but at least i know where the problem is. Took me awhile to find out. Sorry if this was posted before, but i couldn't find anything in the archives.
HTH
Owen van Dijk
Web Developer - TROS
Misschien heb je er wat aan!
----
For the past 2 hours i've been banging my head against the wall because of the following:
When you have a Flash form, and use any of the following:
loadVariables, getURL with the POST method, it actually fakes a POST request. It will send a GET request, and attaches the form data as name/value pairs in the body.
So let's say you wrote a simple php file, and explicitly checks for POST data, the vars are always NULL or empty.
example:
PHP:
1
2
3
4
5
6
| <? $postfoo = $HTTP_POST_VARS["foo"]; $getfoo = $HTTP_GET_VARS["foo"]; echo "the value of postfoo = " . $postfoo . " and the value of getfoo = " . $getfoo; ?> |
Then call this script from within your Flash environment:
code:
1
| loadVariables ("foo.php", "", "GET"); |
or
code:
1
| loadVariables ("foo.php", "", "POST"); |
It will send the following request ( found out by watching the raw data from the request ):
code:
1
2
3
4
5
6
7
| GET /www/public_html/foo.php HTTP/1.1 Content-Type:application/x-www-form-urlencoded Content-Length: 18 User-Agent: ShockwaveFlash Host:www.example.com:80 Cache-Control: no-cache foo=could+be+any+value$bar=more+data+to+follow |
Notice the first line, that says GET? It fakes a POST request by adding the name / value pairs in the body request (like a normal POST method)
I have yet to find a workaround, but at least i know where the problem is. Took me awhile to find out. Sorry if this was posted before, but i couldn't find anything in the archives.
HTH
Owen van Dijk
Web Developer - TROS
"You're only as good, as what you did last week."