unbesetzte PHP Globals bei enctype=multipart/formdata

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

  • unbesetzte PHP Globals bei enctype=multipart/formdata

    Folgendes Problem auf dem virtuellen Web-Server eines Kunden von uns (die gleiche Funktionalität inkl. des Tests läuft auf anderen Servern natürlich):

    Versehe ich ein HTML-Formular zusätzlich mit dem enctype=multipart/form-data, um Dateien upzuloaden, so werden auf einmal die PHP-Variablen $_POST, $_FILES, ... nicht mehr ordentlich besetzt. Auszuprobieren unter

    http://web6.www2.vianetworks.de/test-enctype.php

    Ich bilde mir ein, die PHP-Installation ist nicht o.k. Oder stehe ich auf dem Schlauch und es gibt tatsächlich "legitime" Installationen mit dieser Einschränkung und was dann?

    Danke im Voraus für Tipps

    Markus

  • #2
    Welche php Version?
    Beantworte nie Threads mit mehr als 15 followups...
    Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

    Kommentar


    • #3
      PHP Version 4.1.2

      Markus

      Kommentar


      • #4
        code?
        [color=red]musse rühre, musse probiere=>iss a pulsgeber ![/color]

        Kommentar


        • #5
          Code der Testdatei (nachdem das Problem zunächst in einer grösseren Anwendung aufgetreten ist):

          PHP-Code:
          <html>
          <head>
          <title>Untitled Document</title>
          <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
          </head>

          <body bgcolor="#FFFFFF" text="#000000">
          $_POST['testfeld']:
          <?php
          $testfeld 
          $_POST['testfeld'];
          echo 
          "$testfeld:<br>\n";
          ?>

          <form name="form1" method="post" action="test-enctype.php">
            testfeld 
            <input type="text" name="testfeld">
            <input type="submit" name="Submit" value="Submit in normalem form tag">
          </form>
          <form name="form2" method="post" enctype="multipart/form-data" action="test-enctype.php">
            testfeld 
            <input type="text" name="testfeld">
            <input type="submit" name="Submit" value="Submit in multipart/form-data form tag">

          </form>


          <p>
            <?php
            phpinfo
          ();
            
          ?>
          </p>
          </body>
          </html>
          Webserver: Apache/1.3.23
          System: Linux (redhat)


          EDIT:
          php-tags eingefügt
          Abraxax

          Zuletzt geändert von Abraxax; 26.03.2003, 12:21.

          Kommentar


          • #6
            hmm, eigentlich sollte es laufen, zumindest ist alles richtig!
            ich fürchte, da weiß ich auch nicht weiter!
            [color=red]musse rühre, musse probiere=>iss a pulsgeber ![/color]

            Kommentar


            • #7
              Schau mal was ich auf php.net gefunden hab:
              [2 Mar 2002 12:54am CST] scott at datalink dot net dot au
              Forms with an enctype of 'multitype/form-data' do not register the POST
              variables.

              Here's how to reproduce:

              ----- Short Script Follows -----
              <?
              print_r($HTTP_POST_VARS);
              ?>
              <form method=post enctype='multipart/form-data'>
              <input type='text' value='<? print $foo ?>' name='foo'>
              <input type='submit'>
              </form>
              ----- End Script -----

              Run the script above. It is simple enough - it has a form that submits
              to itself, and then displays the HTTP_POST_VARS variable.

              When I remove the enctype='multipart/form-data' attribute from the form
              tag, the script works fine (i.e. the variable 'foo' appears). The
              enctype directive appears to surpress the variables.


              [2 Mar 2002 1:04am CST] scott at datalink dot net dot au
              My mistake - after my upgrade (due to the security risk) I didn't re-set
              the ini file to allow file uploads again. I guess this directive is
              there to prevent unauthorised multipart submissions.

              For others experiencing this problem, check your ini file and ensure the
              following line exists:

              file_uploads = On
              [2 Mar 2002 6:07am CST] derick@php.net
              Making this bogus (user error)

              Derick
              Beantworte nie Threads mit mehr als 15 followups...
              Real programmers confuse Halloween and Christmas because OCT 31 = DEC 25

              Kommentar


              • #8
                Danke erstmal!

                file_uploads ist tatsächlich in der PHP Core Konfiguration nicht gesetzt.

                habe gerade ausnahmsweise einen halbwegs kooperativen Ansprechpartner in der Servicewüste Provider-hotline erreicht, der das checkt.

                Kommentar


                • #9
                  ich habe das selbe problem

                  allerdings: file_uploads steht auf 1

                  ausserdem: bei einem formular funktioniert es, bei einem anderen tritt dieser fehler auf

                  allerdings: nur der aller erste input wird nicht registriert, alle nachfolgenden schon

                  kurzerhand habe ich einfach ein hidden feld als erstes input feld rein gepfeffert, aber das ist freilich unfug

                  kann zu diesem phänomen jemand was berichten?

                  Kommentar


                  • #10
                    gut, dass ich keinen neuen thread dafür aufgemacht habe, denn sonst hätte ich viele antworten gekriegt, ich solle doch bitte die suchfunktion verwenden :-)

                    Kommentar


                    • #11
                      zeig mal code
                      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

                      Lädt...
                      X