Image Hosting script

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

  • Image Hosting script

    Also mein problem ist das das script auf php5 geschrieben ist oder so(hab so kaum ahnung)

    aber der server vom freund wo ich eine webspace hab unterstüzt das nicht.. was kann ich da machen?

    Er meint da kann man was ändern.
    Die fehlermeldung:
    Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/kunden/webs/sivo/www/upload.php on line 79

    PHP-Code:
    <html>
    <head>
    <title>Upload</title>
    </head>
    <body><?
    if($action){
    $path = "uploads/"; // Url zum Speicher Ordner
    $filename = "wichsfr0sch_";
    $deindomain = "http://www.wichsfr0sch.de/
    $time=time();
    if ($HTTP_POST_FILES['userfile']['tmp_name']<> 'none')
       {   
             $file = $HTTP_POST_FILES['userfile']['name'];
             $temp = $HTTP_POST_FILES['userfile']['tmp_name'];
             $path_parts = pathinfo($file);
             $filename = "wichsfr0sch_" . $time . "." . $path_parts["extension"];
               $dest = $path.$filename;
       
             copy($temp, $dest);
       
          echo "Die Datei ist auf dem Server! <br><br>";
          echo "Url der Datei: <a href=\"$deindomain$path$filename\" target=\"_blank\">".$deindomain.$path.$filename;
         echo "</a>";
       }
    } else { ?>

    <form method="post" enctype="multipart/form-data" action="<?php echo $PHP_SELF ?>">
    <input type="hidden" name="MAX_FILE_SIZE" value="400000">
    <br>
    <strong>File Upload</strong> <br>
    <br>
    <input name="userfile" type="file" size=40>
    <br>
    <br>
    <input type="submit" name="action" value="Speichern">
    </form><? } ?></body>
    </html>

  • #2
    $deindomain = "http://www.wichsfr0sch.de/

    da fehlt ein "; am ende. die syntaxhervorhebung macht es schon deutlich. allerdings seh ich nichts, was nur für php5-only sprechen würde. register globals beachten: $HTTP_POST_FILES durch $_FILES ersetzen. aus $PHP_SELF wird $_SERVER['PHP_SELF']

    http://de.php.net/manual/de/features.file-upload.php
    Zuletzt geändert von hall; 07.04.2007, 17:13.
    mfg

    Kommentar


    • #3
      omg ok mehr war das nicht

      dank dir für die schnelle antwort

      Kommentar


      • #4
        Jetzt sieht man was... aber er lädt keine daten hoch

        http://wichsfr0sch.de/upload.php

        ich hab ihn auch schon auf der scheiss funpic space ausprobiert... da ging es von anfang an gut

        Kommentar


        • #5
          Jetzt sieht man was... aber er lädt keine daten hoch
          Verwende besser move_uploaded_file() anstatt copy()
          Hast du es auch mit einer Datei versucht, die kleiner ist als
          Code:
          <input type="hidden" name="MAX_FILE_SIZE" value="400000">
          ?

          Gruss

          tobi
          Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

          [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
          Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

          Kommentar


          • #6
            ja klar hab das jetzt mal geändert ... aber es kommt keine fehlermeldung und es wir auch nichts hochgeladen .... schreibrechte usw sind auch vergeben

            http://wichsfr0sch.de/upload.php

            PHP-Code:
            <?
            if($action){
            $path = "uploads/"; // Url zum Speicher Ordner
            $filename = "wichsfr0sch_";
            $deindomain = "http://www.wichsfr0sch.de/";
            $time=time();
            if ($_FILES['userfile']['tmp_name']<> 'none')
               {   
                     $file = $_FILES['userfile']['name'];
                     $temp = $_FILES['userfile']['tmp_name'];
                     $path_parts = pathinfo($file);
                     $filename = "wichsfr0sch_" . $time . "." . $path_parts["extension"];
                       $dest = $path.$filename;
               
                     move_uploaded_file($temp, $dest);
               
                  echo "Die Datei ist auf dem Server! <br><br>";
                  echo "Url der Datei: <a href=\"$deindomain$path$filename\" target=\"_blank\">".$deindomain.$path.$filename;
                 echo "</a>";
               }
            } else { ?>

            <form method="post" enctype="multipart/form-data" action="<?php echo $_SERVER['PHP_SELF'?>">
            <input type="hidden" name="MAX_FILE_SIZE" value="600000">
            <br>
            <strong>File Upload</strong> <br>
            <br>
            <input name="userfile" type="file" size=40>
            <br>
            <br>
            <input type="submit" name="action" value="Speichern">
            </form><? } ?>
            Zuletzt geändert von ToOFatToFly; 12.04.2007, 02:37.

            Kommentar


            • #7
              1. error_reporting auf E_ALL?
              2. was ist $action?
              3. $_POST/$_FILES mit print_r oder var_dump kontrolliert?
              4. Überprüfung des Dateinamens auf <> 'none' sieht gleich mehrfach unsinnig aus.
              I don't believe in rebirth. Actually, I never did in my whole lives.

              Kommentar


              • #8
                Original geschrieben von wahsaga
                1. error_reporting auf E_ALL?
                2. was ist $action?
                3. $_POST/$_FILES mit print_r oder var_dump kontrolliert?
                4. Überprüfung des Dateinamens auf <> 'none' sieht gleich mehrfach unsinnig aus.
                sorry ich versteh dich aber nicht

                Kommentar


                • #9
                  Sollte es nicht vielmehr heissen
                  PHP-Code:
                  if($_POST['action']){... 
                  ich vermute mal, dass wenn du error_reporting(E_ALL) als erste Zeile deines Scripts geschrieben hättest, dann wäre dir ein Fehler gemeldet worden...

                  Gruss

                  tobi
                  Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

                  [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
                  Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

                  Kommentar


                  • #10
                    kann mir denn einfach einer so ändern das er geht
                    Ich probier schon so lange herum

                    Kommentar


                    • #11
                      Hast du jetzt endlich
                      PHP-Code:
                      error_reporting(E_ALL); 
                      gemacht ? Wenn ja dann allfällige Fehlermeldungen posten. Wenn noch nicht gemacht, dann MACH ES ENDLICH !

                      Ohne zu wissen ob PHP einen Fehler wirft kann dir keiner den Code anpassen (wobei ich meine Zweifel habe, dass dir jemand den Code auch wirklich anpassen würde)

                      Gruss

                      tobi
                      Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

                      [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
                      Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

                      Kommentar


                      • #12
                        ah ja

                        Notice: Undefined variable: action in /var/kunden/webs/sivo/www/upload.php on line 74

                        PHP-Code:
                        if($action){ 
                        steht in der line
                        Zuletzt geändert von ToOFatToFly; 13.04.2007, 17:09.

                        Kommentar


                        • #13
                          PHP-Code:
                          if(!empty($_POST['action'])){ 
                          btw würde ich das Script besser gleich auf den Müll werfen
                          h.a.n.d.
                          Schmalle

                          http://impressed.by
                          http://blog.schmalenberger.it



                          Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
                          ... nur ohne :-)

                          Kommentar


                          • #14
                            oh danke kommt keine fehlermerldung mehr aber die datei ist noch immer nicht auf dem server xD

                            http://wichsfr0sch.de/upload.php
                            Zuletzt geändert von ToOFatToFly; 13.04.2007, 17:20.

                            Kommentar


                            • #15
                              nimm dir nochmal wahsagas post vor. sowas nennt sich debugging und ohne das, wirst du nicht weiterkommen.

                              print_r($_FILES);

                              was steht da drin?
                              Zuletzt geändert von hall; 13.04.2007, 18:15.
                              mfg

                              Kommentar

                              Lädt...
                              X