Unicode UTF-8 characters in Wordpress Blog Title

Sometime back I was trying to put unicode characters(utf-8) in the title of a blog from wp-admin > settings > general. After saving it became like ?????????.

All pages had utf-8 in their meta tags so the issue was somewhere else. A working solution was found :

Read the rest of this entry »

Popularity: 8% [?]

Open View MS Access mdb files in Ubuntu Linux

MDB Viewer is a tool which can be used to open and view mdb files on Linux.
On Ubuntu it can be installed from synaptic via the command :

sudo apt-get install mdbtools-gmdb

Popularity: 7% [?]

Draw Plot Graphs with PHP

Googling up for graph plotting solutions in PHP , found these free libraries :

1. PHPLOT – Can create Pie Charts , Bar Graphs , Line Graphs , Point Graphs etc.

Read the rest of this entry »

Popularity: 2% [?]

Create AutoIncrement column/field in Apache Derby

While creating a table a particular column / field can be made autoincrement as :

CREATE TABLE students
(
id INTEGER NOT NULL GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
name VARCHAR(24) NOT NULL,
address VARCHAR(1024),
CONSTRAINT primary_key PRIMARY KEY (id)
) ;

Read the rest of this entry »

Popularity: 28% [?]

PHP redirect – go back to previous page

To go back to the previous page the superglobal variable $_SERVER can be used.
$_SERVER['HTTP_REFERER'] has the link to the previous page.

So to redirect simply :

#Method to go to previous page
function goback()
{
header("Location: {$_SERVER['HTTP_REFERER']}");
exit;
}

Read the rest of this entry »

Popularity: 5% [?]

PHP Format numbers to Indian Numerical System

The numerical system used in India differs from the Western system in terms of the placement of the thousands separator.

Example :
Number -> 1000000
Indian System -> 10,00,000 (Ten Lakh)
Western System -> 1,000,000 (1 Million)

Read the rest of this entry »

Popularity: 3% [?]

non-www to www redirection with .htaccess

Opening a domain as domain.com or www.domain.com takes to the same page. From the SEO perspective , many suggest that search engines may consider the two to be different sites. So the fix is to apply a redirection to redirect domain.com to www.domain.com

Read the rest of this entry »

Popularity: 1% [?]

Create short links using bit.ly from php

bit.ly is a simple url shortner which has an api , which can be called from within php to shorten links.

Code :

function get_short_url($url)
{
	$bitly_login = "your_login_name";
	$bitly_apikey = "your_api_key";

	$api_call = file_get_contents("http://api.bit.ly/shorten?version=2.0.1&longUrl=".$url."&login=".$bitly_login."&apiKey=".$bitly_apikey);

	$bitlyinfo=json_decode(utf8_encode($api_call),true);

	if ($bitlyinfo['errorCode'] == 0)
	{
		return $bitlyinfo['results'][urldecode($url)]['shortUrl'];
	}
	else
	{
		return false;
	}
}

Read the rest of this entry »

Popularity: 1% [?]

Create a deb file from source on Ubuntu

To create a .deb package file on Ubuntu you need a utility called checkinstall.
sudo apt-get install checkinstall

1. Extract the source of the application in a folder.
2. Run : ./configure
3. Run : make
4. Now run : sudo checkinstall

Read the rest of this entry »

Popularity: 2% [?]

Put flash in webpage – html page

Here is the simple code to put flash animation (swf file) on a webpage.

<object width="550" height="350" data="myalbum.swf" type="application/x-shockwave-flash">
<param name="quality" value="high" />
<param name="id" value="tech" />
<param name="name" value="tech" />
<param name="src" value="myalbum.swf" />
</object>

Popularity: 5% [?]