Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

weird http response

Crunchie Calamari
Registered User
Join date: 3 Apr 2006
Posts: 3
07-30-2006 12:35
Hi folks,
This is my first post so I hope its in the right forum.

I recently found some excellent PHP code on the web by Vedanta Barooah which uses curl to send a translation request to babelfish (http://babelfish.altavista.com/tr). I figured that it would be fairly easy to get second life to use the script via
llHTTPRequest / http_response.... but alas something weird has cropped up.

There is a copy of the script running here:

http://www.eirewave.com/babelfish/translate.php?from=english&to=spanish&text=hello%20world

which produces the expected "hola mundo" if called from a browser....

But.... second life just spits out the original parameter "helloworld". I can't for the life of me figure out why this would happen. The http response body is "hola mundo", and if I try any hard coded output from the PHP it is reproduced as expected in second life, but not when it comes from the translator function...

Anyone got any ideas? Anything at all would help.

Also, could someone please tell me why that white space between "hello" and "world" is missing?

Many Thanks.
Rodrick Harrington
Registered User
Join date: 9 Jul 2005
Posts: 150
07-30-2006 23:02
check to see if you have used http://secondlife.com/badgeo/wakka.php?wakka=llEscapeURL
:D

ie it looks like you are not sending "hello%20world" to the script but rather "helloworld" which isn't correct, try pushing that through a browser to see what I mean :D
_____________________
Crunchie Calamari
Registered User
Join date: 3 Apr 2006
Posts: 3
07-31-2006 01:48
Hi,
Thanks for the quick reply. I just tried it in a browser and see what you mean, kool! The PHP is probably spitting out the original variable because it can't translate it. I'm not at my machine right now but I'll check tonight from inside SL.
Crunchie Calamari
Registered User
Join date: 3 Apr 2006
Posts: 3
08-01-2006 05:29
Excellent!
Works perfectly. Thanks a million for your help.