Addmob Php Server Side Adds

Started on the old forum in July 2008 · view the original in the archive · old links redirect here

3 replies · 889 views · started 18 years ago · 1 min read

2 participants
dhruva Junior · 36 posts #1

hello friends can someone explain me how to use the admob or google adsense php server side adds in my wap site. Because i dont know how to make them to work. Thanks in advance to you all kind ppl

WhiteWarrior Principal · 1,419 posts #2

Depending On The Script You're Using.. Here's A Well Known Code For Admob...

function ads()
{
    $mob_mode = "test";
    $mob_alternate_link = "";
    $mob_ua = urlencode(getenv("HTTP_USER_AGENT"));
    $mob_ip = urlencode($_SERVER['REMOTE_ADDR']);
    if ($mob_mode == 'live')
        $mob_m = "&m";
    $mob_url = '[url]http://ads.admob.com/ad_source.php?s=a14708270e268bc&u='[/url] . $mob_ua .
        '&i=' . $mob_ip . $mob_m;
    @$mob_ad_serve = fopen($mob_url, 'r');
    if ($mob_ad_serve)
    {
        while (!feof($mob_ad_serve))
            $mob_contents .= fread($mob_ad_serve, 1024);
        fclose($mob_ad_serve);
    }
    $mob_link = explode("><", $mob_contents);
    $mob_ad_text = $mob_link[0];
    $mob_ad_link = $mob_link[1];
    if (isset($mob_ad_link) && ($mob_ad_link != ''))
        $ret = "<a href=\"$mob_ad_link\">$mob_ad_text</a>";
    else
        $ret = $mob_alternate_link;

    return $ret;
}

Just Find The

 $mob_url = '[url]http://ads.admob.com/ad_source.php?s=a14708270e268bc&u='[/url] . $mob_ua .

Line And Change The a14708270e268bc Code To Your Own ....

WhiteWarrior Principal · 1,419 posts #4

thanks for your help brother. Thank you very very much

You're Welcome.

Topic Closed

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close