This content has been marked as final. Show 9 replies
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!
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.
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.
Just in case you mean the PHP page in which the Director file (.dcr) is
embedded, you could look into the externalParamCount().
for an explanation.
If you want director to make a new request to a webserver to retrieve
information, go with Ben's advice.
> 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.
You can also use XML to 'transport' data between Director and PHP (ie the PHP scripts generate XML for Shockwave to read). Have a look at
Hi Ben :-)
I tried with the method which you told for getting the PHP values back into Director.But with no sucess :-(
I am really in urgency.
what i am doing is passing a query string variable with the director postTextResult command
on mouseup me
netID = postNetText(" http://localhost//PHPApplications/Querystring.Php", infoList)
but by doing thsi i am just getting the netid which is 1,2,3 etc
but in the PHP file i am just printing a variable. that value i should eb able to get.
My PHP file cod e is this
<?php echo "ABC"; ?>
i should be able to get teh value "ABC" in director.
Please let me know if i am making sense.
Please let me know how do i do this?I am really stuck bacause of this.also if i send the values from director would that php page be able to recieve those values.
Net operations are not synchronous - that is, after issuing the 'getnettext' or 'postnettext' command, you have to wait for it to complete, and you have to use a special command to check whether it's complete.
Once you have your 'netid' number, you need to use this number to check whether the net operation has finished. I suggest, since you are initiating the post request within a button behaviour (the mouseup handler), you could add an 'exitframe' handler to that same button to check whether the operation is complete. See attached code.
(by the way, in my initial reply, I said: "If you use 'postNetText', 'netDone' and 'netTextResult', you should be able to achieve what you want. Look up those commands in the director help", which describes exactly this)
hi I tried your code but with no success
May be somethign is going wrong at my end :(
but when i run the PHP page in the browser i get to see the value printed on to the page.
But when i try to request that page from browser i get netId as some integer value.and check if netdone and then alert the values of the NetId but teh alert box is blank.
I not getting what the problem is.I am assignign the value to the variable in PHP and that value is returned as void to me even if i am geeting the netId with some value.
In that case, perhaps it's a problem with director not playing nice with your 'localhost' setup. Perhaps try 127.0.0.1 instead of 'localhost', or try moving your php files to a remote web server and using a real web url.