Mit PHP ein Bild aus dem Internet laden

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mit PHP ein Bild aus dem Internet laden

    Hi all,
    wie kann ich ein Bild einlesen, dass im Internet liegt?
    Danach sollte es wieder gespeichert werden.

    Danke für die Hilfe im Voraus!

    MFG
    Sellay
    ----> Besucht mein Auktionshaus http://www.sellay.de <----

  • #2
    fopen() ?
    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 |


    Comment


    • #3
      ;-) und dann einfach die url angeben?
      Hm..wenn das so wäre, dann frag ich mich, warum ich hier gepostet habe.

      MFG
      Sellay
      ----> Besucht mein Auktionshaus http://www.sellay.de <----

      Comment


      • #4
        und wie machst du nach fopen() weiter?

        fgets() oder fread() ?

        letzteres wäre angebracht, da es sich um eine bin-datei (bild) handelt.
        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 |


        Comment


        • #5
          Hm...
          das müßte gehen:
          PHP Code:
          $template fopen ("http://seite.de/index.html""r");

          $a=0;
          while (
          $zeilen fread($template1000000)){
          $buffer[$a] = $zeilen;
          $a++;
          }
          fclose ($template); 
          ----> Besucht mein Auktionshaus http://www.sellay.de <----

          Comment


          • #6
            nein. weil das nicht in ein array gehört. und du auch eine bilddatei laden willst. KEIN HTML-FILE

            das sollte passen.
            PHP Code:
            $template fopen ("http://seite.de/bilddatei.gif""r");

            while (
            $zeilen fread($template1000000)) $buffer.= $zeilen;
            fclose ($template); 
            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 |


            Comment


            • #7
              PHP Code:
              $template fopen ("http://seite.de/bilddatei.gif""r");

              while (
              $zeilen fread($template1000000)) $buffer.= $zeilen;
              fclose ($template); 
              eher so ,oder:
              PHP Code:
              $template fopen ("http://seite.de/bilddatei.gif""r");

              while (
              $zeilen fread($template1000000)) {
              $buffer.= $zeilen;
              }
              fclose ($template); 
              Und in der Variable $buffer ist jetzt das bild drinne? Also ist kein Array?
              Ich kenne den . nach dem $buffer nämlich nicht. Was hat der zu bedeuten?

              MFG
              Sellay
              ----> Besucht mein Auktionshaus http://www.sellay.de <----

              Comment


              • #8
                das .= ist die kurzschreibweise für

                $buffer = $buffer . $zeile;


                die {} brauche ich auch nicht unbedingt, wenn ich nur einen befehl in der schleife hab.

                in $buffer sollte das bild enthalten sein.
                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 |


                Comment


                • #9
                  TIPP: ----> Besuch auch mal das Manual http://www.php.net/manual/de/ <----

                  um deiner signatur gleich/ähnlich/nahe zu kommen

                  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 |


                  Comment

                  Working...
                  X