I want to insert ads, and they must change randomly (shuffle). I dont know ftp account for the site, I can only add just from my admin panel as an ads code.
I created these pages named r1.php:
$numbers = range(1, 3);
shuffle($numbers);
foreach ($numbers as $number) {
$rand .= $number.",";
mysqli_query("UPDATE random SET reklam='$rand' where id=1 ");
}
$sql = mysqli_query("SELECT reklam FROM random where id=1 limit 0,1 ");
$dongu = mysqli_fetch_row($sql);
$parca = explode(",",$dongu['0']);?>
<img src="r<?php echo $parca[0]; ?>.png" />
And this page named r2.php:
$numbers = range(1, 3);
shuffle($numbers);
foreach ($numbers as $number) {
$rand.=$number.",";
mysqli_query("UPDATE random SET reklam='$rand' where id=1 ");
}
$sql = mysqli_query("SELECT reklam FROM random where id=1 limit 0,1 ");
$dongu = mysqli_fetch_row($sql);
$parca = explode(",",$dongu['0']);?>
<img src = "r<?php echo $parca[1]; ?>.png" />
and I added an iframe
:
<iframe src="http:/www.mysite.com/r1.php" >
as well as:
<iframe src="http:/www.mysite.com/r2.php" >
It doesn't work because the same ads are showing, but I want to avoid the same ads on one page.
But there is 2 ads sub-bottom. Not one place there is 2 ads in one page with 2 places.
Is it possible to get these adds to shuffle with javascript (or other)?