Pages: [1]   Go Down
Send this topic | Print
Author Topic: How to integrate ads in wapsite created with 110mb.com  (Read 490 times)
downwap
Member
*
Offline Offline

Posts: 3


WWW
« on: June 15, 2009, 09:48:25 PM »

I have created a wapsite http://downwap.110mb.com on this server to get php support and to enable the users to get the correct language (HTML/WML) according to their browser.This worked successfully.Now when I thought that I should integrat some ads in my site, I didn't get success in doing so with "wen.ru" server on which I created site.The reason was very simple, many free servers don't support php,jsp,c# and .net. So I tried this with 110mb.But I am not getting success.The ad script doesn't returned any error but it is not displaying ads too.I am using two ad providers mkhoj and admob.Please help me.
Logged
enews
E-News Portal
Active Member
**
Offline Offline

Posts: 74


WWW
« Reply #1 on: June 15, 2009, 10:32:03 PM »

I have created a wapsite http://downwap.110mb.com on this server to get php support and to enable the users to get the correct language (HTML/WML) according to their browser.This worked successfully.Now when I thought that I should integrat some ads in my site, I didn't get success in doing so with "wen.ru" server on which I created site.The reason was very simple, many free servers don't support php,jsp,c# and .net. So I tried this with 110mb.But I am not getting success.The ad script doesn't returned any error but it is not displaying ads too.I am using two ad providers mkhoj and admob.Please help me.
Does your scirpt use mysql queries? If it does so, you have to pay for MySQL support http://www.110mb.com/upgrade-free-plan.php
« Last Edit: June 15, 2009, 10:37:52 PM by enews » Logged

robleyd
Official 110mb Guru
********
Online Online

Posts: 5648

Ask before you PM


« Reply #2 on: June 15, 2009, 10:45:36 PM »

Are you expecting ads to be embedded in your page? You currently have a link to admob -
Code:
<a href="http://ads.admob.com/link_list.php?s=a14a1fa18917df3">Some Great Sites</a>
which might not be what you should be doing.

There seems to be nothing on that page which references mkhoj.
Logged

I once had a hard drive clunk-clicking
Strange noises, weird sounds and tick-ticking
I thought I would wait
And procrastinate...
But now all my data is missing
--------------
dd, a dump, a data dump
read a line from standard in
$USER, the name I call my self
make - a long long time to run
.so a library that is shared
.ko it's not the same as .so
tee, a redirect with in and out
and brings us back to dd d d d
rstips
Member
*
Offline Offline

Posts: 22


WWW
« Reply #3 on: June 16, 2009, 08:57:56 AM »

copy and paste the code to your site. Modifying it like you seem to have down is illegal and against their ToS
Also, if the advertiser calls for MySQL queries, you have to pay for MySQL support.
Logged

downwap
Member
*
Offline Offline

Posts: 3


WWW
« Reply #4 on: June 21, 2009, 03:32:59 PM »

Please tell me if it uses my sql or can be integrated properly
<?php
// AdMob Publisher Code
// Language: PHP (curl)
// Version: 20081105
// Copyright AdMob, Inc., All rights reserved
// Documentation at http://developer.admob.com/wiki/Main_Page

$admob_params = array(
  'PUBLISHER_ID'      => 'a1', // Required to request ads. To find your Publisher ID, log in to your AdMob account and click on the "Sites & Apps" tab.
  'ANALYTICS_ID'      => 'your_analytics_site_id', // Required to collect Analytics data. To find your Analytics ID, log in to your Analytics account and click on the "Edit" link next to the name of your site.
  'AD_REQUEST'        => true, // To request an ad, set to TRUE.
  'ANALYTICS_REQUEST' => false, // To enable the collection of analytics data, set to TRUE.
  'TEST_MODE'         => true, // While testing, set to TRUE. When you are ready to make live requests, set to FALSE.
  // Additional optional parameters are available at: http://developer.admob.com/wiki/AdCodeDocumentation
  'OPTIONAL'          => array()
);

// Optional parameters for AdMob Analytics (http://analytics.admob.com)
//$admob_params['OPTIONAL']['title'] = "Enter Page Title Here"; // Analytics allows you to track site usage based on custom page titles. Enter custom title in this parameter.
//$admob_params['OPTIONAL']['event'] = "Enter Event Name Here"; // To learn more about events, log in to your Analytics account and visit this page: http://analytics.admob.com/reports/events/add

/* This code supports the ability for your website to set a cookie on behalf of AdMob
 * To set an AdMob cookie, simply call admob_setcookie() on any page that you call admob_request()
 * The call to admob_setcookie() must occur before any output has been written to the page (http://www.php.net/setcookie)
 * If your mobile site uses multiple subdomains (e.g. "a.example.com" and "b.example.com"), then pass the root domain of your mobile site (e.g. "example.com") as a parameter to admob_setcookie().
 * This will allow the AdMob cookie to be visible across subdomains
 */
//admob_setcookie();

/* AdMob strongly recommends using cookies as it allows us to better uniquely identify users on your website.
 * This benefits your mobile site by providing:
 *    - Improved ad targeting = higher click through rates = more revenue!
 *    - More accurate analytics data (http://analytics.admob.com)
 */
 
// Send request to AdMob. To make additional ad requests per page, copy and paste this function call elsewhere on your page.
echo admob_request($admob_params);

/////////////////////////////////
// Do not edit below this line //
/////////////////////////////////

// This section defines AdMob functions and should be used AS IS.
// We recommend placing the following code in a separate file that is included where needed.

function admob_request($admob_params) {
  static $pixel_sent = false;

  $ad_mode = false;
  if (!empty($admob_params['AD_REQUEST']) && !empty($admob_params['PUBLISHER_ID'])) $ad_mode = true;
 
  $analytics_mode = false;
  if (!empty($admob_params['ANALYTICS_REQUEST']) && !empty($admob_params['ANALYTICS_ID']) && !$pixel_sent) $analytics_mode = true;
 
  $protocol = 'http';
  if (!empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) != 'off') $protocol = 'https';
 
  $rt = $ad_mode ? ($analytics_mode ? 2 : 0) : ($analytics_mode ? 1 : -1);
  if ($rt == -1) return '';
 
  list($usec, $sec) = explode(' ', microtime());
  $params = array('rt=' . $rt,
                  'z=' . ($sec + $usec),
                  'u=' . urlencode($_SERVER['HTTP_USER_AGENT']),
                  'i=' . urlencode($_SERVER['REMOTE_ADDR']),
                  'p=' . urlencode("$protocol://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']),
                  'v=' . urlencode('20081105-PHPCURL-acda0040bcdea222'));

  $sid = empty($admob_params['SID']) ? session_id() : $admob_params['SID'];
  if (!empty($sid)) $params[] = 't=' . md5($sid);
  if ($ad_mode) $params[] = 's=' . $admob_params['PUBLISHER_ID'];
  if ($analytics_mode) $params[] = 'a=' . $admob_params['ANALYTICS_ID'];
  if (!empty($_COOKIE['admobuu'])) $params[] = 'o=' . $_COOKIE['admobuu'];
  if (!empty($admob_params['TEST_MODE'])) $params[] = 'm=test';

  if (!empty($admob_params['OPTIONAL'])) {
    foreach ($admob_params['OPTIONAL'] as $k => $v) {
      $params[] = urlencode($k) . '=' . urlencode($v);
    }
  }

  $ignore = array('HTTP_PRAGMA' => true, 'HTTP_CACHE_CONTROL' => true, 'HTTP_CONNECTION' => true, 'HTTP_USER_AGENT' => true, 'HTTP_COOKIE' => true);
  foreach ($_SERVER as $k => $v) {
    if (substr($k, 0, 4) == 'HTTP' && empty($ignore[$k]) && isset($v)) {
      $params[] = urlencode('h[' . $k . ']') . '=' . urlencode($v);
    }
  }
 
  $post = implode('&', $params);
  $request = curl_init();
  $request_timeout = 1; // 1 second timeout
  curl_setopt($request, CURLOPT_URL, 'http://r.admob.com/ad_source.php');
  curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($request, CURLOPT_TIMEOUT, $request_timeout);
  curl_setopt($request, CURLOPT_CONNECTTIMEOUT, $request_timeout);
  curl_setopt($request, CURLOPT_HTTPHEADER, array('Content-Type: application/x-www-form-urlencoded', 'Connection: Close'));
  curl_setopt($request, CURLOPT_POSTFIELDS, $post);
  list($usec_start, $sec_start) = explode(' ', microtime());
  $contents = curl_exec($request);
  list($usec_end, $sec_end) = explode(' ', microtime());
  curl_close($request);

  if ($contents === true || $contents === false) $contents = '';

  if (!$pixel_sent) {
    $pixel_sent = true;
    $contents .= "<img src=\"$protocol://p.admob.com/e0?"
              . 'rt=' . $rt
              . '&amp;z=' . ($sec + $usec)
              . '&amp;a=' . ($analytics_mode ? $admob_params['ANALYTICS_ID'] : '')
              . '&amp;s=' . ($ad_mode ? $admob_params['PUBLISHER_ID'] : '')
              . '&amp;o=' . (empty($_COOKIE['admobuu']) ? '' : $_COOKIE['admobuu'])
              . '&amp;lt=' . ($sec_end + $usec_end - $sec_start - $usec_start)
              . '&amp;to=' . $request_timeout
              . '" alt="" width="1" height="1"/>';
  }
 
  return $contents;
}

function admob_setcookie($domain = '', $path = '/') {
  if (empty($_COOKIE['admobuu'])) {   
    $value = md5(uniqid(rand(), true));
    if (!empty($domain) && $domain[0] != '.') $domain = ".$domain";
    if (setcookie('admobuu', $value, mktime(0, 0, 0, 1, 1, 2038), $path, $domain)) {
      $_COOKIE['admobuu'] = $value; // make it visible to admob_request()
    }
  }
}

or i can use any other ad code with this
Logged
ESI Portal
Vietnamese
Super Authority member
******
Offline Offline

Posts: 1582

Hãy tìm kiếm trước khi hỏi - Search before ask


WWW
« Reply #5 on: June 21, 2009, 06:42:40 PM »

Do they support ads on wapsite ?
Normally, ads networks only support on websites.
Logged

English: http://www.esiportal.110mb.com
Tiếng Việt: http://www.esiportal.110mb.com/vn/
Nếu vấn đề của bạn đã được giải quyết, xin hãy thêm [Resolved] trong tiêu đề (subject) của topic mà bạn đã đưa ra.
Anh không thích em, đơn giản bởi vì anh quá yêu em
Em không xinh, đơn giản bởi vì em quá đẹp
Nếu em chết, anh cũng không khóc, đơn giản bởi vì anh sẽ chết theo em
downwap
Member
*
Offline Offline

Posts: 3


WWW
« Reply #6 on: June 22, 2009, 02:56:56 AM »

Do they support ads on wapsite ?
Normally, ads networks only support on websites.
yes admob.com,mkhoj.com,zestadz.com are the providers who are only made for wapsite. Question is this possible in 110mb.com free hosting or not.Therefore i posted the ad code they provided.
Logged
ESI Portal
Vietnamese
Super Authority member
******
Offline Offline

Posts: 1582

Hãy tìm kiếm trước khi hỏi - Search before ask


WWW
« Reply #7 on: June 23, 2009, 12:31:52 AM »

I found out this paragraph on help page of zestadz.com
Quote
Please note:
Once the site is created, it will be in the pending status (needs approval) and you will be able to pull ads only on auto approval, which usually takes less than 24 hours. Once your account is approved, you will be able to see the ads available for your network.
Or you can show your code on here to i try to view it.
Logged

English: http://www.esiportal.110mb.com
Tiếng Việt: http://www.esiportal.110mb.com/vn/
Nếu vấn đề của bạn đã được giải quyết, xin hãy thêm [Resolved] trong tiêu đề (subject) của topic mà bạn đã đưa ra.
Anh không thích em, đơn giản bởi vì anh quá yêu em
Em không xinh, đơn giản bởi vì em quá đẹp
Nếu em chết, anh cũng không khóc, đơn giản bởi vì anh sẽ chết theo em
frendz4ever
Member
*
Offline Offline

Posts: 22


WWW
« Reply #8 on: July 04, 2009, 08:25:45 PM »

Dont put this long code put the short code. I mean to say is admob gives u 2 types of link codes so try the short code and put the code on your homepage file i.e index file.
Logged
Pages: [1]   Go Up
Send this topic | Print
Jump to: