Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit

Closed Thread
 
LinkBack Thread Tools Display Modes
Old 01-01-2008, 03:07 PM   #1 (permalink)
Be CoOl rAp RuLeZ !!!
 
krates's Avatar
 
Join Date: Feb 2007
Posts: 1,968
Wink Displaying random advertisement through php like google + bidvertiser...

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” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://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=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>

</script>

<?php

}

if ($a == “2″) {

?>

<!– Begin BidVertiser code –>

<SCRIPT LANGUAGE=”JavaScript1.1″ src=”http://bdv.bidvertiser.com/BidVertiser.dbm?pid=&bid=” type=”text/javascript”></SCRIPT>

<noscript><a href=”http://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


http://www.easytutorial.info/php-1/d...nt-through-php

Thanks
krates
__________________
iPhone 3G 16GB + Samsung I450 + Sennheiser CXL 400 + PSP Phat + Samsung NC10

Previous phones: N73ME , W810I , Asus P320
krates is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 01-01-2008, 03:51 PM   #2 (permalink)
Broken In
 
gowtham's Avatar
 
Join Date: Jun 2006
Location: Vijayawada
Posts: 145
Default Re: Displaying random advertisement through php like google + bidvertiser...

^^ tnx for it. though i am not going to use it.
__________________
There is always a better way to do it. Go find it!

Thomas Alava Edison
gowtham is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
GTA Coke Advertisement.. very cool amitava82 Chit-Chat 18 04-11-2007 01:57 PM
software for removing advertisement from recorded tv agasti Software Q&A 6 24-09-2006 11:51 PM
adsense and bidvertiser champ_rock QnA (read only) 3 27-07-2006 08:55 AM
Advertisement Space william QnA (read only) 4 01-03-2006 08:36 PM


All times are GMT +5.5. The time now is 09:08 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2