Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

http_response + PHP

Fermat Euler
Registered User
Join date: 18 Jun 2008
Posts: 12
08-02-2008 15:06
Hi!

How can I get the variable value
-----------------------------------------------
PHP CODE
-----------------------------------------------
From: someone

CODE

<?php
if(isset($_REQUEST['param'])){
$sl_param = $_REQUEST['param'];
....
SQL CODE
....
$return = 7;
}else{
$return = -1;
}
?>


-----------------------------------------------

I need get the value of $return variable.

I see too much examples getting the "string body" param of:

CODE

http_response(key request_id, integer status, list meta_data, string body)


But... My page return too much data... I need get JUST the value of variable.

I'm trying understand the param "list meta_data" ... But all the times is empty... What a can get in this param...

I have read the wiki:
http://lslwiki.net/lslwiki/wakka.php?wakka=http_response
and
http://wiki.secondlife.com/wiki/Http_response
Inthis last:
• list metadata – List of HTTP_* constants and attributes
But how I get this if all is empty...

What I need to do to get the $return value?

TYVM!!
-------
(-: Sorry my english :-)
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
08-02-2008 15:21
Erm...the only things you can actively return to the script are the HTTP status code (which doesn't seem appropriate for the value of a variable unless that variable is reflecting whether the HTTP request was successful or not) and the body of the reply. There is no other place you can insert data into the reply. Good luck.
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
08-02-2008 23:07
You can use echo instead of return. That would print the result in the body which then can be found in the string.
It's not perfect but it works.