From: E O. <com...@ho...> - 2003-06-09 03:43:36
|
Rick, For me, making sessions work was just: <code> session_start(); $_SESSION["fooVar"]; </code> at the top of my service lib. I don't know if you tried that. Regards, E Okyere -----Original Message----- From: amf...@li... [mailto:amf...@li...] On Behalf Of Rick = Widmer Sent: Friday, June 06, 2003 7:42 PM To: amf...@li... Subject: [amfphp] PHP Session Handling I have now gotten session passing working. (At least it looks like it=20 is working, as it passes the right session ID values around. I still=20 need to work in actually using variables within the session.) What you need to do: In the flashapp.html file look for two places that reference the .swf=20 file you are embedding. One works for IE and the other for Netscape. <PARAM NAME=3Dmovie VALUE=3D"flashapp.swf"> <PARAM... becomes <PARAM NAME=3Dmovie VALUE=3D"flashapp.swf<?=3D$PHPSESSID?>"> <PARAM... and <EMBED src=3D"flashapp.swf" quality=3Dhigh bgcolor=3D... becomes <EMBED src=3D"flashapp.swf?<?=3D$PHPSESSID?>" quality=3Dhigh = bgcolor=3D... Of course you will also need to rename flashapp.html to flashapp.php,=20 and add a call to session_start() before you let it start to paint the = page. I put it at the very top of the page. In your flash movie you need to change the gatewayurl definition: var gatewayurl =3D "http://dictionary.deafschool.net/gateway.php"; becomes: var gatewayurl =3D=20 "http://dictionary.deafschool.net/gateway.php?PHPSESSID=3D" + SessionID; You can use a variable name other than SessionID, but be sure that you=20 use the exact same name in the <PARAM> <EMBED> and when you append it=20 to the gatewayurl. Finally, add a call to session_start() at the top of your gateway.php = file, and you can maintain a PHP session as you move in and out of = Flash. It is quitting time now, when I get back to work Monday I will look into = a way to start a PHP session from within flash if one has not already=20 been created. For testing you can create a dynamic text field and enter a valid PHP=20 session id into it. If the variable bound to this text field matches=20 the name of the variable part of your gatewayurl (I used SessionID) then = you can keep a session alive while you are testing from the Flash IDE. Once I had a valid session ID, I just copied it into the field as a=20 default value, and the session was re-opened every time I called AMFPHP. Rick ------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The best thread debugger on the planet. Designed with thread debugging features you've never dreamed of, try TotalView 6 free at www.etnus.com. _______________________________________________ amfphp-general mailing list amf...@li... https://lists.sourceforge.net/lists/listinfo/amfphp-general |