Imageshack Script

Dieses Thema im Forum "Webentwicklung" wurde erstellt von m4rQ, 27. März 2006 .

Schlagworte:
Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 27. März 2006
    Hi, ich hab bei google nach ein paar Upload Scripts gesucht und das Imageshack Script gefunden.
    Ich hab die Dateien entpackt und das Problem ist, dass es kein .php ist sondern irgendetwas anderes. Da ich kein php etc freak bin^^, frag ich euch ob ihr mir dabei helfen könnt!?!

    der Link zu der Seite -=Klick=-
     
  2. 27. März 2006
    Hey,


    hm...ich weiss zwar nicht, was dieser Hack genau machen soll, aber warum baust du dir nicht einen Button, der, wenn man draufklickt ein weiteres Fenster öffnet, wo du die Datei uppen kannst, und anschliessend den Code generiertbekommst.


    Das ist innerhalb von 3 Minuten eingebaut:

    Habe dir mal die TXT dafür angehangen. ISt wirklich super einfach....vieleicht reicht dir das ja
     
  3. 27. März 2006
    ich weiß nicht wirklich was ich da machen muss^^, ich hab meistens scripte die ich nur hochladen muss. könntest du mir das fertige script evtl. schicken? 10er hast schon
     
  4. 27. März 2006
    das ist ein perl script

    Code:
    Prerequisites
    -------------
    
    Here's a short list of what you will need to run this script.
    
    * a recent Perl version (5.6 or higher)
     http://www.perl.com/download.csp (NOTE: if you download the Windows Binaries,
     just click Next on the registration form, it's optional!)
    * Perl modules: LWP, HTTP::Cookies, HTTP::Request::Common (from the libwww-perl
     package)
     http://search.cpan.org/~gaas/libwww-perl-5.803
    * Perl module: HTML::Parser
     http://search.cpan.org/~gaas/HTML-Parser-3.45
    * Perl modules: Getopt::Long, Pod::Usage
     These modules are already included in the Perl distribution since version
     5.6, so there's no need to install them manually.
    
    NOTE: On Windows systems the latest ActivePerl distribution (and earlier
     versions probably too) already contains all neccessary modules, so you
     do not have to install them seperately.
    
    
     
  5. 27. März 2006
    wenn das nicht so viel arbeit, kann mir irgendjemand das so einstellen,dass ich das nur noch hochladen muss?
     
  6. 27. März 2006
    Hehe, bin heute im Scripting Hype... Also ich versuch es mal. Ganz simpel aber nur. Einfaches Formular usw., keine große Tabellenformatierung.

    upload.php
    PHP:
    <? php

    if (isset( $_POST [ 'submit' ])) {

        if (
    $_FILES [ 'datei' ][ 'size' ]) >  2000000 ) echo  "<font color=\"#ff0000\">Die Datei darf maximal 2 MB groß sein.</font>" ;
        else {

            
    $picid  substr ( microtime (), 0 , 8 );
            
    $result  mysql_query ( "select * from pics where picid = ' $picid '" );

            if (
    mysql_num_rows ( $result ))  $picid  substr ( microtime (), 0 , 8 );
            else {

                if (
    move_uploaded_file ( $_FILES [ 'datei' ][ 'tmp_name' ], $_FILES [ 'datei' ][ 'name' ])) {
                    
    mysql_query ( "insert into pics (picid,picname) values (' $picid ','" . $_FILES [ 'datei' ][ 'name' ]. "')" );
                    echo 
    "Die Datei wurde erfolgreich hochgeladen<br><br>" ;

                    echo 
    "Link zum Bild: <a href=\"show.php?id= $picid \">show.php?id= $picid </a><br>" ;
                    echo 
    "&lt;a href=\"show.php?id= $picid \"&gt;show.php?id= $picid &lt;/a&gt;<br><br>" ;

                    echo 
    "Link zum Thumb: <a href=\"thumb.php?id= $picid \">thumb.php?id= $picid </a><br>" ;
                    echo 
    "&lt;a href=\"thumb.php?id= $picid \"&gt;thumb.php?id= $picid &lt;/a&gt;<br><br>" ;

                    echo 
    "Thumbnail Link: <a href=\"show.php?id= $picid \"><img src=\"thumb.php?id= $picid \" border=\"0\" alt=\"Thumb\"></a>&gt;<br>" ;
                    echo 
    "&lt;a href=\"show.php?id= $picid \"&gt;&lt;img src=\"thumb.php?id= $picid \" border=\"0\" alt=\"Thumb\"&gt;&lt;/a&gt;<br><br>" ;

                    echo 
    "Foren Link zum Bild: [URL=LINK ZU DEINER URL!!!]show.php?id= $picid [/ URL ] <br>" ;
                    echo 
    "Foren Link zum Thumb: [URL=LINK ZU DEINER URL!!!]thumb.php?id= $picid [/ URL ] <br>" ;
                    echo 
    "Foren Link als Thumb: [URL=LINK ZU DEINER URL!!!]{bild-down: thumbs.php?id= $picid }
    [/URL]<br>"
    ;

                    echo 
    "Link zum Löschen: <a href=\"destroy.php?id= $picid \">destroy.php?id= $picid </a>" ;
                }
                else {
                    echo 
    "<font color=\"#ff0000\">Das Bild konnte nicht hochgeladen werden!</font><br>" ;
                    echo 
    "<a href=\"javascript:history.back()\">zurück</a>" ;
                }
            }
        }
    }
    else {

        echo 
    "<form action=\"upload.php\" method=\"post\">" ;
        echo 
    "    Pfad zum Bild: <input type=\"file\" name=\"datei\"><br>" ;
        echo 
    "    <input type=\"submit\" name=\"submit\">" ;
        echo 
    "</form>" ;

    }

    ?>
    show.php
    PHP:
    <? php

    if (isset( $_GET [ 'id' ])) {

        
    $result  mysql_query ( "select * from pics where picid = '" . $_GET [ 'id' ]. "'" );
        
    $row  mysql_fetch_array ( $result );
        echo 
    "<img src=\"images/" . $row [ 'picname' ]. "\" border=\"0\" alt=\"" . $row [ 'picname' ]. "\" title=\"" . $row [ 'picname' ]. "\">" ;

    }
    else echo 
    "<font color=\"#ff0000\">Ungültige/keine Pic-ID!</font>" ;

    ?>
    thumb.php
    PHP:
    <? php

    if (isset( $_GET [ 'id' ])) {

        
    $result  mysql_query ( "select * from pics where picid = '" . $_GET [ 'id' ]. "'" );
        
    $row  mysql_fetch_array ( $result );
        
    $picname  "images/" . $row [ 'picname' ];

        
    $size  getimagesize ( $picname );
        
    $width  $size [ 0 ];
        
    $height  $size [ 1 ];

        
    $new_width  140 ;
        
    $new_height  intval ( $height  $new_width  $width );

        if (
    $size [ 2 ] ==  1 ) {
            
    $old_image  imagecreatefromgif ( $picname );
            
    $new_image  imagecreate ( $width , $height );
            
    imagecopyresized ( $new_image , $old_image , 0 , 0 , 0 , 0 , $new_width , $new_height , $width , $height );
            
    imagegif ( $new_image );
        }
        elseif (
    $size [ 2 ] ==  2 ) {
            
    $old_image  imagecreatefromjpeg ( $picname );
            
    $new_image  imagecreatetruecolor ( $width , $height );
            
    imagecopyresized ( $new_image , $old_image , 0 , 0 , 0 , 0 , $new_width , $new_height , $width , $height );
            
    imagejpeg ( $new_image );
        }
        elseif (
    $size [ 2 ] ==  3 ) {
            
    $old_image  imagecreatefrompng ( $picname );
            
    $new_image  imagecreatetruecolor ( $width , $height );
            
    imagecopyresized ( $new_image , $old_image , 0 , 0 , 0 , 0 , $new_width , $new_height , $width , $height );
            
    imagepng ( $new_image );
        }

    }
    else echo 
    "<font color=\"#ff0000\">Ungültige/keine Pic-ID!</font>" ;

    ?>
    destroy.php
    PHP:
    <? php

    if (isset( $_GET [ 'id' ])) {

        
    mysql_query ( "delete from pics where picid = '" . $_GET [ 'id' ]. "'" );
        echo 
    "Das Bild wurde erfolgreich gelöscht!" ;

    }
    else echo 
    "<font color=\"#ff0000\">Ungültige/keine Pic-ID!</font>" ;

    ?>
    Du musst noch eine MySQL-Tabelle mit dem Namen 'pics' erstellen. Diese brauch ein Integer-Feld mit der Länge 8 und dem Namen 'picid' ein Varchar Feld, am besten mit der Länge 255 und dem Namen 'picname'.

    In Zeile 28-30 musst du dann noch die HTTP-URL angeben.

    Hab ich jetzt mal so improvisiert! Kp, obs richtig ist. Wenn nicht, werd ich es mir nochmal zur Brust nehmen. Aber hatte kein Bock, jetzt was riesiges zu proggen.
     
  7. 28. März 2006
    hat sich erledigt, 10er
    -closed-
     
  8. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.