Wap Ads Help

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

6 replies · 642 views · started 18 years ago · 1 min read

3 participants
krazyguy Junior · 17 posts #1

how to put admob ads to my wapsite. how to install admob code. plz help

GiLL Senior · 356 posts #2

how to put admob ads to my wapsite. how to install admob code. plz help

go to admob site and login than click on Add Mobile Site fill everything there as you will see after then save it and click on Sites & Apps there you will your site which you added and in the corner you will see Install Code click on it there in bottom you will see a box ok now choose your code like PHP and copy that code and put in your site E.g index.php second way make a file like call it admob.php and past that code in it upload same dir and put this

include("admob.php");

in your index or any file where you want show adds . if you still have problem post here .and change

 define("ADMOB_MODE", "live");

where is

define("ADMOB_MODE", "test");

left wap stuff

krazyguy Junior · 17 posts #4

i add

include("admob.php"); in index.

idont understand next step

GiLL Senior · 356 posts #5

i add in index.

idont understand next step

post here your admob code and index.php

left wap stuff

inet Senior · 264 posts #6

i add in index.

idont understand next step

i will help you just pm me... i will assit every need.. yes free service from me..

first

you must get your admob id code at admob..

then put it on admob.php

then apply the previous instruction they said..

add

include("admob.php");

CODE<?php // AdMob Publisher Code // Language: PHP // Version: 20071126 // Copyright AdMob, Inc., All rights reserved

// change to "live" when ready to deploy define("ADMOB_MODE", "live");

function admob_append_params(&$params, $key, $val) { if(!empty($val)) $params .= ("&" . urlencode($key) . "=" . urlencode($val)); } function admob_append_headers(&$params) { $admob_ignore = array("HTTP_PRAGMA","HTTP_CACHE_CONTROL","HTTP_CONNECTION","HTTP_USER_AGENT","HTTP_COOKIE"); foreach ( array_keys( $_SERVER ) as $var ) { if ( substr( $var, 0, 4 ) == "HTTP" && !in_array( $var, $admob_ignore ) ) { $params .= "&" . urlencode("h[" . $var . "]" ) . "=" . urlencode( $_SERVER[$var] ); } } } function admob_ad($admob_params=array()) { // build url $admob_page_url = sprintf("http%s://%s%s", (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == TRUE ? "s": ""), $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ); $md5_sid = session_id(); if(!empty($md5_sid)) $md5_sid = md5($md5_sid); $admob_post = "s=" . $admob_params[ADMOB_SITE_ID]; admob_append_params($admob_post, "u", $_SERVER["HTTP_USER_AGENT"]); admob_append_params($admob_post, "i", $_SERVER["REMOTE_ADDR"]); admob_append_params($admob_post, "p", $admob_page_url); admob_append_params($admob_post, "t", $md5_sid); admob_append_params($admob_post, "v", ADMOB_VERSION); admob_append_params($admob_post, "d[pc]", $admob_params[ADMOB_PC]); admob_append_params($admob_post, "d[dob]", $admob_params[ADMOB_DOB]); admob_append_params($admob_post, "d[gender]", $admob_params[ADMOB_GENDER]); admob_append_params($admob_post, "k", $admob_params[ADMOB_KEYWORDS]); admob_append_headers($admob_post); if(ADMOB_MODE == "test") $admob_post .= "&m=test";

// request ad $admob_request = curl_init(); curl_setopt( $admob_request, CURLOPT_URL, ADMOB_ENDPOINT ); curl_setopt( $admob_request, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $admob_request, CURLOPT_TIMEOUT, ADMOB_TIMEOUT ); curl_setopt( $admob_request, CURLOPT_CONNECTTIMEOUT, ADMOB_TIMEOUT ); curl_setopt( $admob_request, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded")); curl_setopt( $admob_request, CURLOPT_POSTFIELDS, $admob_post ); $admob_contents = curl_exec( $admob_request ); if(isset($admob_contents) && ($admob_contents === TRUE || $admob_contents === FALSE)) { $admob_contents = ""; } $admob_error = curl_errno( $admob_request ); curl_close( $admob_request );

// output contents if (isset($admob_error) && $admob_error == CURLE_OPERATION_TIMEOUTED) { return "<img src="http://t.admob.com/li.php/c.gif/u/" . $admob_params[ADMOB_SITE_ID] . "/1/" . ADMOB_TIMEOUT . "/" . md5($admob_page_url) . "" alt="" width="1" height="1" />"; } else { return $admob_contents; } } define("ADMOB_SITE_ID", "ADMOB_SITE_ID"); define("ADMOB_ENDPOINT", "http://r.admob.com/ad_source.php"); define("ADMOB_VERSION", "20071126-PHPF-7d438f25dc3b900a"); define("ADMOB_TIMEOUT", 1); define("ADMOB_PC", "ADMOB_PC"); define("ADMOB_DOB", "ADMOB_DOB"); define("ADMOB_GENDER", "ADMOB_GENDER"); define("ADMOB_KEYWORDS", "ADMOB_KEYWORDS");

?>

<?php $admob_params = array( ADMOB_SITE_ID => "a146c1a1f699d41", // REQUIRED - get from admob.com ADMOB_PC => "", // OPTIONAL - Postal Code, e.g. "90210" ADMOB_DOB => "", // OPTIONAL - Date of Birth formatted like YYYYMMDD, e.g. "19800229" ADMOB_GENDER => "", // OPTIONAL - Gender, m[ale] or f[emale] ADMOB_KEYWORDS => "" // OPTIONAL - keywords, e.g. "sports baseball la dodgers" ); echo admob_ad($admob_params); // display an ad ?> <?php // request more ads by copying this snippet elsewhere on your page // echo admob_ad($admob_params); ?> <?php // AdMob Publisher Code // Language: PHP // Version: 20071126 // Copyright AdMob, Inc., All rights reserved // change to "live" when ready to deploy define("ADMOB_MODE", "live"); function admob_append_params(&$params, $key, $val) { if(!empty($val)) $params .= ("&" . urlencode($key) . "=" . urlencode($val)); } function admob_append_headers(&$params) { $admob_ignore = array("HTTP_PRAGMA","HTTP_CACHE_CONTROL","HTTP_CONNECTION","HTTP_USER_AGENT","HTTP_COOKIE"); foreach ( array_keys( $_SERVER ) as $var ) { if ( substr( $var, 0, 4 ) == "HTTP" && !in_array( $var, $admob_ignore ) ) { $params .= "&" . urlencode("h[" . $var . "]" ) . "=" . urlencode( $_SERVER[$var] ); } } } function admob_ad($admob_params=array()) { // build url $admob_page_url = sprintf("http%s://%s%s", (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == TRUE ? "s": ""), $_SERVER["HTTP_HOST"], $_SERVER["REQUEST_URI"] ); $md5_sid = session_id(); if(!empty($md5_sid)) $md5_sid = md5($md5_sid); $admob_post = "s=" . $admob_params[ADMOB_SITE_ID]; admob_append_params($admob_post, "u", $_SERVER["HTTP_USER_AGENT"]); admob_append_params($admob_post, "i", $_SERVER["REMOTE_ADDR"]); admob_append_params($admob_post, "p", $admob_page_url); admob_append_params($admob_post, "t", $md5_sid); admob_append_params($admob_post, "v", ADMOB_VERSION); admob_append_params($admob_post, "d[pc]", $admob_params[ADMOB_PC]); admob_append_params($admob_post, "d[dob]", $admob_params[ADMOB_DOB]); admob_append_params($admob_post, "d[gender]", $admob_params[ADMOB_GENDER]); admob_append_params($admob_post, "k", $admob_params[ADMOB_KEYWORDS]); admob_append_headers($admob_post); if(ADMOB_MODE == "test") $admob_post .= "&m=test"; // request ad $admob_request = curl_init(); curl_setopt( $admob_request, CURLOPT_URL, ADMOB_ENDPOINT ); curl_setopt( $admob_request, CURLOPT_RETURNTRANSFER, 1 ); curl_setopt( $admob_request, CURLOPT_TIMEOUT, ADMOB_TIMEOUT ); curl_setopt( $admob_request, CURLOPT_CONNECTTIMEOUT, ADMOB_TIMEOUT ); curl_setopt( $admob_request, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded")); curl_setopt( $admob_request, CURLOPT_POSTFIELDS, $admob_post ); $admob_contents = curl_exec( $admob_request ); if(isset($admob_contents) && ($admob_contents === TRUE || $admob_contents === FALSE)) { $admob_contents = ""; } $admob_error = curl_errno( $admob_request ); curl_close( $admob_request ); // output contents if (isset($admob_error) && $admob_error == CURLE_OPERATION_TIMEOUTED) { return "<img src=\"http://t.admob.com/li.php/c.gif/u/" . $admob_params[ADMOB_SITE_ID] . "/1/" . ADMOB_TIMEOUT . "/" . md5($admob_page_url) . "\" alt=\"\" width=\"1\" height=\"1\" />"; } else { return $admob_contents; } } define("ADMOB_SITE_ID", "ADMOB_SITE_ID"); define("ADMOB_ENDPOINT", "http://r.admob.com/ad_source.php"); define("ADMOB_VERSION", "20071126-PHPF-7d438f25dc3b900a"); define("ADMOB_TIMEOUT", 1); define("ADMOB_PC", "ADMOB_PC"); define("ADMOB_DOB", "ADMOB_DOB"); define("ADMOB_GENDER", "ADMOB_GENDER"); define("ADMOB_KEYWORDS", "ADMOB_KEYWORDS"); ?> <?php $admob_params = array( ADMOB_SITE_ID => "your id as publisher", // REQUIRED - get from admob.com ADMOB_PC => "", // OPTIONAL - Postal Code, e.g. "90210" ADMOB_DOB => "", // OPTIONAL - Date of Birth formatted like YYYYMMDD, e.g. "19800229" ADMOB_GENDER => "", // OPTIONAL - Gender, m[ale] or f[emale] ADMOB_KEYWORDS => "" // OPTIONAL - keywords, e.g. "sports baseball la dodgers" ); echo admob_ad($admob_params); // display an ad ?> <?php // request more ads by copying this snippet elsewhere on your page // echo admob_ad($admob_params); ?>

Services

Are you looking to take your wap or wapsite to a higher level? Do you want to stand out and rise above your competitors?

Below is a list of services I offer:

Wap Design and Customized Coding -The first way to stand out in a crowd is to have a brilliant and unique design for your wap or wapsite.

Rates

General consulting – My current hourly rate is $100 / hour. Custom Wapsite Community - My current rate is $500 / Wap Community Development.

GiLL Senior · 356 posts #7

i add in index.

idont understand next step

next step as i said read your admob.php file replace

define("ADMOB_MODE", "test");

with

define("ADMOB_MODE", "live");

but first you have to link test mode as you will see admob test and click on it after success page you edit live where is test in admob.php got it ?

left wap stuff

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