Redirect by PC or mobile access
php code as follows: $iswap = isset($_SERVER[‘HTTP_ACCEPT’])? $_SERVER[‘HTTP_ACCEPT’]:”; if(strpos($iswap,”wap”)>0) { @header(“Location: /wap/”); }
Study PHP Skills, Share PHP Code
php code as follows: $iswap = isset($_SERVER[‘HTTP_ACCEPT’])? $_SERVER[‘HTTP_ACCEPT’]:”; if(strpos($iswap,”wap”)>0) { @header(“Location: /wap/”); }
Add php code into html for lunarpage.com linux host. try this line in a blank .htaccess AddType application/x-httpd-php php html
AddType application/x-httpd-php5 .html .htm .php AddHandler application/x-httpd-php5 .html .htm .php
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… Read moreLoad different pictures each time.
Ad the following code between head: <code> <script language=JavaScript> <!– var pic_ar=new Array(); var pic_arlink=new Array(); var adNum=0; pic_ar[0]=”img/ad1.jpg”; pic_ar[1]=”img/ad2.jpg”; pic_ar[2]=”img/ad3.jpg”; pic_ar[3]=”img/ad4.jpg”; pic_ar[4]=”img/ad5.jpg”; pic_ar[5]=”img/ad6.jpg”; pic_ar[6]=”img/ad7.jpg”; pic_ar[7]=”img/ad8.jpg”; pic_ar[8]=”img/ad9.jpg”; pic_ar[9]=”img/ad10.jpg”; pic_ar[10]=”img/ad11.jpg”; pic_ar[11]=”img/ad12.jpg”; var preloadedimages=new Array(); for (i=1;i<pic_ar.length;i++){ preloadedimages[i]=new Image(); preloadedimages[i].src=pic_ar[i]; } function… Read moreJavascript Changing Picture
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.
<?php $hotel=” How to study PHP “; $hotel= trim($hotel); $array=explode(” “, $hotel); $hotel=implode(“-“, $array); echo ($hotel); ?>
Want to change the seperator between categories in the title tag? At the moment the phpld generate the title as: home – category – category – category
<?php //get the current page URL that is shown in the browser URL window function curPageURL() { Â $pageURL = ‘http’; Â if ($_SERVER[“HTTPS”] == “on”) {$pageURL .= “s”;} Â $pageURL .= “://”; Â if ($_SERVER[“SERVER_PORT”] != “80”) { Â $pageURL .= $_SERVER[“SERVER_NAME”].”:”.$_SERVER[“SERVER_PORT”].$_SERVER[“REQUEST_URI”];