How to Get the Current Page URL

Sometimes, you might want to get the current page URL that is shown in the browser URL window. For example if you want to let your visitors submit a blog post to Digg you need to get that same exact URL. There are plenty of other reasons as well. Here is how you can do that. (more…)

Posted in Php Code, Php Skills, Php Study. Comments Off on How to Get the Current Page URL »

How to let tag cloud show the same size font and in list style?

It is very easy to tag cloud show the same size font and in list style, there are 2 ways to do this:

1. Change sidebar.php in templates:

<li>

<h2>Tag Cloud</h2>

<?php wp_tag_cloud(‘smallest=8&largest=8&number=45&orderby=name&format=list’); ?> <!– wp_tag_cloud(‘smallest=8&largest=8&number=45&orderby=name&format=list’)–>
</li>

another way is change code in widgets.php inside include document:

function wp_widget_tag_cloud($args) {
extract($args);
$options = get_option(‘widget_tag_cloud’);
$title = empty($options[‘title’]) ? __(‘Tags’) : apply_filters(‘widget_title’, $options[‘title’]);

echo $before_widget;
echo $before_title . $title . $after_title;
wp_tag_cloud(”); //wp_tag_cloud(‘smallest=8&largest=8&number=45&orderby=name&format=list’);
echo $after_widget;
}

Posted in Php Skills, WordPress. Comments Off on How to let tag cloud show the same size font and in list style? »

Code to display visitors IP address on website

get_ip_list below is a function that you must call in order to get something.

function get_ip_list() {
$tmp = array();
if (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’]) && strpos($_SERVER[‘HTTP_X_FORWARDED_FOR’],’,’)) {
$tmp += explode(‘,’,$_SERVER[‘HTTP_X_FORWARDED_FOR’]);
} elseif (isset($_SERVER[‘HTTP_X_FORWARDED_FOR’])) {
$tmp[] = $_SERVER[‘HTTP_X_FORWARDED_FOR’];
}
$tmp[] = $_SERVER[‘REMOTE_ADDR’];
return $tmp;
}
echo echo implode(“,”,get_ip_list());

Posted in Php Functions, Php Skills. Comments Off on Code to display visitors IP address on website »

Add php code into html for lunarpage.com

Add php code into html for lunarpage.com linux host.

try this line in a blank .htaccess

AddType application/x-httpd-php php html

Posted in Php Code, Php Skills. Comments Off on Add php code into html for lunarpage.com »

Add php code into html for php5

AddType application/x-httpd-php5 .html .htm .php
AddHandler application/x-httpd-php5 .html .htm .php

Posted in Php Code, Php Skills. Comments Off on Add php code into html for php5 »

how to deal with a sentence as a page title?

<?php
$hotel=”  How to study PHP  “;
$hotel= trim($hotel);
$array=explode(” “, $hotel);

$hotel=implode(“-“, $array);
echo ($hotel);
?>

Posted in Php Skills. Comments Off on how to deal with a sentence as a page title? »

Php test Navigation engine laguage, and Syetem language

Php test Navigation engine laguage

< ?php echo $_SERVER["HTTP_USER_AGENT"]; ?>

Php test Syetem lang

< ?php echo $_SERVER["HTTP_ACCEPT_LANGUAGE"]; ?>

(more…)

Posted in Php Code, Php Skills. Comments Off on Php test Navigation engine laguage, and Syetem language »

Disordered Chinese Characters in Phpld

Open init.php, between
$db->SetFetchMode(ADODB_FETCH_ASSOC);
read_config($db);

add MySQL_query(“SET NAMES ‘latin1′”);

let them becomes: (more…)

Posted in PHP Link Directory, Php Skills. Comments Off on Disordered Chinese Characters in Phpld »

Using php to control many domains withing one web host

can build many web sites, with one web host, one site with one different domain, just using php, it can make you very happy, save your money.

$arrays=array(
’www.money.com’=>’money/index.html’,
’www.insurance.com’=>’insurance/index.html’,
’www.car.com’=>’car/index.html’,
’www.travel.com’=>’travel/index.html’,
’127.0.0.1’=>’forum/index.php’,
);
$url = $arrays[$_SERVER[’HTTP_HOST’]];
Header(”Location: $url”);
?> (more…)

Posted in Php Code, Php Skills. Comments Off on Using php to control many domains withing one web host »

Hide your Affiliate Links using PHP file

If you want to make more money and profit from your affiliate links, you need to display them in different way. Don’t use the default link generated by your affiliate program script. Instead, hide it by using PHP file.

(more…)

Posted in Php Code, Php Skills. Comments Off on Hide your Affiliate Links using PHP file »
12
King Php Science Welcome, you are from: 54.197.74.137