Bild als PHP-Code speichern

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

  • Bild als PHP-Code speichern

    Hallo Leute,

    ich bin vor kurzem auf ein Freeware PHP-Script gestossen, welches es erlaubte ein bild hochzuladen. Das Bild wurde in eine PHP-Datei umgewandelt, den man dann in Script einbinden kann.

    Leider finde ich es nicht mehr.

    Vielleicht wisst ihr was ich meine und könnt den link hier posten!

    Danke

  • #2
    Bau dir doch eine zentrale PHP-Datei, die als Parameter via GET den Namen des zu ladenden Bilder bekommt.
    Danach liest sie das Bild mittels readfile() ein und gibt es an den Browser aus mit den korrekten Headern.
    PHP Code:
    //bild.php?src=bild1

    switch($_GET['src']){
        case 
    'bild1':
            
    header('Content-type: image/jpg');
            
    readfile($_GET['src']);
        break;
        [...]

    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)

    Comment

    Working...
    X