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

Results 1 to 8 of 8
  1.     
    #1
    Member

    Default Adfocus doesn't return anything in cURL

    i am not getting any output from adfocus link using curl

    Code: 
    <?php
    $ch = curl_init ("http://adfoc.us/426491");
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt ($ch, CURLOPT_REFERER, "http://adfoc.us/*********1");
    $page = curl_exec ($ch);
    echo $page;
    ?>
    i just need to echo the whole source code of url
    torrfriend Reviewed by torrfriend on . Adfocus doesn't return anything in cURL i am not getting any output from adfocus link using curl :'( <?php $ch = curl_init ("http://adfoc.us/426491"); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt ($ch, CURLOPT_REFERER, "http://adfoc.us/*********1"); $page = curl_exec ($ch); echo $page; ?> Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    The reason why it doesn't work is because they require useragent and accept property in the header to be sent, maybe to prevent from bots.

    Adding useragent and accept property works:
    PHP Code: 
    <?php
    $ch 
    curl_init ("http://adfoc.us/426491");
    curl_setopt ($chCURLOPT_RETURNTRANSFERtrue);
    curl_setopt ($chCURLOPT_REFERER"http://adfoc.us/*********1");
    curl_setopt ($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0');
    curl_setopt ($chCURLOPT_HTTPHEADER, array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'));
    $page curl_exec ($ch);
    echo 
    $page;
    ?>
    You can use a textbox or encode html tags before printing to remove browser rendering:
    PHP Code: 
    <?php
    $ch 
    curl_init ("http://adfoc.us/426491");
    curl_setopt ($chCURLOPT_RETURNTRANSFERtrue);
    curl_setopt ($chCURLOPT_REFERER"http://adfoc.us/*********1");
    curl_setopt ($chCURLOPT_USERAGENT'Mozilla/5.0 (Windows NT 6.1; rv:12.0) Gecko/20100101 Firefox/12.0');
    curl_setopt ($chCURLOPT_HTTPHEADER, array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'));
    $page curl_exec ($ch);
    echo 
    '<textarea style="width:100%; height: 100%;">' $page '</textarea>';
    ?>

  4.     
    #3
    Member
    Website's:
    google.com
    adfocus is undergoin still some changes and bugs
    i contact their support and they said it will be fixed soon
    My Avatar is 100% Me.

  5.     
    #4
    Member
    Website's:
    YourVPNList.blinkweb.com
    by the way is is good profit from this site?

  6.     
    #5
    Member
    Website's:
    google.com
    i don't say adfocus is best nowdays not even adfly !
    i have jumped from them and using a new and stable one
    and paying on time every week without fail
    My Avatar is 100% Me.

  7.     
    #6
    Member
    Thanks soft
    so we need to analyse the header in source code too, i thought they check for referrer only

    Offtopic:
    (i saw the header using live http headers)
    so mate we need to add the things in " Accept: xxxxxxxxx " as HTTPHEADER?
    curl_setopt ($ch, CURLOPT_HTTPHEADER, array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8'));

    is it applicable for all sites mate....??

  8.     
    #7
    Respected Member
    Website's:
    DL4Everything.com Soft2050.in
    Accept Header tells what type of response the browser is looking for.
    So for this: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Expanded, asks for any of the following formats:
    - (X)HTML format (HTML First)
    - XML format
    - Finally */* means for any type of format.

    So it should be applicable for all sites

  9.     
    #8
    Member
    once again thanks buddy, now i understood

    ----

    Hi spartan, there is a lot of ways to monatizing sites, but these adfly/adfocus/linkbucks are worst than popup, just my opinion

    Note:
    now i am learning php, daily 30 minutes - 1 hour, sometime 2 hour in holiday

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SHOUTcastUK Return
    By UKInternetGroup in forum Hosting Discussion
    Replies: 6
    Last Post: 11th May 2012, 12:17 PM
  2. Need mods, Giving some thing in return.
    By Doublecrosser in forum Community Cooperative
    Replies: 8
    Last Post: 5th Oct 2010, 07:41 AM

Tags for this Thread

BE SOCIAL