From: ajeet.ghule on
Hi All :
I want to get a return value from my PHP page back to director.Is there any
way i can achieve my goal.
Suppose i have a varible whose value is "XYZ". then i should be alble to get
the return value from the [b]PHP page to Director[/b].
Does director have any command which can access that varaible value.

Thanks & Regards

From: duckets on
If you use 'postNetText', 'netDone' and 'netTextResult', you should be able to
achieve what you want. Look up those commands in the director help.

Director will recieve the plain text output of your php file, so it's up to
you to decided how to parse it (unlike flash's "loadVars" command, which
accepts a querystring format).

A very basic way would be to simply output just the value, and nothing else.
In director, you could then assign the result to a variable (once you have
confirmed the net operation is complete, with 'netdone'), like this:

myVar = netTextResult(netID)

Hope this helps!

- Ben


From: ajeet.ghule on
Hi duckets :
I wanted to know if i store a varibel in PHP page.Suppose i assign it value in PHP script.Will be able to retrive that value in the director using the above command.


Thanks
From: duckets on
Yes. You'll have to use 'print' or 'echo' to output the value of that variable
when the page is requested by director. Whatever is printed out by the php page
is what director will recieve. If you want to just communicate the value of a
single variable, you can simply make your php page 'print' the value of the
variable, and make director assign the response read by 'netTextResult' into a
director variable.

- Ben


From: Manno Bult on

Just in case you mean the PHP page in which the Director file (.dcr) is
embedded, you could look into the externalParamCount().

Look at:
http://www.shocknet.org.uk/defpage.asp?pageID=4

for an explanation.

If you want director to make a new request to a webserver to retrieve
information, go with Ben's advice.

HTH,
Manno

externalParamCount()

ajeet.ghule wrote:
> Hi duckets :
> I wanted to know if i store a varibel in PHP page.Suppose i assign it value in PHP script.Will be able to retrive that value in the director using the above command.
>
>
> Thanks

--
----------
Manno Bult
http://www.aloft.nl
manno(a)xs4all.nl