krates
Be CoOl rAp RuLeZ !!!
Sometimes you want to display something randomly this tutorial is going to teach how to display two company advertisement on the same page like google and bidvertiser.
Syntax:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “*www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”*www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
</head>
<body>
<?php
$a = rand (1,2);
if ($a == “1″) {
?>
<script type=”text/javascript”>
<!–
google_ad_client = “”;
//728×90, created 12/31/07
google_ad_slot = “1167745697″;
google_ad_width = 728;
google_ad_height = 90;
//–>
</script>
<script type=”text/javascript”
src=”*pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
<?php
}
if ($a == “2″) {
?>
<!– Begin BidVertiser code –>
<SCRIPT LANGUAGE=”JavaScript1.1″ src=”*bdv.bidvertiser.com/BidVertiser.dbm?pid=&bid=” type=”text/javascript”></SCRIPT>
<noscript><a href=”*www.bidvertiser.com/bdv/BidVertiser/bdv_advertiser.dbm”>pay per click</a></noscript>
<!– End BidVertiser code –>
<?php
}
?>
</body>
</html>
You must have understand now that we assign a randomly between 1 and 2 and then check if a = 1 then display google advertisement and if a = 2 then display bidvertiser advertisement.
And no chance of ban because they will not be showing together
If you really like do comment on my blog
*www.easytutorial.info/php-1/displaying-random-advertisement-through-php
Thanks
krates
Syntax:
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “*www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”*www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Untitled Document</title>
</head>
<body>
<?php
$a = rand (1,2);
if ($a == “1″) {
?>
<script type=”text/javascript”>
<!–
google_ad_client = “”;
//728×90, created 12/31/07
google_ad_slot = “1167745697″;
google_ad_width = 728;
google_ad_height = 90;
//–>
</script>
<script type=”text/javascript”
src=”*pagead2.googlesyndication.com/pagead/show_ads.js”>
</script>
<?php
}
if ($a == “2″) {
?>
<!– Begin BidVertiser code –>
<SCRIPT LANGUAGE=”JavaScript1.1″ src=”*bdv.bidvertiser.com/BidVertiser.dbm?pid=&bid=” type=”text/javascript”></SCRIPT>
<noscript><a href=”*www.bidvertiser.com/bdv/BidVertiser/bdv_advertiser.dbm”>pay per click</a></noscript>
<!– End BidVertiser code –>
<?php
}
?>
</body>
</html>
You must have understand now that we assign a randomly between 1 and 2 and then check if a = 1 then display google advertisement and if a = 2 then display bidvertiser advertisement.
And no chance of ban because they will not be showing together
If you really like do comment on my blog
*www.easytutorial.info/php-1/displaying-random-advertisement-through-php
Thanks
krates