Ver Mensaje Individual
  #5 (permalink)  
Antiguo 06/02/2004, 15:28
Avatar de Sebastian1046
Sebastian1046
 
Fecha de Ingreso: junio-2003
Mensajes: 278
Antigüedad: 20 años, 10 meses
Puntos: 0
Código PHP:
<?
            
}
        }
        elseif ((
$_GET[act]=="view")&&$_GET[file])
        {
            
$value_de base64_decode($_GET[file]);
            echo
"<script language=\"javascript\">\nViewPopup = window.open(\"$dir_store/$value_de\", \"fum_viewfile\", \"toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=yes,location=no,width=640,height=480\")\nViewPopup.document.bgColor=\"#F7F7F7\"\nViewPopup.document.close()\n</script>";
            echo
"<br><img src=\"$dir_img/info.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">file opened!</font></b><br>»<a href='index.php?ir=1'>back</a><br><br><br>If the file did not display, you must <b>disable</b> your popup manager, or enable javascript in your browser.";
        }
        elseif ((
$_GET[act]=="del")&&$_GET[file])
        {
            
$value_de base64_decode($_GET[file]);
            @
unlink($dir_store."/$value_de");
            echo
"<br><img src=\"$dir_img/info.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">file has been deleted!</font></b><br>»<a href='index.php?ir=1'>back</a>";
        }
        if (
$_GET[act]=="delall")
        {
            
$handle opendir($dir_store);
            while(
$file=readdir($handle))
            if ((
$file != ".")&&($file != ".."))
            @
unlink($dir_store."/".$file);
            
closedir($handle);

            echo
"<br><img src=\"$dir_img/info.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">all files have been deleted!</font></b><br>»<a href='index.php?ir=1'>back</a>";
        }

    }
    else
    {
        echo
"<br><br>";
        
$uploadpath=$dir_store."/";
        
$source=$_FILES[fileupload][tmp_name];
        
$fileupload_name=$_FILES[fileupload][name];
        
$weight=$_FILES[fileupload][size];

        for(
$i=0;$i<count($file_ext_allow);$i++)
        {
            if (
getlast($fileupload_name)!=$file_ext_allow[$i])
                
$test.="~~";
        }
        
$exp=explode("~~",$test);

        if (
count($exp)==(count($file_ext_allow)+1))
        {
            echo
"<br><img src=\"$dir_img/error.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">ERROR: your file type is not allowed (".getlast($fileupload_name).")</font>, or you didn't specify a file to upload.</b><br>»<a href='index.php?ir=1'>back</a>";
        }
        else
        {

            if (
$weight>$file_size_ind)
            {
                echo
"<br><img src=\"$dir_img/error.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">ERROR: please get the file size less than ".$file_size_ind." BYTES  (".round(($file_size_ind/1024),2)." KB)</font></b><br>»<a href='index.php?ir=1'>back</a>";
            }
            else
            {

                foreach(
$_FILES[fileupload] as $key=>$value)
                {
                    echo
"<font color=\"#3399FF\">$key</font> : $value <br>";
                }

                echo 
"<br>";

                
$dest ''

                if ((
$source != 'none') && ($source != '' ))
                {
                    
$dest=$uploadpath.$fileupload_name;
                    if (
$dest != '')
                    {
                        if (
file_exists($uploadpath.$fileupload_name))
                        {
                            echo
"<br><img src=\"$dir_img/error.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">ERROR: that file has already been uploaded before, please choose another file</font></b><br>»<a href='index.php?ir=1'>back</a>";
                        }
                        else
                        {
                            if (
copy($source,$dest))
                            {
                                if (
$_POST[rename])
                                {
                                    
$_POST[rename]=replace($_POST[rename]);
                                    
$exfile=explode(".",$fileupload_name);
                                    
                                    if (@
rename("$dir_store/$fileupload_name","$dir_store/$_POST[rename].".getlast($fileupload_name))) 
                                    {
                                        echo
"<br><img src=\"$dir_img/info.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">file has been renamed to $_POST[rename].".getlast($fileupload_name)."!</font></b></font><br>";
                                    }
                                }
                                echo
"<br><img src=\"$dir_img/info.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">file has been uploaded!</font></b><br>»<a href='index.php?ir=1'>back</a>";
                            }
                            else
                            {
                                echo
"<br><img src=\"$dir_img/error.gif\" width=\"15\" height=\"15\">&nbsp;<b><font size=\"2\">ERROR: cannot upload, please chmod the dir to 777</font></b><br>»<a href='index.php?ir=1'>back</a>";
                            }
                        }
                    }
                }
            }
        }
    }
}

#/# end of main script, start authentication code IF user not logged in IF $auth_ReqPass is enabled

    

    else 
    {
        echo(
"<p><img src=\"$dir_img/error.gif\" width=\"15\" height=\"15\">&nbsp;Authentication error</p>" .
"<p><a href='index.php?ir=1&logout=1'>Delete cookies and login again<a></p>");
    }
    } 
    else 
    {

    if (!isset(
$login) || isset($relogin)) {
?>
<font size="3"><b><i><? echo ($title) ? ($title) : ("File Upload Manager"); ?></i> - Authentication</b></font><br><br>
<table class="table_auth"><tr><td><center>
Please enter the username and password to enter the restricted area.<br>
You must have cookies enabled in your browser to continue.
</center></td></tr></table>
<form action='index.php?ir=1&login=1' method="POST"><p>
Username: <input type="text" name="auth_formUser" size="20"><br>
Password: <input type="password" name="auth_formPass" size="20">
<p><input type="submit" name="submit" class="button" value="Log-In"></p>
</form></center>
<?
    

    elseif (isset(
$login)) 
    {
        echo(
"<p>$auth_msg</p>" "<p>You'll be redirected in 2 seconds!</p>");
    }
    }
?>
</body>
</html>

LO SEPARE EN 3 PARTES POR QUE ENTERO NO ME DEJABA PUBLICAR EL CODIGO
__________________
Agradesco infinitamente a toda la gente del foro que me ayudo/a.