Have an account? Sign in
Login  Register  Facebook
adsense revenue sharing script??
how can i make adsense revenue sharing script or code

specially the code which control the sharing percentage
Started: September 17, 2011 Latest Activity: September 17, 2011 php revenue script
1 Answer
use this simple code
echo (rand(0,3) < 3) ?  \'first_pub\' : \'second_pub\';
This will echo first_pub in 75% of all visits. and an simple application:
<?php
	
$db = @mysql_connect(\'localhost\', \'root\', \'\') or die(\"Could not connect database\");
@mysql_select_db(\'links\', $db) or die(\"Could not select database\");
     
if (isset($_GET[\'id\'])) {
    //get the id from the url
    $id = intval($_GET[\'id\']);
    // your pub info
    $site_pub = \'xxxxxxxxxxxxxxx\';
    $pub_prefix = \'pub-\';
    //select the link info
    $sql = @mysql_query(\"select * FROM `links` where `id` = \'$id\'\");
    //make it array
    $link = @mysql_fetch_array($sql);
        if (!$link) {
                echo \'the link did not found\';
        	} else {
                if (!empty($link[\'pub\'])) {
                        $pub = (rand(0,3) < 3) ?  $pub_prefix.$site_pub : $pub_prefix.$link[\'pub\'];
                	} else {
                        $pub = $pub_prefix.$site_pub;
                } 
         echo \'the link:\'.$link[\'link\'].\'<br>\'; 
         echo \'the pub:\'.$pub.\'<br>\';            	   
        }
	} else {
    echo \'there is no link selected\';
}    
       
    
?>
and the mysql:
--
-- Table structure for table `links`
--

CREATE TABLE IF NOT EXISTS `links` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `link` varchar(255) COLLATE utf8_bin NOT NULL,
  `pub` varchar(255) COLLATE utf8_bin NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_bin AUTO_INCREMENT=2 ;

--
-- Dumping data for table `links`
--

INSERT INTO `links` (`id`, `link`, `pub`) VALUES
(1, \'http://www.jooria.com\', \'10000000000000\');

Posted: MacOS
In: September 17, 2011

Your Answer

xDo you want to answer this question? Please login or create an account to post your answer