Jump to content

Passing Session Var to called file


aleX_hill

Recommended Posts

I don't have any idea why you are using $_GET because the default is POST.

 

Adding the following line before your session_start() should work (it did for me) -

 

 

session_id($_POST[session_name()]);

 

 

FYI: Apparently the flash player is it's own client and it maintains a separate cookie cache from the browser, as least in FF  (though I did see indications that doing this in IE actually works without passing the session id through the uploadify data.)

Link to comment
Share on other sites

 

ok, We are getting closer: I changed it to this in uploadify.php[code[<?phpsession_id($_POST[session_name()]);session_start();ob_start(); //Start bufferingvar_dump($_POST); //print the result$output = ob_get_contents(); //get the result from bufferob_end_clean(); //close buffer$h = fopen('log.txt', 'w+'); //open a filefwrite($h, $output); //write the output textfclose($h); //close file?>

 

 

and get this outputted to my log.txt file:

 

 

array(4) {

  ["Filename"]=>

  string(12) "purppete.jpg"

  ["folder"]=>

  string(15) "/upload/uploads"

  ["PHPSESSID"]=>

  string(26) "ggrjejvqqbpbdoe05ucph2ank1"

  ["Upload"]=>

  string(12) "Submit Query"

}

 

 

How can i get $_SESSION['current_email'] as PHPSESSID?

 

I apologize for bot being able to understand this more...I am still very much in the learning stage of php. I really do appreciate your help!

Link to comment
Share on other sites

I cant see why it wouldnt be working with that code, so I am stumped.

 

@PFMaBiSmAd: Glad you can see the problem with the session and paths etc now. I dont let users send through an upload path, more that one of my session variables is used in a switch statement to find the correct path, so there are a defined, limited number of places that they can upload to. And of course I restrict files to "safe" extensions, ie gif and jpg.

 

@dschuett: We were all learning at one point (and still contantly learn), and I am sure if you go back and look at my first few posts then you will see I started in the same position.

 

If you still cant get it to work, try my other suggestion where you pass through just the email rather then the whole session, and see how that comes out, assuming you dont need the other session vars.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.