Load different pictures each time.

Just add the following codes within the body:

<script language=”JavaScript”>

var how_many_ads = 5
var now = new Date()
var sec = now.getSeconds()
var ad = sec % how_many_ads;
ad +=1;

if (ad==1){
url=”http://kingphp.com“;
alt=”ad1″;
banner=”img/ad1.jpg”;
width=”240″;
height=”320″;
}

if (ad==2) {
url=”http://kingphp.com“;
alt=”ad2″;
banner=”img/ad2.jpg”;
width=”240″;
height=”320″;
}

if (ad==3) {
url=”http://kingphp.com“;
alt=”ad3″;
banner=”img/ad3.jpg”;
width=”240″;
height=”320″;
}

if (ad==4) {
url=”http://kingphp.com“;
alt=”ad4″;
banner=”img/ad4.jpg”;
width=”240″;
height=”320″;
}

if (ad==5) {
url=”http://kingphp.com“;
alt=”ad5″;
banner=”img/ad5.jpg”;
width=”240″;
height=”320″;
}

document.write(’<center>’);
document.write(’<a href=\”‘ + url + ‘\” target=\”_blank\”>’);
document.write(’<img src=\”‘ + banner + ‘\” width=’)

That’s all.

</script>

Javascript Changing Picture

Ad the following code between head:



add the following code in the body:

That’s all.

PHP to detect mobile phones

The most efficient way to detect mobile phones with PHP, this simply queries the accept headers, the user agent and checks for any tell tale signs that the browser we’re sniffing is a mobile device. Read the rest of this entry »