Activity Stream
48,167 MEMBERS
6902 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 3 of 3
  1.     
    #1
    Member

    Thumbs up PHP CURL LulzImg Uploader

    PHP CURL LulzImg Uploader

    I started learning PHP and decided to share with you my first script:

    PHP Code: 
    <?php

        
    /* 
            PHP CURL LulzImg Uploader
            @author: heppinnz
            @site: http://musicdl.org/
        */

        
    $file $argv[1];
        
    $link $argv[2];

        
    $ch curl_init();
        
    curl_setopt($chCURLOPT_HEADER0);
        
    curl_setopt($chCURLOPT_VERBOSE0);
        
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
    curl_setopt($chCURLOPT_USERAGENT"Mozilla/5.0 (Windows NT 5.1; rv:6.0.1) Gecko/20100101 Firefox/6.0.1");
        
    curl_setopt($chCURLOPT_URL"http://lulzimg.com/app.php");
        
    curl_setopt($chCURLOPT_POSTtrue);
            
    $post = array(
                
    "image" => "@".$file,
                
    "uploadtype" => "image",
                
    "submit" => ""
            
    );
        
    curl_setopt($chCURLOPT_POSTFIELDS$post);
        
    $result curl_exec($ch);
        
    curl_close($ch);
        
        
    file_put_contents($link$result);

        echo 
    'Image Uploaded to Lulzimg.com';
        
    ?>
    Usage:
    Code: 
    php lulzimg.php image.jpg link.txt
    Have a Nice Day !!!
    heppinnz Reviewed by heppinnz on . PHP CURL LulzImg Uploader PHP CURL LulzImg Uploader I started learning PHP and decided to share with you my first script: <?php /* PHP CURL LulzImg Uploader @author: heppinnz @site: http://musicdl.org/ Rating: 5

  2.   Sponsored Links

  3.     
    #2
    It begins...
    Good job. However, what you've coded is a script that can only be called from command line. You could code another that can actually be used via a normal browser call. Use the $_GET server vars to get the data (or $_POST if you plan on expanding it) and upload to the app.php

  4.     
    #3
    Member
    Good job. However, what you've coded is a script that can only be called from command line. You could code another that can actually be used via a normal browser call. Use the $_GET server vars to get the data (or $_POST if you plan on expanding it) and upload to the app.php
    thank you ! I'll think about your proposal in the next version

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [req] php curl filepost.com uploader
    By heppinnz in forum Web Development Area
    Replies: 23
    Last Post: 7th Jan 2012, 06:11 PM
  2. LulzImg Image Uploader in PHP
    By BlaZe in forum Web Development Area
    Replies: 1
    Last Post: 11th Dec 2011, 07:09 AM
  3. [Help] PHP Curl Uploader to RapidShare Problem
    By heppinnz in forum Web Development Area
    Replies: 2
    Last Post: 29th Nov 2011, 06:28 AM
  4. [Hiring] Paid Uploader - MagikalMusic.com - Uploader for Music Albums
    By Young Star-G in forum Completed Transactions
    Replies: 10
    Last Post: 18th Oct 2010, 07:43 PM
  5. fileserver error uploader file & image uploader
    By logitec100 in forum Webmaster Resources
    Replies: 0
    Last Post: 16th Sep 2010, 10:05 PM

Tags for this Thread

BE SOCIAL