Redirect by PC or mobile access
July 25th, 2008 — adminphp code as follows:
$iswap = isset($_SERVER[’HTTP_ACCEPT’])? $_SERVER[’HTTP_ACCEPT’]:”;
if(strpos($iswap,”wap”)>0)
{
@header(”Location: /wap/”);
}
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
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 »
<?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”]; Read the rest of this entry »
If you’re looking for a simple static solution (an not an entire ad manager) use this
add in your init.php after the $tpl = get_tpl(… line Read the rest of this entry »
ucfirst — Make a string’s first character uppercase
example:
$coo= ‘clay desiccant!’;
$coo= ucfirst($desiccant); // Clay desiccant!
$bar = ‘CLAY DESICCANT!’;
$bar = ucfirst($bar); // CLAY DESICCANT!
$bar = ucfirst(strtolower($bar)); // Clay desiccant!
{if $category.ID == 0}
This is the description of my homepage. I can even include html.
{/if}
Note:the above code works, but the only problem is this added text also appears when using the search function from the home page. Read the rest of this entry »
$dirname=”E:/zhanzhongjie/chengbiao-com/chengbiao-com”;
$dir_handle=opendir($dirname);
while($file=readdir($dir_handle))
{
echo $file.”
“;
rename(”E:/zhanzhongjie/chengbiao-com/chengbiao-com/”. $file, “E:/zhanzhongjie/chengbiao-com/chengbiao-new/insurance-”.$file);
}
closedir($dir_handle) Read the rest of this entry »