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

Results 1 to 4 of 4
  1.     
    #1
    Member
    Website's:
    satiq.net

    Default Upload image to PixHost

    Hi,

    can anyone tell me how can I upload image to pixhost.org with Curl?

    Thanks
    skinner Reviewed by skinner on . Upload image to PixHost Hi, can anyone tell me how can I upload image to pixhost.org with Curl? Thanks Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    wscripts.net damnlolscript.com lulzjet.com
    PHP Code: 
    function upload_to_pixhost($img,$safe=0) {
        
        
    $imageUrl '';
        
    $pvars = array('img[]'=>"@".$img,'content_type'=>$safe,'tos'=>'on');
        
    $page get_page('http://www.pixhost.org/classic-upload/',$pvars,'','http://www.pixhost.org/classic-upload/');
        
    //echo '<textarea>'.htmlentities($page).'</textarea>';
        
    preg_match('~<div class="linksleft">Forum thumbnail:</div>\s+<div class="linksright"><input type="text" style="width:500px" onclick="javascript:highlight\(this\);" readonly="readonly" value="(.*?)"/></div>~',$page,$match);
        
    //print_r($match);
        
    $imageUrl $match[1];
        if(
    stristr($imageUrl,'pixhost.org')) return $imageUrl;
        else return 
    '';
    }

    $img 'D:\Ampps\www\test\0001.jpg';
    echo 
    upload_to_pixhost($img); 
    a curl function you can find here: http://wscripts.net/php-snippets/get-a-page-using-curl/

  4.     
    #3
    Member
    Website's:
    satiq.net
    it says:

    Code: 
    Could not connect to host: 
    http://www.pixhost.org/classic-upload/

  5.     
    #4
    Member
    Website's:
    satiq.net
    I've resolt..

    I write that code:

    PHP Code: 
    $imgpath "/some/file/in/some/directory.jpg"

    $agent"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080404 Firefox/2.0.0.14"

    $reffer"http://www.pixhost.org/classic-upload/"
    $cookie_file_path 'files/cookie.txt'
    $fp1 fopen($cookie_file_path,'wb');    
    if(!
    $fp1
    echo 
    'error opening cookie file'
    fclose($fp1); 

    $ch1 curl_init(); 
    curl_setopt($ch1CURLOPT_URL,"http://www.pixhost.org:8080/classic-upload/"); 
    curl_setopt($ch1CURLOPT_USERAGENT$agent); 
    curl_setopt($ch1CURLOPT_COOKIEFILE$cookie_file_path); 
    curl_setopt($ch1CURLOPT_COOKIEJAR$cookie_file_path); 
    curl_setopt($ch1CURLOPT_REFERER""); 
    curl_setopt($ch1CURLOPT_SSL_VERIFYPEER0); 
    curl_setopt($ch1CURLOPT_SSL_VERIFYHOST0); 
    curl_setopt($ch1CURLOPT_RETURNTRANSFER1); 
    curl_setopt($ch1CURLOPT_FOLLOWLOCATION1); 
    $html1 curl_exec($ch1); 


    $ch1 curl_init(); 
    curl_setopt($ch1CURLOPT_URL'http://www.pixhost.org:8080/classic-upload/"'); 
    curl_setopt($ch1CURLOPT_SSL_VERIFYPEER0); 
    curl_setopt($ch1CURLOPT_SSL_VERIFYHOST0); 
    curl_setopt($ch1CURLOPT_RETURNTRANSFER,1); 
    curl_setopt($ch1CURLOPT_REFERER,$reffer); 
    curl_setopt($ch1CURLOPT_POST1); 
    //curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 
    //curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
    // curl_setopt($ch, CURLOPT_COOKIESESSION, true); 
    curl_setopt($ch1CURLOPT_USERAGENT$agent);         
    curl_setopt($ch1CURLOPT_COOKIEFILE$cookie_file_path); 
    curl_setopt($ch1CURLOPT_COOKIEJAR$cookie_file_path); 
    curl_setopt($ch1CURLOPT_FOLLOWLOCATION,1); 
    $postResult curl_exec($ch1); 



    $data1 = array('content_type' => '1''img[]' => '@'.$imgpath,'tos'=>'on'); 
    curl_setopt($ch1CURLOPT_URL'http://www.pixhost.org:8080/'); 
    curl_setopt($ch1CURLOPT_SSL_VERIFYPEER0); 
    curl_setopt($ch1CURLOPT_SSL_VERIFYHOST0); 
    curl_setopt($ch1CURLOPT_RETURNTRANSFER,1); 
    curl_setopt($ch1CURLOPT_REFERER,'http://www.pixhost.org:8080/classic-upload/'); 
    curl_setopt($ch1CURLOPT_POST1); 
    curl_setopt($ch1CURLOPT_POSTFIELDS$data1); 
    curl_setopt($ch1CURLOPT_RETURNTRANSFER1); 
    curl_setopt($ch1CURLOPT_COOKIESESSIONtrue); 
    curl_setopt($ch1CURLOPT_USERAGENT$agent);         
    curl_setopt($ch1CURLOPT_COOKIEFILE$cookie_file_path); 
    curl_setopt($ch1CURLOPT_COOKIEJAR$cookie_file_path); 
    curl_setopt($ch1CURLOPT_FOLLOWLOCATION,1); 
    $postResult curl_exec($ch1); 

    if (
    curl_errno($ch1)) { 
    print 
    curl_error($ch1); 

    curl_close($ch1); 
    //print $postResult
    preg_match('~<div class="linksleft">HTML thumbmail:</div>\s+<div class="linksright"><input type="text" style="width:500px" onclick="javascript:highlight\(this\);" readonly="readonly" value="(.*?)"/></div>~',$postResult,$match);
        
    //print_r($match);
        
    $imageUrl $match[1];
       if(
    stristr($imageUrl,'pixhost.org')) echo $imageUrl;
        else return 
    ''
    It saves HTML thumbmail, it seems works well

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. PHP CURL Problem with Pixhost.org
    By heppinnz in forum Web Development Area
    Replies: 6
    Last Post: 20th Jun 2012, 05:10 PM
  2. Image upload script
    By rayzen921 in forum Web Application/Script Support
    Replies: 3
    Last Post: 11th Mar 2012, 06:17 PM
  3. [Selling] PixHost.in $1 (Site + Domain)
    By RNBxBeatz in forum Completed Transactions
    Replies: 17
    Last Post: 6th Jul 2011, 02:23 PM
  4. [Selling] freepicbay.org copy pixhost.org, php,mysql, images
    By jessepure in forum Completed Transactions
    Replies: 0
    Last Post: 12th May 2011, 09:50 PM
  5. Script to upload images to pixhost or imag
    By indahouse in forum Web Development Area
    Replies: 2
    Last Post: 14th Feb 2011, 01:30 PM

Tags for this Thread

BE SOCIAL