2011-01-10 124 views
0

我遇到了swfupload问题。我通过这样的session_id()swfupload会话问题销毁会话

注意:它在我的本地机器上工作正常,我正在使用MAMP。但它不是在服务器

/upload-file.php?s='<?php echo session_id()'; 
    /upload-file.php?s=189477fcfa1ec7f630e70a09e1e84cae 

但它不保持会话的工作,毁了我当前会话(登录我出去)这里是在文件上传代码。

<?php 

if(isset($_GET['s'])) { 

session_id($_GET['s']); 
session_start(); 

    require_once 'admin/class/user.php'; 

    $u = new User(); 

    //Check for user logged in 

    if($u->islogged() == FALSE) { 

     header("location: index.php"); 

    exit(); 

    code continue ..... 
} 

因为在服务器不是在登录我重定向到的index.php

这SWFUpload的调试器窗口输出

SWF DEBUG: ----- END SWF DEBUG OUTPUT ---- 
SWF DEBUG: 
SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.jpg 
SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list... 
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0 
SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 1. Files Queued: 1 
SWF DEBUG: StartUpload: First file in queue 
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0 
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /upload-file.php?s='189477fcfa1ec7f630e70a09e1e84cae' for File ID: SWFUpload_0_0 
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0 
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 317793. Total: 317793 
SWF DEBUG: Event: uploadError: HTTP ERROR : File ID: SWFUpload_0_0. HTTP Status: 302. 
SWF DEBUG: Event: uploadComplete : Upload cycle complete. 
SWF DEBUG: StartUpload: First file in queue 
SWF DEBUG: StartUpload(): No files found in the queue. 
+0

`开始上传到/upload-file.php?s ='189477fcfa1ec7f630e70a09e1e84cae'` - 这些单引号应该在那里吗? – thirtydot 2011-01-10 10:58:59

+0

我试过没有和引号,同样的问题 – Saqueib 2011-01-10 11:02:06

回答

0

在SWFUpload的JS试试这个:

var swf; 
    window.onload = function() { 
    swf = new SWFUpload({ 
    // Backend Settings 
    post_params: {"PHPSESSID": "<?php echo session_id(); ?>"} 
...