WmZilla - Webmaster and Marketplace

The Next Generation Webmaster and Trade Forum

How do I make the PHP ad rotator function work?

sanjay123

New member

0

0%

Status

Offline

Posts

49

Likes

0

Rep

0

Bits

255

3

Months of Service

0%
Friend, please help me, it's not working, in the ads I can use Adsense! for rotation.

Check here: Shortener Test #1

```html
<html>
<head>
<title>Shortener Test #1</title>
</head>

<body>
<?php
// Load arrays with N banners codes
$banner[]= '<script>var adParams = {s: 1000141798, w: 728, h: 90, c: 2, blank: false}; </script><script src="//js.srcsmrtgs.com/js/ad.js"></script>';
$banner[]= '<script>var adParams = {s: 1000146845, w: 234, h: 60, c: 2, blank: false}; </script><script src="//js.srcsmrtgs.com/js/ad.js"></script>';
$banner[]= '<script>var adParams = {s: 1000159735, w: 234, h: 60, c: 2, blank: false}; </script><script src="//js.srcsmrtgs.com/js/ad.js"></script>';
$banner[]= 'banner code N';

// Select a banner randomly from 0 to N
$r = rand(0, count($banner) -1);

// Display the banner
echo $banner[$r];
?>
</body>
</html>
```
 

249

6,622

6,642

Top