views:

82

answers:

2

Hello,

I'm writing an amfPHP function which should take string input. It takes alphanumeric characters without a problem, but unfortunately it returns data as "2" if I send "2.UgnFl4kAWovazp_tVo6fHg__.86400.1260025200-571701419" as parameter.

here is the function (real simple as you can see)

function checkOpenSession($guid, $session_key) {
     return $session_key;
}
+1  A: 

I just tried this with a simple setup, and just writing the results to a file from the service browser and it seems to be ok for me. So the problem would seem to be in the calling end.

Another possibility is that amfphp changes the datatype of the returned value from a string to an int because of the leading integer. Try putting a some alphanumeric character at the start of the return string and see what that does.

Matti
You are right about amfphp, it changes string to an integer, when I put alpha char at the beginning of string, it returns right value with my added string. Do you know solution or setting to avoid this? (If I cannot find any solution, I'll put a char as temporary solution)
she hates me
I did a quick test echoing strings that have that format and php doesn't seem to convert them. So then you'd need to find a setting from amfphp that turns that off. I don't think there is one though. It's also possible that it's the AS front end that does the conversion. Are you using AS2 or AS3? AS3 should be type safe.
Matti
A: 

double quote your strings... that will work it out.

erik