From: Lukewig on
Hi,

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

http://www.lingoworkshop.com/Articles/PHP_and_MySQL.php

Cheers
Luke

From: ajeet.ghule on
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)
end

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.







From: duckets on
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.

- Ben

(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)

property netID,waitForResponse

on mouseUp me
netID = postNetText("http://localhost//PHPApplications/Querystring.Php",
infoList)
waitForResponse = true
end

on exitFrame me
if waitForResponse then
if netDone(netID) then
resultValue = netTextResult(netID)
alert( "I got a result of: " & resultValue )
waitForResponse = false
end if
end if
end

From: ajeet.ghule on
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.


From: duckets on
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.

- Ben