upload register_globals off

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • upload register_globals off

    hallo forum

    wieder mal sicherlich eine dämliche frage:
    hier im forum habe ich noch nichts gefunden...
    ich will ne datei hochladen.. geht jedoch nicht.

    das ist meine funktion:
    PHP-Code:
    function load_content_uploadfile($dateiname$title$message)
        {
            if(
    check_admin())
            {
                
    $tmprslt '';
                if(!empty(
    $dateiname))
                {
                    
                    
    $pfad pathinfo($dateiname);
                    
    $name $pfad["basename"];
                    if(
    copy($name,"downloads/" $name))
                    {
                        
    insert("title""comment""path""filename""dateTime""visible",$title$message"downloads/"$nameStrFTime('%Y-%m-%d %H:%M:%S',time()), "-1""downloads");
                        
    $tmprslt .= '
                                    <script language="JavaScript" type="text/javascript">
                                        alert("File erfolgreich hinaufgeladen! Ihre Datei wird kontrolliert und sobald als moeglich online zur Verfuegung gestellt.");
                                        document.location.replace("?cmd=uploads");
                                    </script>
                                    '
    ;
                    }
                    else
                    {
                        
    $tmprslt .= '
                                    <script language="JavaScript" type="text/javascript">
                                        alert("Fehler beim kopieren der Datei!");
                                        document.location.replace("?cmd=uploads");
                                    </script>
                                    '
    ;
                    }
                }
                else
                {
                    
    $tmprslt .= '
                                <script language="JavaScript" type="text/javascript">
                                    alert("Es wurde keine Datei angegeben!");
                                    document.location.replace("?cmd=uploads");
                                </script>
                                '
    ;
                }
            }
            return 
    $tmprslt;
        } 
    und so ruf ich die die funktion auf:

    PHP-Code:
    $dateiname $_POST['Dateiname'];

    case 
    'uploadfile':
                  
    $base['title'] = 'Uploads';
                  
    $base['content'] .= load_content_uploadfile($dateiname$title$message);
                  break; 
    $_POST['Dateiname'] ist aus dem Post Forumal das Input feld

    der fehler kommt immer beim else des copy!
    First: Things get worse under pressure.
    Second: If anything just cannot go wrong, it will anyway
    Third: A falling object will always land where it can do the most damage.

  • #2
    nimm $_FILES statt $_POST
    Ich denke, also bin ich. - Einige sind trotzdem...

    Kommentar


    • #3
      nun kommt, er habe keine datei...

      hab nun einfach $dateiname = $_FILES['Dateiname']; statt
      $dateiname = $_POST['Dateiname'];
      First: Things get worse under pressure.
      Second: If anything just cannot go wrong, it will anyway
      Third: A falling object will always land where it can do the most damage.

      Kommentar


      • #4
        PHP-Code:
        echo '<pre>';
        print_r($_FILES);
        echo 
        '</pre>'
        ausgabe?
        Ich denke, also bin ich. - Einige sind trotzdem...

        Kommentar


        • #5
          "Array
          (
          )
          "

          :-(
          First: Things get worse under pressure.
          Second: If anything just cannot go wrong, it will anyway
          Third: A falling object will always land where it can do the most damage.

          Kommentar


          • #6
            das ist mein form:

            <form name="upload" method="post" action="?cmd=uploadfile">
            <table cellpadding="0" cellspacing="0" border="0">
            <tr>
            <td>File:</td>
            <td><input type="File" name="Dateiname"></td>
            </tr>
            <tr>
            <td>Titel der Datei:</td>
            <td><input type="Text" name="title"></td>
            </tr>
            <tr>
            <td>Beschreibung:</td>
            <td><textarea name="message" cols="30" rows="10"></textarea></td>
            </tr>
            <tr>
            <td colspan="2"></td>
            <td><input type="Submit" value="Upload"></td>
            </tr>
            </table>
            </form>
            First: Things get worse under pressure.
            Second: If anything just cannot go wrong, it will anyway
            Third: A falling object will always land where it can do the most damage.

            Kommentar


            • #7
              seltsam, wie sieht denn das formular aus?
              Ich denke, also bin ich. - Einige sind trotzdem...

              Kommentar


              • #8
                oben
                First: Things get worse under pressure.
                Second: If anything just cannot go wrong, it will anyway
                Third: A falling object will always land where it can do the most damage.

                Kommentar


                • #9
                  ansehen kann mans heir
                  First: Things get worse under pressure.
                  Second: If anything just cannot go wrong, it will anyway
                  Third: A falling object will always land where it can do the most damage.

                  Kommentar


                  • #10
                    wo ist denn die encryption im FORM?
                    INFO: Erst suchen, dann posten![color=red] | [/color]MANUAL(s): PHP | MySQL | HTML/JS/CSS[color=red] | [/color]NICE: GNOME Do | TESTS: Gästebuch[color=red] | [/color]IM: Jabber.org |


                    Kommentar


                    • #11
                      autsch!

                      ups vergessen!
                      First: Things get worse under pressure.
                      Second: If anything just cannot go wrong, it will anyway
                      Third: A falling object will always land where it can do the most damage.

                      Kommentar


                      • #12
                        ist gegangen

                        VIELEN DANK!
                        First: Things get worse under pressure.
                        Second: If anything just cannot go wrong, it will anyway
                        Third: A falling object will always land where it can do the most damage.

                        Kommentar

                        Lädt...
                        X