how to carry session_id

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SinekSekiz
    New Member
    • Sep 2008
    • 1

    how to carry session_id

    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?actio n=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.
  • bnashenas1984
    Contributor
    • Sep 2007
    • 257

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

    Code:
    	var variables:URLVariables = new URLVariables();
    	variables.myvariable = "some value"; 
    	var request:URLRequest = new URLRequest("http://localhost/1.php");
    	request.method  = URLRequestMethod.POST;
    	request.data = variables; 
    	var loader:URLLoader = new URLLoader();
    	loader.addEventListener( Event.COMPLETE, loadCompleteHandler );
    	loader.load( request );
    
    function loadCompleteHandler(event:Event):void {
    	var mydata:String = event.target.data.toString();
    	trace(mydata);
    }
    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

    Comment

    Working...