Connecting Tech Pros Worldwide Forums | Help | Site Map

how to carry session_id

Newbie
 
Join Date: Sep 2008
Posts: 1
#1: Sep 18 '08
Hi All

I have looked all over the internet for this. What I basically want to do is implementing following link to the flash getURL(); function.

<a href="http://www.celebslair.com/index.php?action=logout;sesc=', $context['session_id'], '">

I can not make the .swf file get the ', $context['session_id'], ' from my PHP web site. I search all over the internet but there is not a simple solution for this. I am using Simple Machines Forum (SMF) in case if it helps.

Familiar Sight
 
Join Date: Sep 2007
Posts: 211
#2: Sep 18 '08

re: how to carry session_id


Hi
Take a look at this script. It's what I use to send and recieve information between AS and PHP.

Expand|Select|Wrap|Line Numbers
  1.     var variables:URLVariables = new URLVariables();
  2.     variables.myvariable = "some value"; 
  3.     var request:URLRequest = new URLRequest("http://localhost/1.php");
  4.     request.method  = URLRequestMethod.POST;
  5.     request.data = variables; 
  6.     var loader:URLLoader = new URLLoader();
  7.     loader.addEventListener( Event.COMPLETE, loadCompleteHandler );
  8.     loader.load( request );
  9.  
  10. function loadCompleteHandler(event:Event):void {
  11.     var mydata:String = event.target.data.toString();
  12.     trace(mydata);
  13. }
  14.  
As you can see in the code (variables) is an array which contains variables you want to post to your php file.

When the information is sent and the result of your php file is recieved then (mydata) will contain the page result

BTW this code is for AS3

Hope this helps you
Reply