Wednesday 4 August 2010










Wednesday 28 July 2010










Tuesday 6 July 2010

Google Analytics - FAQ: How long does it take to see report data after adding the tracking code?

https://www.google.com/support/googleanalytics/bin/answer.py?answer=55541&hl=en_GB

Exmple - Generate External XML file

// generate caption/subtitle xml file
$doc = new DOMDocument('1.0');
$tt = $doc->appendChild($doc->createElement("tt"));
$head = $tt->appendChild($doc->createElement("head"));
$styling = $head->appendChild($doc->createElement("styling"));
$styling->setAttribute("xmlns:tts", "http://www.w3.org/2006/10/ttaf1#style");

$style = $styling->appendChild($doc->createElement("style"));
$style->setAttribute("xml:id", "s1");
$style->setAttribute("tts:color", "white");
$style->setAttribute("tts:fontFamily", "proportionalSansSerif");
$style->setAttribute("tts:fontSize", "20px");
$style->setAttribute("tts:textAlign", "center");

$body = $tt->appendChild($doc->createElement('body'));
$div = $body->appendChild($doc->createElement('div'));

// save begin, end, style and text

$para = $div->appendChild($doc->createElement('p'));
$para->setAttribute("begin", "1");
$para->setAttribute("end", "5");
$para->setAttribute("style", "s1");
$para->appendChild($doc->createTextNode("Testing par"));

$doc->save($finalDest);

XML Dom Library

http://phpbuilder.com/manual/en/function.dom-domelement-setattribute.php

Friday 2 July 2010

get url parameter (by specific para name)

get url parameter (For example if the current URL is "...?delete=1&id=testid" then calling getURLParam("id") will return "testid")

http://mattwhite.me/11tmr.nsf/D6Plinks/MWHE-695L9Z

Friday 25 June 2010

Bookmaklet overlay javascript

Bookmarklet overlay javascript means put the javascrit into Browser Bookmark which let any website to call that javascript and overlay the current load page.
(Google it if u want to know more)

Wednesday 9 June 2010

Tuesday 19 January 2010

Calling PHP file from javascript

$("#test").load("abc.php");

id test should only use div tag. it doesn't work with span tag.

Thursday 14 January 2010

IE 6 detect with PHP

// IE6 string from user_agent
$ie6 = "MSIE 6.0";

// detect browser
$browser = $_SERVER['HTTP_USER_AGENT'];

// yank the version from the string
$browser = substr("$browser", 25, 8);

// if IE6 set the $alert
if($browser == $ie6){
echo 'yes IE 6';
}

Ref: http://stackoverflow.com/questions/1042176/php-getbrowser-how-to-identify-ie7-versus-ie6