Lets Rejoice in the Beautiful Game

by Noman Muhammad

The greatest show on earth (FIFA World Cup 2010) is knocking at the door. Yesterday I hear the theme song for this world cup though it was announced may be on the November' 09. Hearing the song I just feel the emotion of supporting my team again. Lyrics of that song is simply awesome. Here is the lyrics:

---------------------------------------------
Ooooooh Wooooooh

Give me freedom, give me fire, give me reason, take me higher
See the champions, take the field now, you define us, make us feel proud
In the streets are, exaliftin , as we lose our inhabition,
Celebration its around us, every nation, all around us

Singin forever young, singin songs underneath that sun
Lets rejoice in the beautiful game.
And together at the end of the day.

WE ALL SAY

When I get older I will be stronger
They'll call me freedom Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes back

When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes

Oooooooooooooh woooooooooohh hohoho

Give you freedom, give you fire, give you reason, take you higher
See the champions, take the field now, you define us, make us feel proud
In the streets are, exaliftin, every loser in ambition,
Celebration, its around us, every nations, all around us

Singin forever young, singin songs underneath that sun
Lets rejoice in the beautiful game.
And together at the end of the day.

WE ALL SAY

When I get older, I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes back

When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes

Wooooooooo Ohohohoooooooo ! OOOoooooh Wooooooooo

WE ALL SAY !
When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes back

When I get older I will be stronger
They'll call me freedom
Just like a wavin' flag
And then it goes back
And then it goes back
And then it goes

Wooo hooooo hohohohoooooo

And everybody will be singinit
Wooooooooo ohohohoooooo
And we are all singinit

---------------------------------------------

The song is really inspirational. I don't know whether it enriches the spirit of the players but it really inspires supporters to support their team. So, best wishes to my favorite team Argentina :)

Hope to see smiling Messi with the cup @ 11 July' 10.

Import Blog Post as Notes in Facebook

by Noman Muhammad

First click on the "Account" button. Now Select "Application Settings".




















Then from the page click on 'Profile' next to the 'Notes'



After the page opens, click on 'Go to Application'



When the page opens, click on 'Import a blog'



Then on the Web URL text box type your blog address and the press 'Start Importing' ...



After importing confirm it. All the blog posts will be saved as notes.

!!! Enjoy :)

Two Articles that Inspire Me to Live more Meaningfully

by Noman Muhammad

I sometimes characterize me as an Escapist. But sometimes try to be responsible in some issues. For that I often read many articles on life. I find two articles that visualize life more meaningful then I thought. Basically one of the two articles is a speech delivered by Steve Jobs, CEO of Apple computer and another is a blog post by Stephen Downes.
The speech by Steve Jobs, CEO of Apple computer was delivered at Stanford University. I got this text from this link. The title says "You have got to find what you love, Jobs says". This attracts me very much and I read the text very quickly. It was simply amazing story. I was very much inspired by this

... you can't connect the dots looking forward; you can only connect them looking backwards. So you have to trust that the dots will somehow connect in your future. You have to trust in something ...
.
This is quite inhaling to love work more meaningfully.

I get the second article here. Its a large post and I read the whole post within a short time. But it really create impacts on my mind for long. Some lines of this post is really matter of deep thinking
What is worth doing? That is up to you to decide. I have chosen to dedicate my life to helping people obtain an education. Others seek to cure diseases, to explore space, to worship God, to raise a family, to design cars, or to attain enlightenment. If you don't decide what is worth doing, someone will decide for you, and at some point in your life you will realize that you haven't done what is worth doing at all. So spend some time, today, thinking about what is worth doing. You can change your mind tomorrow. But begin, at least, to guide yourself somewhere.


I really love the sentence from the Steve Jobs' speech "Stay Hungry, Stay Foolish"

Dynamically detect Language and add CSS accordingly

by Noman Muhammad

In blog sites the blog owner allows visitors to comment on his blog post. If the site is local or regional like Somewherein, Amar Blog some visitors have tendency to put comment in their native language, on the other hand some visitors always put comments in english. There is a small problem when displaying the comments on the site. If the blog owner has a class for the div where all the comments will be displayed and define font-family for english language then bangla comments will be very difficult to see and vice-versa. So if we can dynamically detect the language of each comments and define separate classes for different language we can show the comments in appropriate way. Google Code provides an API to detect the language of content. We can use this for our purpose. Here i'll show a simple implementation to assign different DIV class for different Languages.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script src="http://www.google.com/jsapi?key=API_KEY"></script>
<script type="text/javascript">

google.load("language", "1");

function initialize() {
var text = document.getElementById("text").innerHTML;

// Detect the language of the text.
google.language.detect(text, function(result) {
var detected = document.getElementById("detected");
// If there wasn't an error in the request
if (!result.error) {
var langCode = result.language;
var langName;

// Loop through the languages enum so that we can find the actual name of the language.
// Learn about the languages enum here:
// http://code.google.com/apis/ajaxlanguage/documentation/reference.html#LangNameArray
for (var i in google.language.Languages) {
var thisLangCode = google.language.Languages[i];
if (thisLangCode == langCode) {
// If we find the language code, store the language name.
langName = i;
break;
}
}

// Se the detected language.
if(langName == "BENGALI")
{
document.getElementById("text").setAttribute("class", "bn");
}
else
{
document.getElementById("text").setAttribute("class", "en");
}
}
});
}
google.setOnLoadCallback(initialize);

</script>
</head>
<body>
<div id="content">
<div id="text">share-facts.blogspot.com</div>
<div id="detected"/>
</div>
</body>
</html>


Here content of the DIV with id="text" will be examined then the class of that DIV will added accordingly.

Note: on line 5 API_KEY will be replaced by a valid API key.

Simple cURL example using PHP

by Noman Muhammad

cURL library allows us to connect to different servers using a variety of protocols. This is used for transferring files with URL syntax. In most of the cases we use cURL to display a specific portion of another site in our site. By using cURL at first we retrieve the contents of the site that we targeted and then parse the retrieved contents to show the specific portion using preg_match(). Here I'll show a simple example to retrieve and show the stock market price in my site from Yahoo!. At first I have to open Yahoo! in my browser. Then view the source of the page and identify that the stock market price is shown in between <dl class="markets clearfix strong small"> and </dl>. So this is my targeted portion. I'll use this tag to excerpt my targeted portion from the total contents. Full code is as follows:


<html>
<head>
<title>cURL Example</title>
</head>
<body>
<div style="margin-left:30px">
<?php
//URL of targeted site
$url = "http://m.www.yahoo.com/";
$ch = curl_init();

// set URL and other appropriate options
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// grab URL and pass it to the browser

$output = curl_exec($ch);

//Regular expression to excerpt the targeted portion
preg_match('/<dl class="markets clearfix strong small">(.*)<\/dl>/is', $output, $matches);
echo $matches[0];

// close curl resource, and free up system resources
curl_close($ch);
?>
</div>
</body>
</html>


Very simple, isn't it? Now by using our own css we can show the data in our own way.

Fixing Transparent Image in IE6

by Noman Muhammad

IE6 doesn't support transparent image. There are many ways to use transparent image in IE6. Here is a way that I use to show the transparent image in IE6 using CSS. CSS part for it is as bellows.


#header
{
background:url(logo.png) no-repeat;
height:109px;
width:507px;
}

*html #header
{
background-image:none;
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src="logo.png");
}


this "*html #header" part is only for IE6 i.e only IE6 will recognize this portion. One drawback of using this is we have to use absolute url to the image (i.e if logo.png is in the images folder(not in the css folder) of the site we have to write absolute url to that image. like: http://www.mysitename.com/images/logo.png).
Another drawback is links (i.e <a></a>) somwtimes become unclickable and forms become unfocusable. To get rid of it we have use postion:relative for a tag. i.e

a
{
postion:relative;
}

Bangla Typing using Google Transliteration

by Noman Muhammad

We can use Google Transliteration to type in Bengali on any web-site. It converts English characters to the characters used in Bengali. It offers us to type Bengali words phonetically in English script and then have them appear in Bengali. Its not translation, it does not change meaning rather it simply converts the sound of the word from English alphabet to Bengali alphabet. For example, typing "Bangladesh" transliterates into Bengali as বাংলাদেশ.
Its a small piece of code that stores on our browser(s). Visit this link to know how to enable this option to the various browsers.

Some Interesting Google Search Technique

by Noman Muhammad

We always search our query in Google. There are huge set of techniques by which we can search in Google more accurately. I collect and show some of them here that I frequently use. Those techniques are very simple but provide very fruitful result :) .

1. Whenever we search for more than one keyword (i.e. computer programming, here we use 2 key word. a) computer b) programming) at a time Google will handle this keyword using a method called Boolean Default. Google's Boolean default is 'AND'; that means if we enter query words without modifiers, Google will search for all of them. If we search for:

computer programming

Google will search for all the words. If we want to specify that either word is acceptable, we can put an 'OR' between each item:
computer OR programming

If we want to exclude a query item from search results, use a -.(minus sign or dash:
computer -programming

note that there is no space after the (-) sign.

2. To search for a phrase use "" surrounding the phrase. like:
"Some Interesting Google Search Technique"


3. Period (.) and Asterisk (*) can also be used as traditionally used.

4. To search anything from a specific site use 'site:site_name'.
google site:share-facts.blogspot.com

This will search for the term google only in the specified site.

note that there is no space after the (:) sign.

5. To restrict search to title of web pages we can use 'intitle:search_keyword'
intitle:google


6. Use 'inurl:search_keyword' to restrict search to the URLs of web pages.
inurl:google


7. To search in body text use 'intext:search_keyword'
intext:html


8.Searches for text in a page's link anchors
inanchor:"google desktop"


9. To search for a specific filetype use 'filetype:desired_file_type'
bangladesh filetype:pdf


10. To search a copy of the page that Google indexed even if that site/page is no longer available at its original URL or has since changed its content completely. This is particularly useful for site/pages that change often.
cache:share-facts.blogspot.com


11. To get the definition of search keyword 'define:search_keyword'.
define:physics


12. To find lyrics use
"lyrics_phrase" lyrics


13. To get the time of Dhaka
time dhaka

Adding Digg Button on Blogspot Post

by Noman Muhammad

Digg is the social content website where we submit our favorite content. Its a very good idea to have a button on the site content so that visitor easily submit that content to digg. To show digg button on blogger post we to put some code on the template.

1.) Find the below line on the blogger template (its found when "Expand Widget Templates" is clicked).

<p><data:post.body/></p>


2.) Now replace this above code with

<div style='float:left; margin-right:10px;'>
<script type='text/javascript'>
digg_url='<data:post.url/>';
</script>
<script src='http://digg.com/tools/diggthis.js' type='text/javascript'/>
</div>
<p><data:post.body/></p>

This will show the digg button on ur post's left top corner. To change button's orientation simply change div orientation.

Install Google Desktop on 64 bit Vista

by Noman Muhammad

Google Desktop can not be installed normally on 64 bit Windows Vista. But we can install it from command line by '/force'.

To do so, first download google desktop. Then open the Command prompt and go to the installer directory, type the command 'googledesktopsetup.exe /force' and press Enter. Thats all ...

Adding SyntaxHighlighter JS to blogspot

by Noman Muhammad

SyntaxHighlighter is a bunch of Javascript files to help a developer/coder to post code snippets to website/blog and have it look pretty. It supports multiple language and its very easy to use and deploy it. Download SyntaxHighlighter.
Now extract the contents of the package and upload the Scripts and Styles folder to any host or website which can be linked from the blogspot site.
To make it work, now we need to edit our blog's template and add the following code after the <!-- end outer-wrapper --> tag:


<link href='http://[HOST URL]/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://[HOST URL]/shCore.js'/>

<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script>

Now we need to add support for the languages we want. For example to add support for the language php and ruby we need to link to two files. shBrushPhp.js and shBrushRuby.js.
Another Interesting thing that Its not really needed to upload the code/files as those files are already hosted by google.code.
We can easily lined up to those files. So, the above code snippet with support for PHP and RUBY will be as below.

<link href='http://syntaxhighlighter.googlecode.com/svn-history/r57/trunk/Styles/SyntaxHighlighter.css' rel='stylesheet' type='text/css'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r57/trunk/Scripts/shCore.js'/>

<script language='javascript'>
dp.SyntaxHighlighter.BloggerMode();
dp.SyntaxHighlighter.HighlightAll('code');
</script<

<!--Support for php and ruby : -->
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r57/trunk/Scripts/shBrushPhp.js'/>
<script language='javascript' src='http://syntaxhighlighter.googlecode.com/svn-history/r57/trunk/Scripts/shBrushRuby.js'/>

Syntaxhighlighter supports pre and textarea tags, but it will not work automagically, we need to put our code into the <pre> or <textarea>.

To add some php code to our blog we to put our code as follows:
<pre name="code" class="php">
---- PHP code goes here ----
</pre>

Similarly for Ruby Code:
<pre name="code" class="ror">
---- RUBY code goes here ----
</pre>

See details on that page

One important notice from Overview of SyntaxHighlighter Trying to highlight 10kb worth of text will result in JavaScript being aborted because of long execution time.

Command line PHP in Windows

by Noman Muhammad

In Linux (Ubuntu, Fedora) OS we have the PHP executable available in shell, so we can run command line php script. But in windows to do so, we have to set PHP executable as Windows path variable.
We can do that in two ways ...

1. Open the command prompt (start -> run -> cmd)
and type: set PATH=%PATH%;C:\path_to_php
here, "C:\path_to_php" is the physical folder where php.exe is located. In my case its on C:\xampp\php.

Now we can run PHP script from anywhere we want like this:
D:\>php -v
PHP 5.2.5 (cli) (built: Nov 8 2007 23:18:51)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
with Zend Extension Manager v1.2.0, Copyright (c) 2003-2007, by Zend Technologies
with Xdebug v2.0.2, Copyright (c) 2002-2007, by Derick Rethans

Main problem of this method is this will affect only a single command prompt.

2. The second method will affect all command prompts. First, right click on "My Computer", then click on "Properties" - a dialog box with some tabs will appear.
Now from the tab named "Advanced" click on the button "Environment Variables". This will open the Environment Variables box. Now choose the Path variable from the system variables box and click Edit.
Append the variable value with:

;C:\path_to_php

here, "C:\path_to_php" is the physical folder where php.exe is located. In my case its on C:\xampp\php.
';' character is used to separate directories in the var, so be sure it’s present.

Thats all.

Copy to Clipboard !!! using Javascript

by Noman Muhammad

Copy to clipboard functionality is very useful when we want to copy any particular content of a web page automatically. I search over the net to know how to implement it. I found that almost every tutorial use the javascript function "execCommand()". Here is an example how I use it:


<body>
<script type="text/javascript">
function ClipBoard()
{
holdtext.innerText = copytext.innerText;
Copied = holdtext.createTextRange();
Copied.execCommand("RemoveFormat");
Copied.execCommand("Copy");
}
</script>


<SPAN ID="copytext" STYLE="background-color:pink">
COPY This Line!
</SPAN>

<TEXTAREA ID="holdtext" STYLE="display:none;"></TEXTAREA>
<BUTTON onClick="ClipBoard();">Copy to Clipboard</BUTTON>
</body>


When I click on the button the line "COPY This Line!" will be copied to the clipboard and then I can paste it anywhere.
But its not a solution of my problem when i open my page on Mozilla Firefox browser.
As per I know Firefox doesn't support the javascript function "execCommand()".

After some googling I find this link which solve my problem both for IE and FireFox. Here is my implementation of this:

<html>
<head>Copy to Clipboard</head>
<body>
<script type="text/javascript">
function copy_to_clipboard(text)
{
if(window.clipboardData)
{
window.clipboardData.setData('text',text);
}
else
{
var clipboarddiv=document.getElementById('divclipboardswf');
if(clipboarddiv==null)
{
clipboarddiv=document.createElement('div');
clipboarddiv.setAttribute("name", "divclipboardswf");
clipboarddiv.setAttribute("id", "divclipboardswf");
document.body.appendChild(clipboarddiv);
}
clipboarddiv.innerHTML='<embed src="clipboard.swf" FlashVars="clipboard='+
encodeURIComponent(text)+'" width="0" height="0" type="application/x-shockwave-flash"></embed>';
}
}
</script>

<input type="text" id="rt" value="" />
<input type="button" value="Copy" onclick="copy_to_clipboard(document.getElementById('rt').value);" />

</body>
</html>


To use it for firefox I have to download the flash (.swf) file from here and placed at path where this function is placed or else source parameter for embed tag to be changed to correct path where the flash file is been placed.
I also need firefox plugins for flash player as it depends on flash.
Now if I write something on the text box and then press the button the written text on the input box will be copied to the clipborad.

It works very fine. :)

Fckeditor: Image resize on Upload

by Noman Muhammad

Fckeditor (Html text editor) v-2.6.4 does not have automatic image resizing feature on upload or at least i don't know :( whether this editor has this feature. So to be able to resize picture on upload via fckeditor i bring some changes on "commands.php" file of fckeditor files. This file located on '\editor\filemanager\connectors\php' of the fckeditor folder. Open this file and

1. go to line # 219. It looks like


move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;

This line is under the function 'FileUpload'

2. Now change the line to

if($sExtension == 'jpg' || $sExtension == 'jpeg' || $sExtension == 'gif' )
{
$uploadedfile = $_FILES['NewFile']['tmp_name'];

// Create an Image from it so we can do the resize
$src = imagecreatefromjpeg($uploadedfile);

// Capture the original size of the uploaded image
list($width,$height)=getimagesize($uploadedfile);

// For my purposes, I have resized the image to be
// 300 pixels wide, and maintain the original aspect
// ratio. This prevents the image from being "stretched"
// or "squashed". If you prefer some max width other than
// 300, simply change the $newwidth variable
$newwidth=300;
$newheight=($height/$width)*$newwidth;
$tmp=imagecreatetruecolor($newwidth,$newheight);

// this line actually does the image resizing, copying from the original
// image into the $tmp image
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);

// now write the resized image to disk. I have assumed that you want the
// resized, uploaded image file to reside in the ./images subdirectory.
$filename = $_FILES['NewFile']['tmp_name'];
imagejpeg($tmp,$filename,100);
move_uploaded_file( $filename, $sFilePath ) ;
imagedestroy($src);
imagedestroy($tmp);
}
else
{
move_uploaded_file( $oFile['tmp_name'], $sFilePath ) ;
}

3. thats all.

It works for me and hope will for U :)

Scrolling PHP News Ticker

by Noman Muhammad

We often show latest news from various News Site RSS feed in our site. We can show this news as like as scrolling news in the TV channels. We called it news ticker. Here i show the steps that i do to show those news like TV channel scrolling news. I use this javascript file to do this. Here is my steps

1. create a index.php file and add these lines between body tag:

<DIV ID="TICKER" STYLE="width:520px; overflow:hidden"  onmouseover="TICKER_PAUSED=true" onMouseOut="TICKER_PAUSED=false">
<?php
include("xmlparser.php");
?>
</DIV>
<script type="text/javascript" src="webticker_lib.js" language="javascript"></script>


2. Download the webticker_lib.js javascript file from here

3. create a .php file name xmlparser.php and put those line:

<?php

$insideitem = false;
$tag = "";
$title = "";
$description = "";
$link = "";

function startElement($parser, $name, $attrs) {
global $insideitem, $tag, $title, $description, $link;
if ($insideitem) {
$tag = $name;
} elseif ($name == "ITEM") {
$insideitem = true;
}
}

function endElement($parser, $name) {
global $insideitem, $tag, $title, $description, $link;
if ($name == "ITEM") {
printf("<a href='%s' target='_blank'>%s</a> ",
trim($link),htmlspecialchars(trim($title)));
$title = "";
$description = "";
$link = "";
$insideitem = false;
}
}

function characterData($parser, $data) {
global $insideitem, $tag, $title, $description, $link;
if ($insideitem) {
switch ($tag) {
case "TITLE":
$title .= $data;
break;
case "DESCRIPTION":
$description .= $data;
break;
case "LINK":
$link .= $data;
break;
}
}
}


$xml_parser = xml_parser_create();
xml_set_element_handler($xml_parser, "startElement", "endElement");
xml_set_character_data_handler($xml_parser, "characterData");
$fp = fopen("http://bangla.irib.ir/index.php?option=com_rss&feed=RSS2.0&no_html=1","r")
or die("Error reading RSS data.");
while ($data = fread($fp, 4096))
xml_parse($xml_parser, $data, feof($fp))
or die(sprintf("XML error: %s at line %d",
xml_error_string(xml_get_error_code($xml_parser)),
xml_get_current_line_number($xml_parser)));
fclose($fp);
xml_parser_free($xml_parser);

?>


Here "http://bangla.irib.ir/index.php?option=com_rss&feed=RSS2.0&no_html=1" is the rss feed address, from that i retrieve news. So we to change this address when we want to retrieve news from other RSS feeder.
Thats all. Now Run the index.php file and get news ticker in action.

Simple Javascript menu :OpenCube

by Noman Muhammad

Often we to create Javascript menu to use in website. Opencube provides a tremendous software to produce various type(horizontal/vertical) of menu and use it our site. This software can be downloaded from this link. For Linux/mac download from here. Use it and enjoy it :).

Simple Ajax Tab Menu

by Noman Muhammad

Ajax tab menu is very useful to show contents without reloading the full page. Last week i create a Ajax based tab menu. Basically i modified my menu by getting help from this link. Here i'll show the steps that i do to create this menu functional.

1. create a simple html file (index.html). Between body tag put these


<ul id="tabmenu">
<li onclick="makeactive(1)"><a class="" id="tab1">First Tab</a></li>
<li onclick="makeactive(2)"><a class="" id="tab2">Second Tab</a></li>
<li onclick="makeactive(3)"><a class="" id="tab3">Third Tab</a></li>
</ul>
<div id="content"></div>

Between head tag put these lines

<script language="JavaScript" type="text/javascript" src="ajax.js"></script>
<script language="JavaScript" type="text/javascript">
function makeactive(tab)
{
document.getElementById("tab1").className = "";
document.getElementById("tab2").className = "";
document.getElementById("tab3").className = "";
document.getElementById("tab"+tab).className = "active";
callAjax('content.php?content= '+tab, 'content', 'getting content for tab '+tab+'. Wait...', 'Error');
}
</script>


2. Now create the ajax.js that we add in our head section. These are the content of ajax.js

function callAjax(url, pageElement, callMessage, errorMessage) {
document.getElementById(pageElement).innerHTML = callMessage;
try {
req = new XMLHttpRequest(); /* e.g. Firefox */
} catch(e) {
try {
req = new ActiveXObject("Msxml2.XMLHTTP"); /* some versions IE */
} catch (e) {
try {
req = new ActiveXObject("Microsoft.XMLHTTP"); /* some versions IE */
} catch (E) {
req = false;
}
}
}
req.onreadystatechange = function() {responseAjax(pageElement, errorMessage);};
req.open("GET",url,true);
req.send(null);
}

function responseAjax(pageElement, errorMessage) {
var output = '';
if(req.readyState == 4) {
if(req.status == 200) {
output = req.responseText;
document.getElementById(pageElement).innerHTML = output;
} else {
document.getElementById(pageElement).innerHTML = errorMessage+"\n"+output;
}
}
}


3. Now we need another php file where output will be processed. Nmae it "content.php" and put these lines in it

<?php
if ($_GET['content'] == 1)
{
echo 'Content for Page 1';
}
if ($_GET['content'] == 2)
{
echo 'Content for Page 2';
}
if ($_GET['content'] == 3)
{
echo 'Content For Page 3';
}
?>


Thats all. Now run the index file and see the tab menu in action.
To get First Tab selected when the page loaded just add this( onload="makeactive(1)") to body tag. So in index.html body tag will look as like as that : <body onload="makeactive(1)">

Free online .flv to .mp3 converter

by Noman Muhammad

Somwtimes we need to download video from popular video sharing site like Youtube, MySpace, Metacafe, iFilm, Google Video or flash video embedded on web page and then transform it into .mp3 to hear that on our mp3 player. I found this site on net which is very helpful and handy to convert the .flv extended video file to .mp3 file and download instantly. We just need to copy the URL of the file that we need to convert to .mp3 and paste it into the site and press convert ... thats all.

Spread your site content : Addthis

by Noman Muhammad

Social networking site become an integral part to spread our website contents. This can help us to increase traffic to our site. Now a days we see something like this
almost in every sites' content. This is one of the way to open the door to the network to spread our content.
Addthis offers us this service. Its very simple to use this tools. We can get the code from site and use the code in our site.

Skype installation in Ubuntu

by Noman Muhammad

Skype is not available in any Ubuntu software repository. So it can't be directly installed using Synaptic or apt-get. To install it using Synaptic or apt-get we have to add Medibuntu repository. But I'm too lazy to install it in this way. I rather download Skype from Skype download page. Skppe can also be downloaded for Ubuntu 64 bit. Then install it by double-clicking the deb file and clicking "Install package".