Jump to content

PHP Sessions - setting sessions from Flash


mrman23

Recommended Posts

Hi,

 

I have a log in script and Flash upload system that work as expected in IE, but as soon as they are applied in Firefox/Safari nothing. I have read around and it seems that this is to do with the way F&S deal with Sessions:

 

http://www.avertlabs.com/research/bl...ation-puzzles/

 

Now whilst that site offers a solution I am unable to get it to work (probably missing something obvious!).

 

My setup works like this, someone logs in using sessions, they navigate around and have the ability to upload images, to give them a graphical representation of the upload I opted to use a Flash bar that when sent back to php uses the login session to call a name from MySQL to name the uploaded file. This works fine on its own (without renaming) and in IE (with renaming) but nowhere else.

 

Not sure if there is an obvious work-around or a quick fix way to make the session from login carry through to the upload php without striping the uploaded file from the system(?)

 

Thanks for any suggestions/solutions! :)

Link to comment
https://forums.phpfreaks.com/topic/94008-php-sessions-setting-sessions-from-flash/
Share on other sites

Here's the basic upload php page, as above when I place the include login at the beginning of the code it works fine in IE but not in the other major browsers.

 

<?php 
    if (is_uploaded_file($_FILES['Filedata']['tmp_name']))     { 

        $uploadDirectory = "uploads/"; 

function findexts ($filename) 
{ 
$filename = strtolower($filename) ; 
$exts = split("[/\\.]", $filename) ; 
$n = count($exts)-1; 
$exts = $exts[$n]; 
return $exts; 
} 

$ext = findexts ($_FILES['Filedata']['name']) ; 

$name = "$username"; 

$newname = "$name".".".$ext; 

        $uploadFile = $uploadDirectory . basename($newname); 

        copy($_FILES['Filedata']['tmp_name'], $uploadFile); 
    } 
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.