PDA

View Full Version : ActionScript vs PHP $_POST mess


smatic
06-30-2005, 03:24 PM
Please help,
I'm developing Flash project which sends via getURL and POST method some ASCII characters, for example

// Action Script
sSend = String.fromCharCode(55,128,129,252);
getURL("http://some.url/some_file.php","_blank","POST");

==
When I try to retrieve posted values in PHP with $_POST method I'm getting pretty odd result:

// PHP
$sSend = ($_POST['sSend']);
echo("length: " . strlen($sSend ) . "<hr>");
for($i=0;$i<strlen($sSend );$i++) {
echo("ascii: " . ord(substr($sSend ,$i,1)) . "<br>");
}

==
and the final result is :
length: 7

ascii: 55
ascii: 194
ascii: 128
ascii: 194
ascii: 129
ascii: 195
ascii: 188

Can somebody help me, how is that possible to send 4 ASCII characters and to receive 7 ASCII characters, definitely it is not because UTF encoding.