<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8257443989554875454</id><updated>2024-09-14T15:56:16.171+07:00</updated><title type='text'>Development Knowledge</title><subtitle type='html'>start sharing what we know now...</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-7163544499474703114</id><published>2011-04-22T18:49:00.001+07:00</published><updated>2011-04-29T09:27:42.728+07:00</updated><title type='text'>Tera-WURFL</title><content type='html'>Tera-WURFL is a PHP &amp;amp; MySQL based library that uses the Wireless   Universal Resource File (WURFL) to detect the capabilities of mobile   devices. The &lt;a href=&quot;http://wurfl.sourceforge.net/&quot; rel=&quot;nofollow&quot; title=&quot;http://wurfl.sourceforge.net&quot;&gt;WURFL website&lt;/a&gt; nicely defines the WURFL as follows:&lt;br /&gt;
&lt;blockquote&gt;The WURFL is an “ambitious” configuration file that  contains info about  all known Wireless devices on earth. Of course, new  devices are created  and released at all times. While this  configuration file is bound to be  out of date one day after each  update, chances are that the WURFL lists  all of the WAP devices you can  purchase in the nearest shops.&lt;/blockquote&gt;Example applications of Tera-WURFL include:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt; Redirecting mobile visitors to the mobile version of your site&lt;/li&gt;
&lt;li&gt; Detecting the type of streaming video that a visiting mobile device supports&lt;/li&gt;
&lt;li&gt; Detecting iPhone, iPod and iPad visitors and delivering them an iPhone-friendly version of your site&lt;/li&gt;
&lt;li&gt; Used in conjunction with WALL4PHP or HAWHAW to create a  website in  an abstract language which is delivered to the visiting user  in CHTML,  XHTML, XHTML-MP, or WML, based on the mobile browser’s support&lt;/li&gt;
&lt;li&gt; Detecting ringtone download support and supported ringtone formats&lt;/li&gt;
&lt;li&gt; Detecting the screen resolution of the device and resizing  images  and wallpapers/backgrounds to an appropriate size for the device.&lt;/li&gt;
&lt;li&gt; Detecting support for Javascript, Java/J2ME and Flash Lite&lt;/li&gt;
&lt;/ul&gt;Tera-WURFL takes some functionality from the original &lt;a href=&quot;http://wurfl.sourceforge.net/php/index.php&quot; rel=&quot;nofollow&quot; title=&quot;http://wurfl.sourceforge.net/php/index.php&quot;&gt;PHP Tools Library&lt;/a&gt; by &lt;a href=&quot;http://blog.trasatti.it/&quot; rel=&quot;nofollow&quot; title=&quot;http://blog.trasatti.it/&quot;&gt;Andrea Trasatti&lt;/a&gt; and a prerelease version of the &lt;a href=&quot;http://wurfl.sourceforge.net/njava/&quot; rel=&quot;nofollow&quot; title=&quot;http://wurfl.sourceforge.net/njava/&quot;&gt;Java WURFL Evolution&lt;/a&gt; by &lt;a href=&quot;http://www.passani.it/&quot; rel=&quot;nofollow&quot; title=&quot;http://www.passani.it/&quot;&gt;Luca Passani&lt;/a&gt;.   It serves as a drop in replacement for the original PHP Tools with  only  minor changes to your existing code. Since Tera-WURFL uses a  database  backend (MySQL4, MySQL5, MSSQL is experimental), the real  world  performance increase over the existing PHP Tools implementation  is  extremely high; normally between 5x and 10x faster!&lt;br /&gt;
The author of Tera-WURFL is &lt;a href=&quot;http://www.stevekamerman.com/&quot; rel=&quot;nofollow&quot; title=&quot;http://www.stevekamerman.com&quot;&gt;Steve Kamerman&lt;/a&gt;,   a professional PHP Programmer, MySQL DBA, Flash/Flex Actionscript   Developer, Linux Administrator, IT Manager and part-time American   Soldier. This project was originally sponsored by &lt;a href=&quot;http://www.teratechnologies.net/&quot; rel=&quot;nofollow&quot; title=&quot;http://www.teratechnologies.net&quot;&gt;Tera Technologies&lt;/a&gt;  and was developed as an internal project used for delivering content to   customers of the mobile ringtone and image creation site   Tera-Tones.com.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;What_Makes_Tera-WURFL_Different.3F&quot; name=&quot;What_Makes_Tera-WURFL_Different.3F&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;What Makes Tera-WURFL Different?&lt;/h2&gt;There are many good mobile device detection systems out there, some   are free, and some are paid; however, they each have a specific focus.    The official WURFL API (avaliable in PHP, Java and .NET coming soon) is  a  creation of one of the founders of WURFL, Luca Passani.  Luca is the   driving force behind mobile device detection and is highly regarded in   the mobile development community.  His APIs are focused on &lt;b&gt;accurate detection of mobile device capabilities&lt;/b&gt;.  Tera-WURFL’s focus is &lt;b&gt;high-performance detection of mobile devices&lt;/b&gt;.  Here’s what that means to you.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Tera-WURFL_Project_Priorities&quot; name=&quot;Tera-WURFL_Project_Priorities&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Tera-WURFL Project Priorities&lt;/h3&gt;&lt;ol&gt;&lt;li&gt; &lt;b&gt;High Performance&lt;/b&gt;: Tera-WURFL uses a MySQL backend  (MSSQL  is experimental) to store the WURFL data and cache the results  of  device detections.  This database can be shared between many   installations of Tera-WURFL, so all your sites can benefit from sharing   the same cache.  Non-cached lookups on my test system average about 250   devices per second, with cached detections over 1000 per second.&lt;/li&gt;
&lt;li&gt; &lt;b&gt;Accurate Detection of Mobile Devices&lt;/b&gt;: By using  over a  dozen UserAgentMatchers, specifically tailored to their own  group of  mobile devices, Tera-WURFL is constantly tweaked and tuned to  provide  more accurate results, detecting over 99% of visiting devices.&lt;/li&gt;
&lt;li&gt; &lt;b&gt;Fast Detection of Desktop vs. Mobile Devices&lt;/b&gt;:  Although  detection of mobile devices is good among most of the  libraries, they  are not very good at desktop browsers.  As a result,  your desktop users  are detected as mobile devices and sent to the wrong  site.  Tera-WURFL  includes a feature called the &lt;b&gt;SimpleDesktop Matching Engine&lt;/b&gt;  that  is used to differentiate between desktop and mobile browsers at  an  extremely high rate.  Additionally, instead of the tens of thousands  of  unique desktop user agents piling up in your cache, SimpleDesktop  uses  just one entry in the cache to represent all the desktop browsers.&lt;/li&gt;
&lt;li&gt; &lt;b&gt;Usability&lt;/b&gt;: Since PHP has such a large base in the   small- to medium-sized website arena, there are a large number of new   developers.  Tera-WURFL has been designed to be easy to use and   administer.  Once the initial configuration is finished, you can   maintain the system completely from its &lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/Web_Administration_Page&quot; title=&quot;Web Administration Page&quot;&gt;Web Administration Page&lt;/a&gt;, including the ability to update the WURFL data via the Internet.&lt;/li&gt;
&lt;/ol&gt;&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Constant_Performance_and_Accuracy_Improvements&quot; name=&quot;Constant_Performance_and_Accuracy_Improvements&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Constant Performance and Accuracy Improvements&lt;/h3&gt;Using our in-house analysis and regression testing software built for   Tera-WURFL, we are able to quickly perform a deep analysis on the   performance and accuracy of both the UserAgentMatchers and the core.    This data is then evaluated to identify potential bottlenecks in the   system.  We are also able to track the internal match confidence that   Tera-WURFL has with each device detection and construct aggregate   visualizations to determine if there are more new user agents on the   Internet that are slipping by the detection system.&lt;br /&gt;
&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/File:UAMDistro.png&quot; title=&quot;UAMDistro.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;120&quot; src=&quot;http://www.tera-wurfl.com/wiki/images/thumb/3/34/UAMDistro.png/180px-UAMDistro.png&quot; width=&quot;180&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Tera-WURFL 2.1.0 UserAgentMatcher Distribution&lt;/div&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/File:UAMDetectRate.png&quot; title=&quot;UAMDetectRate.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;120&quot; src=&quot;http://www.tera-wurfl.com/wiki/images/thumb/b/b7/UAMDetectRate.png/171px-UAMDetectRate.png&quot; width=&quot;171&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Tera-WURFL 2.1.0 UserAgentMatcher Detection Rate&lt;/div&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/File:UAMPerfImpact.png&quot; title=&quot;UAMPerfImpact.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;120&quot; src=&quot;http://www.tera-wurfl.com/wiki/images/thumb/8/8b/UAMPerfImpact.png/171px-UAMPerfImpact.png&quot; width=&quot;171&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Tera-WURFL 2.1.0 UserAgentMatcher Performance Impact&lt;/div&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;table cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/File:2_1_1_UAMDistro.png&quot; title=&quot;2 1 1 UAMDistro.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;120&quot; src=&quot;http://www.tera-wurfl.com/wiki/images/thumb/a/a9/2_1_1_UAMDistro.png/179px-2_1_1_UAMDistro.png&quot; width=&quot;179&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Tera-WURFL 2.1.1 UserAgentMatcher Distribution&lt;/div&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/File:2_1_1_UAMDetectRate.png&quot; title=&quot;2 1 1 UAMDetectRate.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;120&quot; src=&quot;http://www.tera-wurfl.com/wiki/images/thumb/2/2e/2_1_1_UAMDetectRate.png/172px-2_1_1_UAMDetectRate.png&quot; width=&quot;172&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Tera-WURFL 2.1.1 UserAgentMatcher Detection Rate&lt;/div&gt;&lt;/div&gt;&lt;/td&gt; &lt;td&gt;&lt;div&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/File:2_1_1_UAMPerfImpact.png&quot; title=&quot;2 1 1 UAMPerfImpact.png&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; height=&quot;120&quot; src=&quot;http://www.tera-wurfl.com/wiki/images/thumb/2/2a/2_1_1_UAMPerfImpact.png/172px-2_1_1_UAMPerfImpact.png&quot; width=&quot;172&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Tera-WURFL 2.1.1 UserAgentMatcher Performance Impact&lt;/div&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Requirements&quot; name=&quot;Requirements&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;Requirements&lt;/h2&gt;&lt;ul&gt;&lt;li&gt; Hardware: Architecture Independent&lt;/li&gt;
&lt;li&gt; Software &lt;ul&gt;&lt;li&gt; Web Server: Any webserver that supports PHP and the MySQLi extension, here are some I’ve tested: &lt;ul&gt;&lt;li&gt; Apache 2.x&lt;/li&gt;
&lt;li&gt; IIS 6/7  (for Windows users I recommend &lt;a href=&quot;http://www.wampserver.com/en/&quot; rel=&quot;nofollow&quot; title=&quot;http://www.wampserver.com/en/&quot;&gt;WampServer&lt;/a&gt; or &lt;a href=&quot;http://www.apachefriends.org/en/xampp-windows.html&quot; rel=&quot;nofollow&quot; title=&quot;http://www.apachefriends.org/en/xampp-windows.html&quot;&gt;XAMPP&lt;/a&gt;&lt;/li&gt;
&lt;li&gt; lighttpd&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt; PHP &lt;ul&gt;&lt;li&gt; PHP 5.x with the following required modules: &lt;ul&gt;&lt;li&gt; MySQLi (MySQL improved extension)&lt;/li&gt;
&lt;li&gt; ZipArchive (this package is included with PHP &amp;gt;= 5.2.0. For previous versions of PHP it is &lt;a href=&quot;http://pecl.php.net/package/zip&quot; rel=&quot;nofollow&quot; title=&quot;http://pecl.php.net/package/zip&quot;&gt;available from PECL&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt; Database: One of the following database servers: &lt;ul&gt;&lt;li&gt; MySQL &amp;gt;= 4.1&lt;/li&gt;
&lt;li&gt; MySQL 5.x&lt;/li&gt;
&lt;li&gt; Microsoft SQL Server 2005/2008 (&lt;b&gt;EXPERIMENTAL&lt;/b&gt;)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;How_does_it_work.3F&quot; name=&quot;How_does_it_work.3F&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;How does it work?&lt;/h2&gt;When a web browser (mobile or non-mobile) visits your site, it sends a &lt;b&gt;User Agent&lt;/b&gt;  along with the request for your page.  The user agent contains   information about the type of device and browser that is being used;   unfortunately, this information is very limited and often times is not   representative of the actual device.  The &lt;a href=&quot;http://wurfl.sourceforge.net/&quot; rel=&quot;nofollow&quot; title=&quot;http://wurfl.sourceforge.net&quot;&gt;WURFL Project&lt;/a&gt;  collects these user agents and puts them into an XML file, commonly   referred to as the WURFL File.  This file also contains detailed   information about each device i.e. the screen resolution, audio playback   capabilities, streaming video capabilities, J2ME &lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/Support&quot; title=&quot;Support&quot;&gt;support&lt;/a&gt; and so on.  This data is constantly updated by WURFL contributors from around the world via the &lt;a href=&quot;http://www.wurflpro.com/&quot; rel=&quot;nofollow&quot; title=&quot;http://www.wurflpro.com&quot;&gt;WURFL Device Database&lt;/a&gt;.  Tera-WURFL takes the data from this WURFL file and puts it into a MySQL database (MSSQL &lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/Support&quot; title=&quot;Support&quot;&gt;support&lt;/a&gt;  is experimental) for faster access, and determines which device is the   most similar to the one that’s requesting your content.  The library  the  returns the capabilities associated with that device to your  scripts  via a PHP Associative Array.  Currently, the WURFL contains &lt;b&gt;29 groups&lt;/b&gt; of capabilities with a total of &lt;b&gt;531 capabilities&lt;/b&gt;.&lt;br /&gt;
Here’s the logical flow of a typical request:&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Device_Requests_a_Page&quot; name=&quot;Device_Requests_a_Page&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Device Requests a Page&lt;/h3&gt;Someone requests one of your pages from their mobile device.  Their   User Agent is passed to the Tera-WURFL library for evaluation.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Request_is_Evaluated&quot; name=&quot;Request_is_Evaluated&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Request is Evaluated&lt;/h3&gt;Tera-WURFL takes the requestor’s user agent and puts it through a   filter to determine which UserAgentMatcher to use on it.  Each   UserAgentMatcher is specifically designed to best match the device from a   group of similar devices using Reduction in String and/or the &lt;a href=&quot;http://en.wikipedia.org/wiki/Levenshtein_distance&quot; rel=&quot;nofollow&quot; title=&quot;http://en.wikipedia.org/wiki/Levenshtein_distance&quot;&gt;Levenshtein Distance algorithm&lt;/a&gt;.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Capabilities_Array_is_Built&quot; name=&quot;Capabilities_Array_is_Built&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Capabilities Array is Built&lt;/h3&gt;Each device in the WURFL file and WURFL database &lt;i&gt;falls back&lt;/i&gt;  onto another device, for example the iPhone 3GS has only a handful of   capabilities, then it falls back onto the iPhone 3G, which adds to those   capabilities and falls back onto the original iPhone, then onto a   generic device that contains the default capabilities.  Through this   method of inheritance, the device entries remain very small in size.  In   our example, once the User Agent has been matched, the capabilities   from this device are stored into the capabilities array, then the next   device in its fallback tree (its parent device) is looked up, and its   capabilities are add, all the way up to the most generic device.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Results_are_Cached&quot; name=&quot;Results_are_Cached&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Results are Cached&lt;/h3&gt;The capabilities array is now cached with the User Agent so the next   time the device visits the site it will be detected extremely quickly.&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Capabilities_are_Available_to_the_Server&quot; name=&quot;Capabilities_are_Available_to_the_Server&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Capabilities are Available to the Server&lt;/h3&gt;The process is finished and the capabilities are now available for   use in your scripts.  One common use, for example, is to redirect mobile   devices to a mobile version of the site: &lt;br /&gt;
&lt;pre&gt;&amp;lt;?php
require_once &#39;./TeraWurfl.php&#39;;
$wurflObj = new TeraWurfl();
$wurflObj-&amp;gt;getDeviceCapabilitiesFromAgent();
&amp;nbsp;
// see if this client is on a wireless device
if($wurflObj-&amp;gt;getDeviceCapability(&quot;is_wireless_device&quot;)){
 &lt;a href=&quot;http://www.php.net/header&quot;&gt;header&lt;/a&gt;(&quot;Location: http://yourwebsite.mobi/&quot;);
}
?&amp;gt;&lt;/pre&gt;&lt;a href=&quot;http://www.blogger.com/post-edit.g?blogID=8257443989554875454&amp;amp;postID=7163544499474703114&quot; id=&quot;Show_a_Picture_of_the_Device_.28optional.29&quot; name=&quot;Show_a_Picture_of_the_Device_.28optional.29&quot;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;Show a Picture of the Device (optional)&lt;/h3&gt;If you have version 2.1.2 or higher, you can show an image of the device (assuming one is available).  See the &lt;a href=&quot;http://www.tera-wurfl.com/wiki/index.php/Device_Image&quot; title=&quot;Device Image&quot;&gt;Device Image&lt;/a&gt; page for the details.&lt;br /&gt;
Here’s a usage example: &lt;br /&gt;
&lt;pre&gt;&amp;lt;?php
require_once &#39;TeraWurfl.php&#39;;
require_once &#39;TeraWurflUtils/TeraWurflDeviceImage.php&#39;;
$wurflObj = new TeraWurfl();
$wurflObj-&amp;gt;getDeviceCapabilitiesFromAgent();
$image = new TeraWurflDeviceImage($wurflObj);
/**
 * The location of the device images as they are accessed on the Internet
 * (ex. &#39;/device_pix/&#39;, &#39;http://www.mydomain.com/pictures/&#39;)
 * The filename of the image will be appended to this base URL
 */
$image-&amp;gt;setBaseURL(&#39;/device_pix/&#39;);
/**
 * The location of the device images on the local filesystem
 */
$image-&amp;gt;setImagesDirectory(&#39;/var/www/device_pix/&#39;);
/**
 * Get the source URL of the image (ex. &#39;/device_pix/blackberry8310_ver1.gif&#39;)
 */
$image_src = $image-&amp;gt;getImage();
if($image_src){
 // If and image exists, show it
 $image_html = &lt;a href=&quot;http://www.php.net/sprintf&quot;&gt;sprintf&lt;/a&gt;(&#39;&amp;lt;img src=&quot;%s&quot; border=&quot;0&quot;/&amp;gt;&#39;,$image_src);
 echo $image_html;
}else{
 // If an image is not available, show a message
 echo &quot;No image available&quot;;
}
?&amp;gt;&lt;/pre&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/7163544499474703114/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/tera-wurfl.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/7163544499474703114'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/7163544499474703114'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/tera-wurfl.html' title='Tera-WURFL'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-6881129940612445418</id><published>2011-04-22T18:39:00.001+07:00</published><updated>2011-04-29T09:27:50.391+07:00</updated><title type='text'>Using Soap with PHP</title><content type='html'>&lt;a href=&quot;http://www.w3.org/TR/soap12-part0/&quot;&gt;SOAP&lt;/a&gt;,  the Simple  Object Access Protocol, is the powerhouse of web services.  It’s a  highly adaptable, object-oriented protocol that exists in over 80   implementations on every popular platform, including &lt;a href=&quot;http://developer.apple.com/documentation/AppleScript/Conceptual/AppleScriptLangGuide/index.html&quot;&gt;AppleScript&lt;/a&gt;,   JavaScript, and Cocoa. It provides a flexible communication layer   between applications, regardless of platform and location. As long as   they both speak SOAP, a PHP-based web application can ask a C++ database   application on another continent to look up the price of a book and   have the answer right away. Another &lt;a href=&quot;http://developer.apple.com/internet/applescript/applescripttoperl.html&quot;&gt;Internet Developer article&lt;/a&gt; shows how to use SOAP with AppleScript and Perl.&lt;br /&gt;
SOAP was created collaboratively as an open protocol. Early in  its  development, XML-RPC was spun off, and now enjoys its own popularity  as  a simpler alternative to SOAP. Both encode messages as XML, and both   use HTTP to transport those messages. SOAP, however, can use other   transport protocols, offers a number of high-end features, and is   developing rapidly. (For more about SOAP and web services, try XML.com’s   helpful &lt;a href=&quot;http://www.xml.com/pub/a/2002/01/09/soap.html&quot;&gt;demystification&lt;/a&gt;.)&lt;br /&gt;
A SOAP transaction begins with an application making a call to a   remote procedure. The SOAP client script then encodes the procedure   request as an XML payload and sends it over the transport protocol to a   server script. The server parses the request and passes it to a local   method, which returns a response. The response is encoded as XML by the   server and returned as a response to the client, which parses the   response and passes the result to the original function.&lt;br /&gt;
There are a number of different implementations of SOAP under  PHP.  It’s a shifting landscape: new ones appear, and old ones aren’t   maintained or simply vanish. As of this writing, the most viable PHP   implementation of SOAP seems to be Dietrich Ayala’s SOAPx4, also known   as NuSOAP. This implementation is the most commonly used and appears to   be the most fully developed and actively maintained, and it shows every   sign of continuing to be a robust and popular solution. It’s not   complete—a number of features, including full documentation, are still   in the works—but it’s still a highly viable and easy-to-use SOAP   solution.&lt;br /&gt;
&lt;h2&gt;Installation&lt;/h2&gt;First, you need to get PHP up and running on your Mac. This is easy to do: check out our &lt;a href=&quot;http://developer.apple.com/internet/opensource/php.html&quot;&gt;tutorial&lt;/a&gt; to get yourself set up. If you want to send SOAP messages over HTTPS, you’ll need to include the cURL module in your PHP build.&lt;br /&gt;
The next step is to install NuSOAP. Download the package from the &lt;a href=&quot;http://dietrich.ganx4.com/download.php?url=/nusoap/&quot;&gt;developer’s site&lt;/a&gt;.   Unzip it to get a folder of documentation, as well as the file   nusoap.php, which contains the actual PHP classes that we’ll need. To   use them, place nusoap.php in your PHP path and include it in the   scripts you write.&lt;br /&gt;
The base class is &lt;code&gt;nusoap_base&lt;/code&gt;. By using it and its   subclasses, anything is possible. As an example, I’ll build a simple   SOAP server script and client script, and then dissect the XML   transaction they send.&lt;br /&gt;
&lt;h2&gt;A SOAP Server&lt;/h2&gt;Here is a simple server, written in PHP, that takes an ISBN   (International Standard Book Number) as input, performs a lookup in an   imaginary database, and returns the price of the corresponding book. In   it, I use the &lt;code&gt;soap_server&lt;/code&gt; class, and four methods of that class: the &lt;code&gt;soap_server&lt;/code&gt; constructor, &lt;code&gt;register&lt;/code&gt;, &lt;code&gt;fault&lt;/code&gt;, and &lt;code&gt;service&lt;/code&gt;:&lt;br /&gt;
&lt;pre&gt;&amp;lt;?php
// function to get price from database
function lookup($ISBN) {
    $query = &quot;select price from books where isbn = &quot;. $ISBN;
    if (mysql_connect(&quot;localhost&quot;, &quot;username&quot;, &quot;passwd&quot;))
    else { $error = &quot;Database connection error&quot;;
        return $error; }
     if (mysql_select_db(&quot;books&quot;))
    else { $error = &quot;Database not found&quot;;
        return $error; }
      if ($result = mysql_query($query))
    else { $error = &quot;mysql_error()&quot;;
        return $error; }
    $price = mysql_result($result, 0, 0);
    return $price;
    }
// include the SOAP classes
require_once(&#39;nusoap.php&#39;);
// create the server object
$server = new soap_server;
// register the lookup service
$server-&amp;gt;register(&#39;lookup&#39;);
// if the lookup fails, return an error
if $price == 0 {
    $error = &quot;Price lookup error&quot;;
    }
if (isset($error)) {
    $fault =
$server-&amp;gt;fault(&#39;soap:Server&#39;,&#39;http://mydomain.com/booklookupscript.php&#39;,$err
or);
    }
// send the result as a SOAP response over HTTP
$server-&amp;gt;service($HTTP_RAW_POST_DATA);
?&amp;gt;&lt;/pre&gt;The first method I use is the &lt;code&gt;soap_server&lt;/code&gt; constructor, which creates the server object that will be doing all the work for me. I assign that object to &lt;code&gt;$server&lt;/code&gt;. Next is &lt;code&gt;register&lt;/code&gt;, which tells the server what to do (in this case, to call the &lt;code&gt;lookup()&lt;/code&gt;  function). The method’s one parameter is the name of the function.   There are other optional parameters that can be used to define the   namespace and the &lt;code&gt;SOAPAction&lt;/code&gt; information as specified in the SOAP specification, but those aren’t necessary for this example. The general syntax of the &lt;code&gt;register&lt;/code&gt; method is:&lt;br /&gt;
&lt;pre&gt;register(name, in, out, namespace, SOAPAction, style)&lt;/pre&gt;The first parameter is the only mandatory one. &lt;code&gt;in&lt;/code&gt; and &lt;code&gt;out&lt;/code&gt; are arrays of input and output values; &lt;code&gt;namespace&lt;/code&gt; and &lt;code&gt;SOAPAction&lt;/code&gt; are used in accordance with the SOAP spec. Finally, &lt;code&gt;style&lt;/code&gt;  is used to indicate whether the data being sent is literal XML data   (the default, and what I use in these examples) or RPC serialized   application data.&lt;br /&gt;
So, the function is executed, and the returned value is passed to the server object. Then the &lt;code&gt;service&lt;/code&gt; method returns a SOAP response to the client that initiated the request. The argument to the &lt;code&gt;service&lt;/code&gt; method is &lt;code&gt;$HTTP_RAW_POST_DATA&lt;/code&gt;.&lt;br /&gt;
&lt;h2&gt;Dealing with Errors&lt;/h2&gt;Because databases are not perfect, the script has a series of steps to catch errors. The &lt;code&gt;lookup&lt;/code&gt;  function contains three traps for different kinds of MySQL database   errors. Each trap assigns an error identification string to the variable   &lt;code&gt;$error&lt;/code&gt; and returns that variable to the main function. Additionally, the main function tests the &lt;code&gt;$price&lt;/code&gt; variable to ensure that it’s not set to zero, which would indicate a defective entry in the database.&lt;br /&gt;
If any one of these traps finds an error, NuSOAP’s &lt;code&gt;fault&lt;/code&gt;  method is called. This halts execution of the server script and returns   the method’s parameters to the client as the string variable &lt;code&gt;$fault&lt;/code&gt;. The syntax of the &lt;code&gt;fault&lt;/code&gt; method is:&lt;br /&gt;
&lt;pre&gt;fault(faultcode, faultactor, faultstring, faultdetail)&lt;/pre&gt;The first two arguments are required, the latter two are optional. For the &lt;code&gt;faultcode&lt;/code&gt;  argument, a machine-readable fault code must be provided, as described   in the SOAP spec. There are four predefined fault codes in the   specification: &lt;code&gt;VersionMismatch&lt;/code&gt;, &lt;code&gt;MustUnderstand&lt;/code&gt;, &lt;code&gt;Client&lt;/code&gt;, and &lt;code&gt;Server&lt;/code&gt;. These must be given as qualified names in the namespace by prefixing them with &lt;code&gt;SOAP-ENV:&lt;/code&gt;. A &lt;code&gt;VersionMismatch&lt;/code&gt; error indicates incompatible namespaces. A &lt;code&gt;MustUnderstand&lt;/code&gt; error is used when it comes across a mandatory header entry that it doesn’t understand. &lt;code&gt;Client&lt;/code&gt; is used when the error lies in the message that was received from the client. And &lt;code&gt;Server&lt;/code&gt;  indicates a problem encountered during processing on the server,   unaffiliated with the SOAP message per se. This latter code is what I   used in the script when there’s a problem with the database lookup.&lt;br /&gt;
The &lt;code&gt;faultactor&lt;/code&gt; argument should contain the URI where   the problem originated. This is more important for transactions where   numerous intermediaries are involved. In this example, I use the URI of   the server script. (Note: the NuSOAP documentation implies that the &lt;code&gt;faultactor&lt;/code&gt; element should be set to either “client” or “server.” The SOAP specification, however, says it should be a URI.)&lt;br /&gt;
&lt;code&gt;faultstring&lt;/code&gt; and &lt;code&gt;faultdetail&lt;/code&gt; are set aside for explaining the fault in human-readable language. &lt;code&gt;faultstring&lt;/code&gt; should be a brief message indicating the nature of the problem, while &lt;code&gt;faultdetail&lt;/code&gt;  can go into more detail—it can even contain an array with specific   itemized information about the fault. In my example, I pass the &lt;code&gt;$error&lt;/code&gt; string to &lt;code&gt;faultstring&lt;/code&gt;, and omit &lt;code&gt;faultdetail&lt;/code&gt;.&lt;br /&gt;
&lt;h2&gt;A SOAP Client&lt;/h2&gt;Now I’ll write a client for an existing SOAP server, so you can  see  it in action. I’ll use XMethods’ Barnes &amp;amp; Noble Price Quote  server,  which acts a lot like the example server, above. It takes an  ISBN as  input and returns price data from Barnes &amp;amp; Noble.&lt;br /&gt;
The client script will need to send a request containing an ISBN and then parse the response. In this script, I use the &lt;code&gt;soapclient&lt;/code&gt; class, its constructor, and &lt;code&gt;call&lt;/code&gt;, which handles making a request and parsing the response all in one. The only method available on the server is &lt;code&gt;GetPrice&lt;/code&gt;, which takes only one parameter, a string called &lt;code&gt;isbn&lt;/code&gt;. It returns a floating-point variable called &lt;code&gt;return&lt;/code&gt;.&lt;br /&gt;
&lt;pre&gt;&amp;lt;?php
// include the SOAP classes
require_once(&#39;nusoap.php&#39;);
// define parameter array (ISBN number)
$param = array(&#39;isbn&#39;=&amp;gt;&#39;0385503954&#39;);
// define path to server application
$serverpath =&#39;http://services.xmethods.net:80/soap/servlet/rpcrouter&#39;;
//define method namespace
$namespace=&quot;urn:xmethods-BNPriceCheck&quot;;
// create client object
$client = new soapclient($serverpath);
// make the call
$price = $client-&amp;gt;call(&#39;getPrice&#39;,$param,$namespace);
// if a fault occurred, output error info
if (isset($fault)) {
        print &quot;Error: &quot;. $fault;
        }
else if ($price == -1) {
        print &quot;The book is not in the database.&quot;;
} else {
        // otherwise output the result
        print &quot;The price of book number &quot;. $param[isbn] .&quot; is $&quot;. $price;
        }
// kill object
unset($client);
?&amp;gt;&lt;/pre&gt;The &lt;code&gt;soapclient&lt;/code&gt; constructor takes a server URL as its argument. Having thus initialized the server object, I pass to the &lt;code&gt;call&lt;/code&gt; method the name of the function I want (&lt;code&gt;getPrice&lt;/code&gt;), the necessary parameters (the array containing the ISBN string to look up), and the required method namespace: &lt;code&gt;urn:xmethods-BNPriceCheck&lt;/code&gt;.&lt;br /&gt;
The parameters for &lt;code&gt;soapclient&lt;/code&gt;’s call method are: &lt;code&gt;function name&lt;/code&gt;, &lt;code&gt;parameter array&lt;/code&gt;, and three optional ones: &lt;code&gt;namespace&lt;/code&gt;, &lt;code&gt;SOAPAction&lt;/code&gt;,   and an array of headers. The definition for the server will specify   which, if any, of the optional parameters are necessary. The Barnes   &amp;amp; Noble Price Quote server requires a method namespace definition (&lt;code&gt;urn:xmethods-BNPriceCheck&lt;/code&gt;) but no &lt;code&gt;SOAPAction&lt;/code&gt; or SOAP headers. Information about what this server offers and what it requires was gleaned from the server’s &lt;a href=&quot;http://xmethods.net/ve2/ViewListing.po?serviceid=7&quot;&gt;listing&lt;/a&gt; on XMethods’ &lt;a href=&quot;http://xmethods.net/&quot;&gt;index&lt;/a&gt;  of SOAP servers. (This particular server happens to be hosted by   XMethods, but the index lists a wide variety of servers, regardless of   host.)&lt;br /&gt;
The &lt;code&gt;call&lt;/code&gt; method of the client performs the SOAP transaction and returns the content of the server’s response to the &lt;code&gt;$price&lt;/code&gt; variable. The script checks for the presence of &lt;code&gt;$fault&lt;/code&gt;, which the server returns if there was an error in the transaction. If the &lt;code&gt;$fault&lt;/code&gt;  variable is set, the script outputs the error information. If there   isn’t an error, it checks to see if the price returned is -1, which   indicates that the requested book was not found. Otherwise, the price   data is printed.&lt;br /&gt;
&lt;h2&gt;A Closer Look at the Transaction&lt;/h2&gt;The actual XML message sent by the client to the server looks something like this:&lt;br /&gt;
&lt;pre&gt;&amp;lt;SOAP-ENV:Envelope
xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&amp;gt;
&amp;lt;SOAP-ENV:Body&amp;gt;
&amp;lt;ns1:getPrice xmlns:ns1=&quot;urn:xmethods-BNPriceCheck&quot;
SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&amp;gt;
&amp;lt;isbn xsi:type=&quot;xsd:string&quot;&amp;gt;0385503954&amp;lt;/isbn&amp;gt;
&amp;lt;/ns1:getPrice&amp;gt;
&amp;lt;/SOAP-ENV:Body&amp;gt;
&amp;lt;/SOAP-ENV:Envelope&amp;gt;&lt;/pre&gt;The &lt;code&gt;Envelope&lt;/code&gt; tag contains pointers to the global   namespace definitions. It also includes pointers to the SOAP envelope   schema hosted on xmlsoap.org and to the W3C’s XML schema definition.   These tell the server where it’s getting definitions for the various XML   tags that it’s using. The &lt;code&gt;XMLSchema&lt;/code&gt; class (which is, as of this writing, only experimental) can be used to work with aspects of the XML schema.&lt;br /&gt;
The schema definition is set automatically by NuSOAP to &lt;code&gt;http://www.w3.org/2001/XMLSchema&lt;/code&gt;. If you wish to change this, you must set the &lt;code&gt;$XMLSchemaVersion&lt;/code&gt; global variable:&lt;br /&gt;
&lt;pre&gt;$XMLSchemaVersion = &#39;http://www.my.org/MYSchema/&#39;;&lt;/pre&gt;Detailed discussion of the ins and outs of the W3C’s XML schema can be found in O’Reilly’s &lt;a href=&quot;http://www.oreilly.com/catalog/xmlschema/desc.html&quot;&gt;new book&lt;/a&gt; on the subject.&lt;br /&gt;
Within the &lt;code&gt;Envelope&lt;/code&gt; tag is the &lt;code&gt;Body&lt;/code&gt; tag,  which contains the body of the message. Its attributes are  determined  by the parameters of the function call. The name of the  remote method,  the method namespace, and the actual content of the  message—the ISBN  string—are set by the client script. NuSOAP  automatically detects the  variable type and incorporates the type  namespace (&lt;code&gt;xsd:string&lt;/code&gt;) in the &lt;code&gt;isbn&lt;/code&gt; tag. If a &lt;code&gt;SOAPAction&lt;/code&gt; had been set in the script, that would appear as a &lt;code&gt;SOAPAction&lt;/code&gt; HTTP header.&lt;br /&gt;
The encoding style is set by default to &lt;code&gt;http://schemas.xmlsoap.org/soap/encoding/&lt;/code&gt;. This is pre-set by NuSOAP as the &lt;code&gt;SOAP-ENC&lt;/code&gt; element of the public array called &lt;code&gt;namespaces&lt;/code&gt;. To change it, simply include a line in your script like:&lt;br /&gt;
&lt;pre&gt;$namespaces[SOAP-ENC] = &#39;http://my.special.encoding&#39;;&lt;/pre&gt;The same technique can be used to change other namespace values, if necessary. The keys of the &lt;code&gt;namespaces&lt;/code&gt; array are &lt;code&gt;SOAP-ENV&lt;/code&gt;, &lt;code&gt;xsd&lt;/code&gt;, &lt;code&gt;xsi&lt;/code&gt;, &lt;code&gt;SOAP-ENC&lt;/code&gt;, and &lt;code&gt;si&lt;/code&gt;, corresponding to the namespace URIs for the envelope schema, the XML schema definition (equal to &lt;code&gt;$XMLSchemaVersion&lt;/code&gt;),   the XML schema instance, the encoding style, and the SOAP   interoperability test URI, respectively. The default settings for these   should not need to be changed under ordinary circumstances.&lt;br /&gt;
The server’s XML response to the request looks like this:&lt;br /&gt;
&lt;pre&gt;&amp;lt;SOAP-ENV:Envelope
xmlns:SOAP-ENV=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;
xmlns:xsi=&quot;http://www.w3.org/1999/XMLSchema-instance&quot;
xmlns:xsd=&quot;http://www.w3.org/1999/XMLSchema&quot;&amp;gt;
&amp;lt;SOAP-ENV:Body&amp;gt;
&amp;lt;ns1:getPriceResponse xmlns:ns1=&quot;urn:xmethods-BNPriceCheck&quot;
SOAP-ENV:encodingStyle=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;&amp;gt;
&amp;lt;return xsi:type=&quot;xsd:float&quot;&amp;gt;14.65&amp;lt;/return&amp;gt;
&amp;lt;/ns1:getPriceResponse&amp;gt;
&amp;lt;/SOAP-ENV:Body&amp;gt;
&amp;lt;/SOAP-ENV:Envelope&amp;gt;&lt;/pre&gt;The envelope is pretty much the same as that of the request,  though  you’ll notice that the server uses an older XML schema than the  client.  The body is also similar: the method namespace and the encoding  style  are the same. The &lt;code&gt;ns1&lt;/code&gt; package tag has &lt;code&gt;Response&lt;/code&gt; appended to its name now: &lt;code&gt;&amp;lt;ns1:getPriceResponse&amp;gt;&lt;/code&gt;. And where the request had an element called &lt;code&gt;isbn&lt;/code&gt;, here the core of the response is called &lt;code&gt;return&lt;/code&gt;, and the data type is specified as &lt;code&gt;float&lt;/code&gt;. PHP is weakly typed, so NuSOAP assigns variable types automatically.&lt;br /&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;NuSOAP makes working with SOAP very easy by automatically  handling  the complexity, although it also provides a fair amount of  access to  the flexibility and nuance underneath. The call method of the &lt;code&gt;soapclient&lt;/code&gt; class and the register method of the &lt;code&gt;soap_server&lt;/code&gt;  class do a lot of work that many other SOAP implementations make you do   by hand. NuSOAP offers some access to the underlayer now, and will   allow more as development proceeds.&lt;br /&gt;
To learn more about the details of working with SOAP, refer to the &lt;a href=&quot;http://www.w3.org/TR/soap12-part0/&quot;&gt;SOAP specification&lt;/a&gt;  and the API documentation that comes with NuSOAP. If you encounter a   specific question about how NuSOAP handles SOAP transactions, it can be   helpful to look at the nusoap.php file, which is clearly organized by   class and decently commented. Going to the source, as it were, should   answer most questions.&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/6881129940612445418/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/using-soap-with-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6881129940612445418'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6881129940612445418'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/using-soap-with-php.html' title='Using Soap with PHP'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-2728264145036850689</id><published>2011-04-22T18:16:00.005+07:00</published><updated>2011-04-29T09:27:55.300+07:00</updated><title type='text'>Top 10 Best SEO Web Tools</title><content type='html'>Just starting to understand how important SEO is to your overall web   strategy?  Well, fear not, I have put together a list of 10 of my   favorite free web-based SEO tools that will help you to SEO your site   like a pro.  Why pay beaux coup bucks for something you can do yourself   with the right tools?  So, without further ado, here are my very   favorite SEO tools for optimizing real estate blogs and websites:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.webuildpages.com/cool-seo-tool/&quot;&gt;We Build Web Pages&lt;/a&gt;:&lt;/b&gt;  This      tool allows you to compare your site against the top 10   listed sites in      Google for a particular keyword or phrase. You   simply enter your keyword      and the system will begin comparing 9   different metrics for the top 10      rankings. This allows you to   quickly compare the Yahoo rank, MSN rank,      Google pages indexed,   altavista pages indexed, backlinks to page,      backlinks to domain,   all in anchor rank, age of url, and whether or not      the phrase is on   the page.&amp;nbsp;Check out      the rest of their &lt;a href=&quot;http://www.webuildpages.com/tools/&quot;&gt;SEO tools      here&lt;/a&gt;.Read also: &lt;a href=&quot;http://www.rsspieces.com/2006/11/27/are-you-getting-the-most-out-of-your-met&quot;&gt;How to select 100% Yahoo! relevent keywords&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.webuildpages.com/tools/&quot;&gt;Zippy&lt;/a&gt;:&lt;/b&gt; &lt;a href=&quot;http://www.zippy.co.uk/&quot; target=&quot;_blank&quot;&gt;Zippy&lt;/a&gt;  is a new meta      search engine that queries other major engines and   returns results in a      format most suited for Webmasters and SEOs.   The site was launched in      September by the seasoned SEO &lt;a href=&quot;http://www.davidnaylor.co.uk/&quot; target=&quot;_blank&quot;&gt;Dave Naylor&lt;/a&gt;, and provides some valuable tools for site      optimization.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.urltrends.com/viewtrend.php?url=http%3A%2F%2Fwww.rsspieces.com&quot;&gt;URL      Trends&lt;/a&gt;:&lt;/b&gt;  UrlTrends allows you to see at a glance any of the information        that you want to see about all of the selected urls.&amp;nbsp;Whether you only   want to see the      PageRank of the Urls, or everything they monitor,   you can now do so very      easily.Read also: &lt;a href=&quot;http://www.rsspieces.com/2006/11/26/urgent-get-ready-for-a-page-rank-update&quot;&gt;URGENT: Get ready for the next PageRank update&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.nuah.com/lab/&quot;&gt;NUAH&lt;/a&gt;&lt;/b&gt;: Super   cool site.&amp;nbsp;Crawls your entire site, see how many      pages you have,   their respective PageRanks, keywords and      descriptions.&amp;nbsp;Also has   good sitemap      generators for both Yahoo! and Google. &lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.nuah.com/google-sitemap-generator/&quot;&gt;Google Sitemap Generator&lt;/a&gt;: Create a valid &lt;a href=&quot;https://www.google.com/webmasters/sitemaps/login&quot;&gt;Google Sitemap&lt;/a&gt; with no programming experience needed. Why should you &lt;a href=&quot;https://www.google.com/webmasters/sitemaps/docs/en/sitemap-generator.html&quot;&gt;install and configure a confusing python script&lt;/a&gt; when you can have &lt;a href=&quot;http://www.nuah.com/&quot;&gt;Nuah.com&lt;/a&gt; to crawl your website and build a valid sitemap.gz file?&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nuah.com/google-pagerank-crawler/&quot;&gt;Google PageRank Crawler&lt;/a&gt;: Easily get a big picture view of your Google PageRank for your entire website.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nuah.com/yahoo-sitemap-generator/&quot;&gt;Yahoo Sitemap Generator&lt;/a&gt;: Create a valid &lt;a href=&quot;http://submit.search.yahoo.com/free/request&quot;&gt;Yahoo Sitemap&lt;/a&gt; with no programming experience needed.&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nuah.com/link-check-crawler/&quot;&gt;Link Check Crawler&lt;/a&gt;:   Let’s face it links can expire, because invalid/expired links can   effect both your search engine position and reputation we recommend you   validate the integrity of your links with our Free Link Validation  Tool.&lt;/li&gt;
&lt;/ul&gt;Read also: &lt;a href=&quot;http://www.rsspieces.com/2006/11/29/using-links-to-retain-visitors-and-gener&quot;&gt;How to increase visitor retention, leads and PageRank with links&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.widexl.com/remote.html&quot;&gt;Widexl&lt;/a&gt;:&lt;/b&gt;  I love this      tool.&amp;nbsp;I mostly use the Meta Tag      Analyzer and the   Link Popularity tools but each of their tools is powerful      and   useful.&amp;nbsp;Widexl is a web      developers best friend.&amp;nbsp;They offer      the   following free hosted tools to assist in SEO: &lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;&lt;a href=&quot;http://www.widexl.com/remote/link-popularity/index.html&quot; title=&quot;Find out who are linking to your sites.&quot;&gt;Link Popularity&lt;/a&gt; – How popular are you on the internet?&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.widexl.com/remote/search-engines/saturation.html&quot; title=&quot;Search Engine Saturation - Find out how many pages from your site the search engines has indexed.&quot;&gt;Search Engine Saturation&lt;/a&gt; How many pages do you have indexed?&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.widexl.com/remote/search-engines/metatag-analyzer.html&quot; title=&quot;Analyze the Meta Tags from your web page&quot;&gt;Meta Tag Analyzer&lt;/a&gt; – Analyze the Meta Tags from your website&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.widexl.com/remote/password-generator.html&quot; title=&quot;Generate passwords for the .htaccess file online for Basic and Digest authentication.&quot;&gt;Password Generator&lt;/a&gt; – Password Generator for Basic and Digest authentication&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.widexl.com/remote/country/index.html&quot; title=&quot;Locate country by IP address or remote host.&quot;&gt;Geo Tracker&lt;/a&gt; – Locate country by IP address or domain name&lt;/li&gt;
&lt;/ul&gt;Read also: &lt;a href=&quot;http://www.rsspieces.com/2006/10/18/ultimate-guide-to-building-backlinks&quot;&gt;Ultimate guide to backlinks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.iwebtool.com/tools/&quot;&gt;iWebTool&lt;/a&gt;:&lt;/b&gt;  I dont think an RSS      Pieces post would be complete without   mentioning the backlinks and      PageRank predictor from   iwebtool.&amp;nbsp;However,      iWebTool has about a ton of other very useful   SEO tools, that deserve      mentioning as well such as a Google Banned   Checker, Link Popularity,      Keyword Suggestion, Search Engine   Position, etc.Read also: &lt;a href=&quot;http://www.rsspieces.com/2006/11/25/where-does-your-site-rank-in-the-serps&quot;&gt;Where does your site rank in the SERPs?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://livepr.ezer.com/&quot;&gt;Ezer&lt;/a&gt;:&lt;/b&gt; Need to   check your Page Rank      across all the data centers?&amp;nbsp;This      is a   very handy tool.&amp;nbsp;You can even      get an idea of whe they are about to   update PR with this tool.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.linkhounds.com/link-harvester/backlinks.php&quot;&gt;Link      Harvester&lt;/a&gt;:&lt;/b&gt;  Are you looking to do some in-depth link analysis? If so,      the Link   Harvester is certainly for you. This tool is much more advanced        than most link analysis software currently on the market. Link   Harvester: &lt;ul type=&quot;disc&quot;&gt;&lt;li&gt;quickly       finds almost every single site that is linking to you&lt;/li&gt;
&lt;li&gt;reports       how many pages of your web site are indexed&lt;/li&gt;
&lt;li&gt;reports       how many links are pointing to any specific page&lt;/li&gt;
&lt;li&gt;provides       links to the Wayback Machine and WhoIs source next to each domain&lt;/li&gt;
&lt;li&gt;reports       the total number of inbound links, home page links, and deep link ratio&lt;/li&gt;
&lt;li&gt;quickly       grabs the number of .gov, .edu, and .ac.uk inbound links&lt;/li&gt;
&lt;li&gt;indicates       if a site links to your site more than 5 times by  bolding that particular       link in the list of results.Read also: &lt;a href=&quot;http://www.rsspieces.com/2006/11/28/seo-autopsy-see-your-site-like-a-search-&quot;&gt;See your site like a search engine does&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.hittail.com/what/&quot;&gt;HitTail&lt;/a&gt;:&lt;/b&gt;  This tool is endlessly useful.&amp;nbsp;I, personally, find that most people   dont understand the long tail search.&amp;nbsp;HitTail reveals in real-time the   least utilized, most promising keywords hidden in the &lt;a href=&quot;http://www.hittail.com/what/long-tail.html&quot;&gt;Long Tail&lt;/a&gt;  of your natural search results. It presents these terms to you as   suggestions that when acted on can boost the natural search results of   your site.&lt;br /&gt;
Read also: &lt;a href=&quot;http://www.rsspieces.com/2006/10/30/rss-pieces-seo-tools&quot;&gt;RSS Pieces SEO Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://www.seobook.com/archives/001741.shtml&quot;&gt;Firefox SEO extension&lt;/a&gt;:&lt;/b&gt; When Aaron Wall of &lt;a href=&quot;http://www.seobook.com/&quot;&gt;SEOBook&lt;/a&gt;  says something is cool, we take note.&amp;nbsp;I have been using this very cool   SEO extension for Firefox (my favorite browser) for quite some time now   and love it.&amp;nbsp;I can click on the tool to display meta tags for any site  I  visit without having to switch to code view and scroll all over   creation for them.&amp;nbsp;It does much more than just that but that is one of   my favorite features.&lt;/li&gt;
&lt;/ol&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/2728264145036850689/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/top-10-best-seo-web-tools_7569.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/2728264145036850689'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/2728264145036850689'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/top-10-best-seo-web-tools_7569.html' title='Top 10 Best SEO Web Tools'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-350584052651373598</id><published>2011-04-22T18:12:00.001+07:00</published><updated>2011-04-29T09:28:00.038+07:00</updated><title type='text'>10 Promising Free Web Analytics Tools</title><content type='html'>Web analytics is the process of gathering and analyzing your  web   content’s data in order to glean meaningful information about how your   site  is being utilized by your users. There are plenty of Web analytics   applications  out there, and you probably already know the big guns   such as &lt;a href=&quot;http://www.google.com/analytics/&quot;&gt;Google Analytics&lt;/a&gt;, &lt;a href=&quot;http://crazyegg.com/&quot;&gt;Crazy Egg&lt;/a&gt;, and remote-site services such as &lt;a href=&quot;http://www.alexa.com/&quot;&gt;Alexa&lt;/a&gt; and &lt;a href=&quot;http://www.compete.com/&quot;&gt;Compete&lt;/a&gt;.&lt;br /&gt;
We go off the trodden path and explore a few lesser-known  Web analytics options. In this article, you’ll find &lt;b&gt;10 excellent and free tools and applications&lt;/b&gt; to help you gather and  analyze data about your web content.&lt;br /&gt;
&lt;h3&gt;1. &lt;a href=&quot;http://piwik.org/&quot;&gt;Piwik&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://piwik.org/&quot;&gt;&lt;img alt=&quot;Piwik - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-01_piwik.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Go to &lt;a href=&quot;http://piwik.org/demo/index.php?module=CoreHome&amp;amp;action=index&amp;amp;idSite=1&amp;amp;period=day&amp;amp;date=yesterday&quot;&gt;Live  Demonstration of Piwik&lt;/a&gt;.&lt;br /&gt;
&lt;i&gt;Piwik&lt;/i&gt; is an  open-source Web analytics application developed   using PHP and MySQL. It has a  “plugins” system that allows for utmost   extensibility and  customization. Install only the plugins you need or   go overboard and install  them all – the choice is up to you. The   plugins system, as you can imagine,  also opens up possibilities for you   to create your own custom extensions. This  thing’s lightweight – the   download’s only 1.9MB.&lt;br /&gt;
&lt;h3&gt;2. &lt;a href=&quot;http://firestats.cc/&quot;&gt;FireStats&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://firestats.cc/&quot;&gt;&lt;img alt=&quot;FireStats - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-02_firestats.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Go to &lt;a href=&quot;http://firestats.cc/&quot;&gt;Live Demonstration of  FireStats&lt;/a&gt;.&lt;br /&gt;
&lt;i&gt;FireStats&lt;/i&gt; is a  simple and straight-forward Web analytics   application written in PHP/MySQL. It  supports numerous platforms and   set-ups including C# sites, Django sites,  Drupal, Joomla!, WordPress,   and &lt;a href=&quot;http://firestats.cc/wiki/InstallUpgrade&quot; title=&quot;Installation page - FireStats.&quot;&gt;several others&lt;/a&gt;. Are you a resourceful  developer who needs &lt;i&gt;moar cowbell&lt;/i&gt;?  FireStats has an &lt;a href=&quot;http://firestats.cc/wiki/API&quot; title=&quot;API wiki of FireStats.&quot;&gt;excellent API&lt;/a&gt; that will assist you in  creating your own custom apps or publishing platform components (imagine: &lt;i&gt;displaying the top 10 most downloaded files  in your WordPress site&lt;/i&gt;) based on your FireStats data.&lt;br /&gt;
&lt;h3&gt;3. &lt;a href=&quot;http://report.reinvigorate.net/snoop&quot;&gt;Snoop&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://report.reinvigorate.net/snoop&quot;&gt;&lt;img alt=&quot;Snoop - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-03_snoop.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;i&gt;Snoop&lt;/i&gt; is a  desktop-based application that runs on the Mac   OS X and Windows XP/Vista  platforms. It sits nicely on your system   status bar/system tray, notifying you  with audible sounds whenever   something happens. Another outstanding Snoop  feature is the &lt;a href=&quot;http://report.reinvigorate.net/name_tags&quot;&gt;Name Tags&lt;/a&gt;  option which allows you to “tag” visitors for easier identification.    So when Joe over at the accounting department visits your site, you’ll    instantly know.&lt;br /&gt;
&lt;h3&gt;4. &lt;a href=&quot;http://web.analytics.yahoo.com/&quot;&gt;Yahoo! Web  Analytics&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://web.analytics.yahoo.com/&quot;&gt;&lt;img alt=&quot;Yahoo! Web Analytics - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-04_yahoo_web_analytics.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;i&gt;Yahoo! Web analytics&lt;/i&gt; is Yahoo!’s alternative to the dominant   Google Analytics. It’s an  enterprise-level, robust web-based   third-party solution which makes accessing  data easy especially for   multiple-user groups. It’s got all the things you’d  expect from a   comprehensive Web analytics tool such as pretty graphs,  custom-designed   (and printable) reports, and real-time data tracking.&lt;br /&gt;
&lt;h3&gt;5. &lt;a href=&quot;http://bbclone.de/&quot;&gt;BBClone&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://bbclone.de/&quot;&gt;&lt;img alt=&quot;BBClone - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-05_bbclone.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Go to &lt;a href=&quot;http://bbclone.de/demo/&quot;&gt;Live Demonstration of  BBClone&lt;/a&gt;.&lt;br /&gt;
If you’re looking for a simple, server-side web application  that   doesn’t rely on third-party services to monitor your data, check out &lt;i&gt;BBClone&lt;/i&gt;  – a PHP-based server application  that gives you a detailed overview of   website traffic and visitor data. It  supports language localization   for 32 languages like English, Chinese, German,  and Japanese. It easily   integrates with popular publishing platforms like  Drupal, WordPress,   and Textpattern. Since it’s logfile-based, it doesn’t  require you to   use a server-side relational database.&lt;br /&gt;
&lt;h3&gt;6. &lt;a href=&quot;http://www.woopra.com/&quot;&gt;Woopra&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://www.woopra.com/&quot;&gt;&lt;img alt=&quot;Woopra - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-06_woopra.jpg&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;i&gt;Woopra&lt;/i&gt; is a Web  analytics application written in Java. It’s   split into two parts which includes  a desktop application for data   analysis/exploration and a web service to  monitor website statistics.   Woopra has a robust user interface, an intuitive  management system that   allows you to run it on multiple sites and domains, and  even a chat   feature so that you can gather non-numerical information by talking  to   your site users. Woopra is currently in beta and requires you to  request  for  a private beta registration.&lt;br /&gt;
&lt;h3&gt;7. &lt;a href=&quot;http://www.jawstats.com/&quot;&gt;JAWStats&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://www.jawstats.com/&quot;&gt;&lt;img alt=&quot;JAWStats - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-07_jawstats.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;i&gt;JAWStats&lt;/i&gt; is a  server-based Web analytics application that runs with the popular &lt;a href=&quot;http://awstats.sourceforge.net/&quot;&gt;AWStats&lt;/a&gt;  (in fact, if you’re on a  shared hosting plan – AWStats is probably   already installed). JAWStats does two  things to extend AWStats – it   improves performance by reducing server resource usage  and improves the   user interface a little bit. With that said, you can’t go  wrong with &lt;i&gt;just&lt;/i&gt; using AWStats either  if you’re happy with it.&lt;br /&gt;
&lt;h3&gt;8. &lt;a href=&quot;http://4q.iperceptions.com/default.aspx?c=en-US&quot;&gt;4Q&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://4q.iperceptions.com/default.aspx?c=en-US&quot;&gt;&lt;img alt=&quot;4Q - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-08_4q.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
A large part of Web analytics deals with number-crunching  and   numerical data. Raw numbers tells only part of the story and it’s often    helpful to perform analytics by way of interacting with actual users.   4Q  developer Avinash Kaushik puts it perfectly when he said: “Web   analytics  is good at the ‘What’. It is not good at the ‘Why’”.&lt;i&gt;4Q&lt;/i&gt;  is a simple surveying application focused on improving your    traditional numerical Web analytics by supplementing it with actual user    feedback. Check out &lt;a href=&quot;http://www.youtube.com/watch?v=o2LJliORQPQ&quot;&gt;this  YouTube video&lt;/a&gt; on how easy it is to set up 4Q.&lt;br /&gt;
&lt;h3&gt;9. &lt;a href=&quot;http://www.mochibot.com/&quot;&gt;MochiBot&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://www.mochibot.com/&quot;&gt;&lt;img alt=&quot;MochiBot - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-09_mochibot.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;i&gt;MochiBot&lt;/i&gt; is a free  Web analytics/tracking tool especially designed for &lt;a href=&quot;http://en.wikipedia.org/wiki/Flash&quot;&gt;Flash&lt;/a&gt;  assets. With MochiBot, you  can see who’s sharing your Flash content,   how many times people view your content,  as well as helping you track   where your Flash content is to prevent piracy and  content theft.   Installing MochiBot is a breeze; you simply copy a few lines of    ActionScript code in the .FLA files you want to monitor.&lt;br /&gt;
&lt;h3&gt;10. &lt;a href=&quot;http://www.quate.net/grape&quot;&gt;Grape Web  Statistics&lt;/a&gt;&lt;/h3&gt;&lt;a href=&quot;http://www.quate.net/grape&quot;&gt;&lt;img alt=&quot;Grape Web Statistics - screen shot.&quot; height=&quot;240&quot; src=&quot;http://images.sixrevisions.com/2009/01/02-10_grape_web_statistics.png&quot; width=&quot;550&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Go to &lt;a href=&quot;http://extremetuxracer.com/grape/&quot;&gt;Live Demonstration of Grape Web Statistics&lt;/a&gt;.&lt;br /&gt;
&lt;i&gt;Grape Web Statistics&lt;/i&gt; is a simple, open-source application   geared towards web developers. It has a  clean and usable interface and   has an Extensions API to extend and customize  your installation. It   uses PHP for the backend and you can run it on any  operating system   that runs PHP.&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/350584052651373598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/10-promising-free-web-analytics-tools.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/350584052651373598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/350584052651373598'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/10-promising-free-web-analytics-tools.html' title='10 Promising Free Web Analytics Tools'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-1916096294677331058</id><published>2011-04-22T18:10:00.002+07:00</published><updated>2011-04-29T09:28:05.300+07:00</updated><title type='text'>Zend Framework</title><content type='html'>Zend Framework is an open source, object oriented web application framework for             &lt;acronym&gt;PHP&lt;/acronym&gt;  5. Zend Framework is often called a ‘component library’, because              it has many loosely coupled components that you can use more or  less independently. But             Zend Framework also provides an  advanced Model-View-Controller (&lt;acronym&gt;MVC&lt;/acronym&gt;)              implementation that can be used to establish a basic structure for your  Zend Framework             applications. A full list of Zend Framework  components along with short descriptions may             be found in the  &lt;a href=&quot;http://framework.zend.com/about/components&quot;&gt;» components overview&lt;/a&gt;.  This             QuickStart will introduce you to some of Zend  Framework’s most commonly used components,             including  Zend_Controller, Zend_Layout,             Zend_Config, Zend_Db,              Zend_Db_Table, Zend_Registry, along             with a few view  helpers.&lt;br /&gt;
Using these components, we will build a simple database-driven guest  book application             within minutes. The complete source code  for this application is available in the             following archives:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://framework.zend.com/demos/ZendFrameworkQuickstart.zip&quot;&gt;» zip&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://framework.zend.com/demos/ZendFrameworkQuickstart.tar.gz&quot;&gt;» tar.gz&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;h1&gt;Model-View-Controller&lt;/h1&gt;&lt;/div&gt;So what exactly is this &lt;acronym&gt;MVC&lt;/acronym&gt; pattern everyone keeps talking about, and             why should you care? &lt;acronym&gt;MVC&lt;/acronym&gt; is much more than just a three-letter             acronym (&lt;acronym&gt;TLA&lt;/acronym&gt;)  that you can whip out anytime you want to sound smart;             it  has become something of a standard in the design of modern web  applications. And for             good reason. Most web application code  falls under one of the following three             categories:  presentation, business logic, and data access. The &lt;acronym&gt;MVC&lt;/acronym&gt;  pattern models this separation of concerns well. The end result is that  your             presentation code can be consolidated in one part of  your application with your business             logic in another and  your data access code in yet another. Many developers have found              this well-defined separation indispensable for keeping their code  organized, especially             when more than one developer is  working on the same application.&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;: &lt;b&gt;More Information&lt;/b&gt;&lt;br /&gt;
Let’s break down the pattern and take a look at the individual pieces:&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://framework.zend.com/images/manual/d481d625821a97b9a5eb2cec99dca50e-learning.quickstart.intro.mvc.png&quot;&gt;&lt;img alt=&quot;learning.quickstart.intro.mvc.png&quot; height=&quot;315&quot; src=&quot;http://framework.zend.com/images/manual/d481d625821a97b9a5eb2cec99dca50e-learning.quickstart.intro.mvc.png&quot; width=&quot;450&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;ul&gt;&lt;li&gt;&lt;i&gt;Model&lt;/i&gt; – This is the part of your                          application that defines its basic functionality behind a set of                          abstractions. Data access routines and some business  logic can be defined in                         the model.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;View&lt;/i&gt; – Views define exactly what is                          presented to the user. Usually controllers pass data to each view to  render                         in some format. Views will often collect  data from the user, as well. This                         is where  you’re likely to find &lt;acronym&gt;HTML&lt;/acronym&gt; markup in your                         &lt;acronym&gt;MVC&lt;/acronym&gt; applications.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;Controller&lt;/i&gt; – Controllers bind the whole                          pattern together. They manipulate models, decide which view to  display based                         on the user’s request and other  factors, pass along the data that each view                         will  need, or hand off control to another controller entirely. Most                          &lt;acronym&gt;MVC&lt;/acronym&gt; experts recommend&lt;/li&gt;
&lt;/ul&gt;source : http://framework.zend.com/manual/en/learning.quickstart.intro.html&lt;br /&gt;
download : http://framework.zend.com/download/overview&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/1916096294677331058/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/zend-framework.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/1916096294677331058'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/1916096294677331058'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/zend-framework.html' title='Zend Framework'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-231111620571212178</id><published>2011-04-22T18:09:00.004+07:00</published><updated>2011-04-29T09:28:16.107+07:00</updated><title type='text'>Web service</title><content type='html'>A &lt;b&gt;web service&lt;/b&gt; is a method of communication between two electronic devices.&lt;br /&gt;
The &lt;a href=&quot;http://en.wikipedia.org/wiki/W3C&quot; title=&quot;W3C&quot;&gt;W3C&lt;/a&gt; defines a “web service” as “a software system designed to support &lt;a href=&quot;http://en.wikipedia.org/wiki/Interoperability&quot; title=&quot;Interoperability&quot;&gt;interoperable&lt;/a&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Machine-to-Machine&quot; title=&quot;Machine-to-Machine&quot;&gt;machine-to-machine&lt;/a&gt; interaction over a &lt;a href=&quot;http://en.wikipedia.org/wiki/Computer_network&quot; title=&quot;Computer network&quot;&gt;network&lt;/a&gt;. It has an interface described in a machine-processable format (specifically Web Services Description Language &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_Services_Description_Language&quot; title=&quot;Web Services Description Language&quot;&gt;WSDL&lt;/a&gt;). Other systems interact with the web service in a manner prescribed by its description using &lt;a href=&quot;http://en.wikipedia.org/wiki/SOAP&quot; title=&quot;SOAP&quot;&gt;SOAP&lt;/a&gt; messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards.”&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-0&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
The W3C also states, “We can identify two major classes of Web   services, REST-compliant Web services, in which the primary purpose of   the service is to manipulate XML representations of Web resources using a   uniform set of “stateless” operations; and arbitrary Web services, in   which the service may expose an arbitrary set of operations.”&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-1&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Webservices.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;218&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/4/4a/Webservices.png&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;Web services architecture.&lt;/div&gt;&lt;/div&gt;&lt;h2&gt;Big web services&lt;/h2&gt;“Big web services” use &lt;a href=&quot;http://en.wikipedia.org/wiki/XML&quot; title=&quot;XML&quot;&gt;Extensible Markup Language&lt;/a&gt; (XML) messages that follow the &lt;a href=&quot;http://en.wikipedia.org/wiki/SOAP&quot; title=&quot;SOAP&quot;&gt;SOAP&lt;/a&gt;  standard and have been popular with traditional enterprise. In such   systems, there is often a machine-readable description of the operations   offered by the service written in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_Services_Description_Language&quot; title=&quot;Web Services Description Language&quot;&gt;Web Services Description Language&lt;/a&gt; (WSDL). The latter is not a requirement of a SOAP &lt;i&gt;endpoint&lt;/i&gt;, but it is a prerequisite for automated &lt;a href=&quot;http://en.wikipedia.org/wiki/Client-side&quot; title=&quot;Client-side&quot;&gt;client-side&lt;/a&gt; code generation in many &lt;a href=&quot;http://en.wikipedia.org/wiki/Java_%28programming_language%29&quot; title=&quot;Java (programming language)&quot;&gt;Java&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/.NET_Framework&quot; title=&quot;.NET Framework&quot;&gt;.NET&lt;/a&gt; SOAP frameworks (frameworks such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Spring_Framework&quot; title=&quot;Spring Framework&quot;&gt;Spring&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Apache_Axis2&quot; title=&quot;Apache Axis2&quot;&gt;Apache Axis2&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Apache_CXF&quot; title=&quot;Apache CXF&quot;&gt;Apache CXF&lt;/a&gt; being notable exceptions). Some industry organizations, such as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_Services_Interoperability&quot; title=&quot;Web Services Interoperability&quot;&gt;WS-I&lt;/a&gt;, mandate both SOAP and WSDL in their definition of a web service.&lt;br /&gt;
&lt;h2&gt;Web API&lt;/h2&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:SOA_Detailed_Diagram.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;198&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/8/84/SOA_Detailed_Diagram.png/375px-SOA_Detailed_Diagram.png&quot; width=&quot;375&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:SOA_Detailed_Diagram.png&quot; title=&quot;Enlarge&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;11&quot; src=&quot;http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png&quot; width=&quot;15&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Web services in a service-oriented architecture.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_API&quot; title=&quot;Web API&quot;&gt;Web API&lt;/a&gt; is a development in web services (in a movement called &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_2.0&quot; title=&quot;Web 2.0&quot;&gt;Web 2.0&lt;/a&gt;) where emphasis has been moving away from &lt;a href=&quot;http://en.wikipedia.org/wiki/SOAP&quot; title=&quot;SOAP&quot;&gt;SOAP&lt;/a&gt; based services towards &lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_State_Transfer&quot; title=&quot;Representational State Transfer&quot;&gt;Representational State Transfer&lt;/a&gt; (REST) based communications.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-2&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt; REST services do not require XML, SOAP, or &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_Services_Description_Language&quot; title=&quot;Web Services Description Language&quot;&gt;WSDL&lt;/a&gt; service-API definitions.&lt;br /&gt;
Web APIs allow the combination of multiple web services into new applications known as &lt;a href=&quot;http://en.wikipedia.org/wiki/Mashup_%28web_application_hybrid%29&quot; title=&quot;Mashup (web application hybrid)&quot;&gt;mashups&lt;/a&gt;.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-3&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
When used in the context of &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_development&quot; title=&quot;Web development&quot;&gt;web development&lt;/a&gt;, Web API is typically a defined set of Hypertext Transfer Protocol (&lt;a href=&quot;http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol&quot; title=&quot;Hypertext Transfer Protocol&quot;&gt;HTTP&lt;/a&gt;)   request messages along with a definition of the structure of response   messages, usually expressed in an Extensible Markup Language (&lt;a href=&quot;http://en.wikipedia.org/wiki/XML&quot; title=&quot;XML&quot;&gt;XML&lt;/a&gt;) or JavaScript Object Notation (&lt;a href=&quot;http://en.wikipedia.org/wiki/JSON&quot; title=&quot;JSON&quot;&gt;JSON&lt;/a&gt;) format.&lt;br /&gt;
When running composite web services, each sub service can be   considered autonomous. The user has no control over these services. Also   the web services themselves are not reliable; the service provider may   remove, change or update their services without giving notice to  users.  The reliability and fault tolerance is not well supported;  faults may  happen during the execution. Exception handling in the  context of web  services is still an open research issue. Still it can  be handled by  responding with an error object to the client.&lt;br /&gt;
&lt;h3&gt;Remote procedure calls&lt;/h3&gt;&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Webservice_xrpc.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;86&quot; src=&quot;http://upload.wikimedia.org/wikipedia/en/thumb/9/95/Webservice_xrpc.png/220px-Webservice_xrpc.png&quot; width=&quot;220&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:Webservice_xrpc.png&quot; title=&quot;Enlarge&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;11&quot; src=&quot;http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png&quot; width=&quot;15&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Architectural elements involved in the XML-RPC.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;Main article: &lt;a href=&quot;http://en.wikipedia.org/wiki/Remote_procedure_call&quot; title=&quot;Remote procedure call&quot;&gt;Remote procedure call&lt;/a&gt;&lt;/div&gt;RPC web services present a distributed function (or method) call   interface that is familiar to many developers. Typically, the basic unit   of RPC web services is the WSDL operation.&lt;br /&gt;
The first web services tools were focused on RPC, and as a result   this style is widely deployed and supported. However, it is sometimes   criticized for not being &lt;a href=&quot;http://en.wikipedia.org/wiki/Loose_coupling&quot; title=&quot;Loose coupling&quot;&gt;loosely coupled&lt;/a&gt;,   because it was often implemented by mapping services directly to   language-specific functions or method calls. Many vendors felt this   approach to be a dead end, and pushed for RPC to be disallowed in the &lt;a href=&quot;http://en.wikipedia.org/wiki/WS-I_Basic_Profile&quot; title=&quot;WS-I Basic Profile&quot;&gt;WS-I Basic Profile&lt;/a&gt;.&lt;br /&gt;
Other approaches with nearly the same functionality as RPC are &lt;a href=&quot;http://en.wikipedia.org/wiki/Object_Management_Group&quot; title=&quot;Object Management Group&quot;&gt;Object Management Group&lt;/a&gt;‘s (OMG) Common Object Request Broker Architecture (&lt;a href=&quot;http://en.wikipedia.org/wiki/CORBA&quot; title=&quot;CORBA&quot;&gt;CORBA&lt;/a&gt;), &lt;a href=&quot;http://en.wikipedia.org/wiki/Microsoft&quot; title=&quot;Microsoft&quot;&gt;Microsoft&lt;/a&gt;‘s Distributed Component Object Model (&lt;a href=&quot;http://en.wikipedia.org/wiki/Distributed_Component_Object_Model&quot; title=&quot;Distributed Component Object Model&quot;&gt;DCOM&lt;/a&gt;) or &lt;a href=&quot;http://en.wikipedia.org/wiki/Sun_Microsystems&quot; title=&quot;Sun Microsystems&quot;&gt;Sun Microsystems&lt;/a&gt;‘s Java/Remote Method Invocation (&lt;a href=&quot;http://en.wikipedia.org/wiki/Java_remote_method_invocation&quot; title=&quot;Java remote method invocation&quot;&gt;RMI&lt;/a&gt;).&lt;br /&gt;
&lt;h3&gt;Service-oriented architecture&lt;/h3&gt;&lt;div&gt;Main article: &lt;a href=&quot;http://en.wikipedia.org/wiki/Service-oriented_architecture&quot; title=&quot;Service-oriented architecture&quot;&gt;Service-oriented architecture&lt;/a&gt;&lt;/div&gt;Web services can also be used to implement an architecture according   to service-oriented architecture (SOA) concepts, where the basic unit  of  communication is a message, rather than an operation. This is often   referred to as “&lt;a href=&quot;http://en.wikipedia.org/wiki/Message-oriented_middleware&quot; title=&quot;Message-oriented middleware&quot;&gt;message-oriented&lt;/a&gt;” services.&lt;br /&gt;
SOA web services are supported by most major software vendors and industry analysts. Unlike RPC web services, &lt;a href=&quot;http://en.wikipedia.org/wiki/Loose_coupling&quot; title=&quot;Loose coupling&quot;&gt;loose coupling&lt;/a&gt; is more likely, because the focus is on the “contract” that WSDL provides, rather than the underlying implementation details.&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Middleware_analyst&quot; title=&quot;Middleware analyst&quot;&gt;Middleware analysts&lt;/a&gt; use &lt;a href=&quot;http://en.wikipedia.org/wiki/Enterprise_service_bus&quot; title=&quot;Enterprise service bus&quot;&gt;enterprise service buses&lt;/a&gt; which combine &lt;a href=&quot;http://en.wikipedia.org/wiki/Message-oriented_middleware&quot; title=&quot;Message-oriented middleware&quot;&gt;message-oriented&lt;/a&gt; processing and web services to create an &lt;a href=&quot;http://en.wikipedia.org/wiki/Event-driven_SOA&quot; title=&quot;Event-driven SOA&quot;&gt;event-driven SOA&lt;/a&gt;. One example of an open-source &lt;a href=&quot;http://en.wikipedia.org/wiki/Enterprise_service_bus&quot; title=&quot;Enterprise service bus&quot;&gt;ESB&lt;/a&gt; is &lt;a href=&quot;http://en.wikipedia.org/wiki/Mule_%28software%29&quot; title=&quot;Mule (software)&quot;&gt;Mule&lt;/a&gt;, another one is &lt;a href=&quot;http://en.wikipedia.org/wiki/Open_ESB&quot; title=&quot;Open ESB&quot;&gt;Open ESB&lt;/a&gt;.&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:WSDL_11vs20.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;354&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/thumb/c/c2/WSDL_11vs20.png/400px-WSDL_11vs20.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div&gt;&lt;div&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/File:WSDL_11vs20.png&quot; title=&quot;Enlarge&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;11&quot; src=&quot;http://bits.wikimedia.org/skins-1.5/common/images/magnify-clip.png&quot; width=&quot;15&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Representation of concepts defined by WSDL 1.1 and WSDL 2.0 documents.&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;Representational state transfer (REST)&lt;/h3&gt;&lt;div&gt;Main article: &lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_State_Transfer&quot; title=&quot;Representational State Transfer&quot;&gt;Representational State Transfer&lt;/a&gt;&lt;/div&gt;REST attempts to describe architectures which use HTTP or similar   protocols by constraining the interface to a set of well-known, standard   operations (like GET, POST, PUT, DELETE for HTTP). Here, the focus is   on interacting with &lt;a href=&quot;http://en.wikipedia.org/wiki/State_%28computer_science%29&quot; title=&quot;State (computer science)&quot;&gt;stateful&lt;/a&gt; resources, rather than messages or operations.&lt;br /&gt;
An architecture based on REST (one that is ‘RESTful’) can use WSDL to   describe SOAP messaging over HTTP, can be implemented as an  abstraction  purely on top of SOAP (e.g., WS-Transfer), or can be  created without  using SOAP at all.&lt;br /&gt;
&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_Services_Description_Language&quot; title=&quot;Web Services Description Language&quot;&gt;WSDL version 2.0&lt;/a&gt; offers support for binding to all the &lt;a href=&quot;http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods&quot; title=&quot;Hypertext Transfer Protocol&quot;&gt;HTTP request methods&lt;/a&gt; (not only GET and POST as in version 1.1) so it enables a better implementation of &lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_State_Transfer&quot; title=&quot;Representational State Transfer&quot;&gt;RESTful Web services&lt;/a&gt;.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-4&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt; However, support for this specification is still poor in &lt;a href=&quot;http://en.wikipedia.org/wiki/Software_development_kit&quot; title=&quot;Software development kit&quot;&gt;software development kits&lt;/a&gt;, which often offer tools only for WSDL 1.1.&lt;br /&gt;
&lt;h2&gt;Automated design methodologies&lt;/h2&gt;Automated tools can aid in the creation of a web service. For   services using WSDL it is possible to either automatically generate WSDL   for existing classes (a bottom-up strategy) or to generate a class   skeleton given existing WSDL (a top-down strategy).&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A developer using a bottom up method writes implementing classes   first (in some programming language), and then uses a WSDL generating   tool to expose methods from these classes as a web service &lt;a href=&quot;http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.jst.ws.doc.user/concepts/cwsbtmup.html&quot; rel=&quot;nofollow&quot;&gt;[1]&lt;/a&gt;. This is often the simpler approach.&lt;/li&gt;
&lt;li&gt;A developer using a top down method writes the WSDL document first   and then uses a code generating tool to produce the class skeleton, to   be completed as necessary. This way is generally considered more   difficult but can produce cleaner designs &lt;a href=&quot;http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.jst.ws.doc.user/concepts/cwstopdown.html&quot; rel=&quot;nofollow&quot;&gt;[2]&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;h2&gt;Criticisms&lt;/h2&gt;Critics of non-RESTful web services often complain that they are too complex&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-5&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt; and based upon large software vendors or integrators, rather than typical &lt;a href=&quot;http://en.wikipedia.org/wiki/Open_source&quot; title=&quot;Open source&quot;&gt;open source&lt;/a&gt; implementations. There are open source implementations like &lt;a href=&quot;http://en.wikipedia.org/wiki/Apache_Axis&quot; title=&quot;Apache Axis&quot;&gt;Apache Axis&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Apache_CXF&quot; title=&quot;Apache CXF&quot;&gt;Apache CXF&lt;/a&gt;.&lt;br /&gt;
One key concern of the REST web service developers is that the SOAP   WS toolkits make it easy to define new interfaces for remote   interaction, often relying on introspection to extract the WSDL, since a   minor change on the server (even an upgrade of the SOAP stack) can   result in different WSDL and a different service interface.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-6&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;  The client-side classes that can be generated from WSDL and XSD   descriptions of the service are often similarly tied to a particular   version of the SOAP endpoint and can break if the endpoint changes or   the client-side SOAP stack is upgraded. Well-designed SOAP endpoints   (with handwritten &lt;a href=&quot;http://en.wikipedia.org/wiki/XML_Schema_Definition#XML_Schema_Definition&quot; title=&quot;XML Schema Definition&quot;&gt;XSD&lt;/a&gt;  and WSDL) do not suffer from this but there is still the problem that a   custom interface for every service requires a custom client for every   service.&lt;br /&gt;
There are also concerns about performance due to web services’ use of   XML as a message format and SOAP/HTTP in enveloping and transport,  such  as that published by the University of Wollongong in 2005 by   N.A.B.Gray.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Web_service#cite_note-7&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/231111620571212178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/web-service.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/231111620571212178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/231111620571212178'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/web-service.html' title='Web service'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-3663950564627714174</id><published>2011-04-22T18:09:00.003+07:00</published><updated>2011-04-29T09:28:10.604+07:00</updated><title type='text'>AJAX</title><content type='html'>&lt;b&gt;Ajax&lt;/b&gt; (pronounced &lt;a href=&quot;http://en.wikipedia.org/wiki/Wikipedia:IPA_for_English&quot; title=&quot;Wikipedia:IPA for English&quot;&gt;/ˈeɪdʒæks/&lt;/a&gt;; shorthand for &lt;a href=&quot;http://en.wikipedia.org/wiki/Asynchronous_I/O&quot; title=&quot;Asynchronous I/O&quot;&gt;Asynchronous&lt;/a&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/JavaScript&quot; title=&quot;JavaScript&quot;&gt;JavaScript&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/XML&quot; title=&quot;XML&quot;&gt;XML&lt;/a&gt;)&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-garrett-0&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt; is a group of interrelated &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_development&quot; title=&quot;Web development&quot;&gt;web development&lt;/a&gt; methods used on the &lt;a href=&quot;http://en.wikipedia.org/wiki/Client-side&quot; title=&quot;Client-side&quot;&gt;client-side&lt;/a&gt; to create interactive &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_application&quot; title=&quot;Web application&quot;&gt;web applications&lt;/a&gt;. With Ajax, web applications can retrieve data from the &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_server&quot; title=&quot;Web server&quot;&gt;server&lt;/a&gt;  asynchronously in the background without interfering with the display   and behavior of the existing page. Data is usually retrieved using the &lt;i&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/XMLHttpRequest&quot; title=&quot;XMLHttpRequest&quot;&gt;XMLHttpRequest&lt;/a&gt;&lt;/i&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Object_%28computer_science%29&quot; title=&quot;Object (computer science)&quot;&gt;object&lt;/a&gt;. Despite the name, the use of &lt;a href=&quot;http://en.wikipedia.org/wiki/XML&quot; title=&quot;XML&quot;&gt;XML&lt;/a&gt; is not needed, and the requests need not be &lt;a href=&quot;http://en.wikipedia.org/wiki/Asynchrony&quot; title=&quot;Asynchrony&quot;&gt;asynchronous&lt;/a&gt;.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-wrox-1&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
Like &lt;a href=&quot;http://en.wikipedia.org/wiki/Dynamic_HTML&quot; title=&quot;Dynamic HTML&quot;&gt;DHTML&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/LAMP_%28software_bundle%29&quot; title=&quot;LAMP (software bundle)&quot;&gt;LAMP&lt;/a&gt;, Ajax is not one technology, but a group of technologies. Ajax uses a combination of &lt;a href=&quot;http://en.wikipedia.org/wiki/HTML&quot; title=&quot;HTML&quot;&gt;HTML&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Cascading_Style_Sheets&quot; title=&quot;Cascading Style Sheets&quot;&gt;CSS&lt;/a&gt; to mark up and style information. The &lt;a href=&quot;http://en.wikipedia.org/wiki/Document_Object_Model&quot; title=&quot;Document Object Model&quot;&gt;DOM&lt;/a&gt; is accessed with &lt;a href=&quot;http://en.wikipedia.org/wiki/JavaScript&quot; title=&quot;JavaScript&quot;&gt;JavaScript&lt;/a&gt;  to dynamically display, and to allow the user to interact with the   information presented. JavaScript and the XMLHttpRequest object provide a   method for exchanging data asynchronously between browser and server  to  avoid full page reloads.&lt;br /&gt;
&lt;h2&gt;History&lt;/h2&gt;In the 1990s, most web sites were based on complete HTML pages; each   user action required that the page be re-loaded from the server (or a   new page loaded). This process is inefficient, as reflected by the user   experience: all page content disappears then reappears, etc. Each time a   page is reloaded due to a partial change, all of the content must be   re-sent instead of only the changed information. This can place   additional load on the server and use excessive bandwidth.&lt;br /&gt;
Asynchronous loading of content first became practical when &lt;a href=&quot;http://en.wikipedia.org/wiki/Java_applet&quot; title=&quot;Java applet&quot;&gt;Java applets&lt;/a&gt; were introduced in the first version of the Java language in 1995. These allow &lt;a href=&quot;http://en.wikipedia.org/wiki/Compiler&quot; title=&quot;Compiler&quot;&gt;compiled&lt;/a&gt; client-side code to load data asynchronously from the web server after a web page is loaded.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-applets-2&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt; In 1996, &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_Explorer&quot; title=&quot;Internet Explorer&quot;&gt;Internet Explorer&lt;/a&gt; introduced the &lt;a href=&quot;http://en.wikipedia.org/wiki/Iframe&quot; title=&quot;Iframe&quot;&gt;iframe&lt;/a&gt; element to &lt;a href=&quot;http://en.wikipedia.org/wiki/HTML&quot; title=&quot;HTML&quot;&gt;HTML&lt;/a&gt;, which also enabled asynchronous loading.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-history-3&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt; In 1999, Microsoft created the XMLHTTP &lt;a href=&quot;http://en.wikipedia.org/wiki/ActiveX&quot; title=&quot;ActiveX&quot;&gt;ActiveX&lt;/a&gt; control in &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_Explorer_5&quot; title=&quot;Internet Explorer 5&quot;&gt;Internet Explorer 5&lt;/a&gt;, which was later adopted by &lt;a href=&quot;http://en.wikipedia.org/wiki/Mozilla&quot; title=&quot;Mozilla&quot;&gt;Mozilla&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Safari_%28web_browser%29&quot; title=&quot;Safari (web browser)&quot;&gt;Safari&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Opera_%28web_browser%29&quot; title=&quot;Opera (web browser)&quot;&gt;Opera&lt;/a&gt; and other browsers as the XMLHttpRequest &lt;a href=&quot;http://en.wikipedia.org/wiki/JavaScript&quot; title=&quot;JavaScript&quot;&gt;JavaScript&lt;/a&gt; object.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-history-3&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-apple-4&quot;&gt;[5]&lt;/a&gt;&lt;/sup&gt; Microsoft has adopted the native XMLHttpRequest model as of &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_Explorer_7&quot; title=&quot;Internet Explorer 7&quot;&gt;Internet Explorer 7&lt;/a&gt;,   though the ActiveX version is still supported. The utility of   background HTTP requests to the server and asynchronous web technologies   remained fairly obscure until it started appearing in full scale  online  applications such as &lt;a href=&quot;http://en.wikipedia.org/wiki/Outlook_Web_Access&quot; title=&quot;Outlook Web Access&quot;&gt;Outlook Web Access&lt;/a&gt; (2000)&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-5&quot;&gt;[6]&lt;/a&gt;&lt;/sup&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Oddpost&quot; title=&quot;Oddpost&quot;&gt;Oddpost&lt;/a&gt; (2002), and later, &lt;a href=&quot;http://en.wikipedia.org/wiki/Google&quot; title=&quot;Google&quot;&gt;Google&lt;/a&gt; made a wide deployment of Ajax with &lt;a href=&quot;http://en.wikipedia.org/wiki/Gmail&quot; title=&quot;Gmail&quot;&gt;Gmail&lt;/a&gt; (2004) and &lt;a href=&quot;http://en.wikipedia.org/wiki/Google_Maps&quot; title=&quot;Google Maps&quot;&gt;Google Maps&lt;/a&gt; (2005).&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-xhr-standard-6&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
The term &lt;i&gt;Ajax&lt;/i&gt; was coined on February 18, 2005 by &lt;a href=&quot;http://en.wikipedia.org/wiki/Jesse_James_Garrett&quot; title=&quot;Jesse James Garrett&quot;&gt;Jesse James Garrett&lt;/a&gt; in an article entitled &lt;i&gt;Ajax: A New Approach to Web Applications&lt;/i&gt;.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-garrett-0&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
On April 5, 2006 the &lt;a href=&quot;http://en.wikipedia.org/wiki/World_Wide_Web_Consortium&quot; title=&quot;World Wide Web Consortium&quot;&gt;World Wide Web Consortium&lt;/a&gt; (W3C) released the first draft specification for the XMLHttpRequest object in an attempt to create an official &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_standard&quot; title=&quot;Web standard&quot;&gt;web standard&lt;/a&gt;.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-xhr-standard-6&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
&lt;h2&gt;Technologies&lt;/h2&gt;The term &lt;i&gt;Ajax&lt;/i&gt; has come to represent a broad group of web   technologies that can be used to implement a web application that   communicates with a server in the background, without interfering with   the current state of the page. In the article that coined the term Ajax,&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-garrett-0&quot;&gt;[1]&lt;/a&gt;&lt;/sup&gt; &lt;a href=&quot;http://en.wikipedia.org/wiki/Jesse_James_Garrett&quot; title=&quot;Jesse James Garrett&quot;&gt;Jesse James Garrett&lt;/a&gt; explained that the following technologies are incorporated:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/HTML&quot; title=&quot;HTML&quot;&gt;HTML&lt;/a&gt; or &lt;a href=&quot;http://en.wikipedia.org/wiki/XHTML&quot; title=&quot;XHTML&quot;&gt;XHTML&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/CSS&quot; title=&quot;CSS&quot;&gt;CSS&lt;/a&gt; for presentation&lt;/li&gt;
&lt;li&gt;the &lt;a href=&quot;http://en.wikipedia.org/wiki/Document_Object_Model&quot; title=&quot;Document Object Model&quot;&gt;Document Object Model&lt;/a&gt; (DOM) for dynamic display of and interaction with data&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/XML&quot; title=&quot;XML&quot;&gt;XML&lt;/a&gt; for the interchange of data, and &lt;a href=&quot;http://en.wikipedia.org/wiki/XSLT&quot; title=&quot;XSLT&quot;&gt;XSLT&lt;/a&gt; for its manipulation&lt;/li&gt;
&lt;li&gt;the &lt;a href=&quot;http://en.wikipedia.org/wiki/XMLHttpRequest&quot; title=&quot;XMLHttpRequest&quot;&gt;XMLHttpRequest&lt;/a&gt; object for asynchronous communication&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/JavaScript&quot; title=&quot;JavaScript&quot;&gt;JavaScript&lt;/a&gt; to bring these technologies together&lt;/li&gt;
&lt;/ul&gt;Since then, however, there have been a number of developments in the   technologies used in an Ajax application, and the definition of the  term  Ajax. In particular, it has been noted that JavaScript is not the  only  client-side scripting language that can be used for implementing  an Ajax  application; other languages such as &lt;a href=&quot;http://en.wikipedia.org/wiki/VBScript&quot; title=&quot;VBScript&quot;&gt;VBScript&lt;/a&gt; are also capable of the required functionality.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-wrox-1&quot;&gt;[2]&lt;/a&gt;&lt;/sup&gt;&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-7&quot;&gt;[8]&lt;/a&gt;&lt;/sup&gt;  (However, JavaScript is the most popular language for Ajax programming   due to its inclusion in and compatibility with the majority of modern   web browsers.) Also, XML is not required for data interchange and   therefore XSLT is not required for the manipulation of data. &lt;a href=&quot;http://en.wikipedia.org/wiki/JSON&quot; title=&quot;JSON&quot;&gt;JavaScript Object Notation&lt;/a&gt; (JSON) is often used as an alternative format for data interchange,&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-tapestry-8&quot;&gt;[9]&lt;/a&gt;&lt;/sup&gt; although other formats such as preformatted HTML or plain text can also be used.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-devx-json-9&quot;&gt;[10]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
&lt;h2&gt;Drawbacks&lt;/h2&gt;&lt;ul&gt;&lt;li&gt;Pages dynamically created using successive Ajax requests do not   automatically register themselves with the browser’s history engine, so   clicking the browser’s “back” button may not return the browser to an   earlier state of the Ajax-enabled page, but may instead return to the   last full page visited before it. Workarounds include the use of   invisible &lt;a href=&quot;http://en.wikipedia.org/wiki/Iframe&quot; title=&quot;Iframe&quot;&gt;iframes&lt;/a&gt; to trigger changes in the browser’s history and changing the URL &lt;a href=&quot;http://en.wikipedia.org/wiki/Fragment_identifier&quot; title=&quot;Fragment identifier&quot;&gt;fragment identifier&lt;/a&gt; (the part of a URL after the ‘#’) when Ajax is run and monitoring it for changes.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-interakt-10&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-deepLinkAjax-11&quot;&gt;[12]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;Dynamic web page updates also make it difficult to &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_bookmark&quot; title=&quot;Internet bookmark&quot;&gt;bookmark&lt;/a&gt; a particular state of the application. Solutions to this problem exist, many of which use the URL &lt;a href=&quot;http://en.wikipedia.org/wiki/Fragment_identifier&quot; title=&quot;Fragment identifier&quot;&gt;fragment identifier&lt;/a&gt; (the part of a URL after the ‘#’) to keep track of, and allow returning to, the application in a given state.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-interakt-10&quot;&gt;[11]&lt;/a&gt;&lt;/sup&gt;&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-deepLinkAjax-11&quot;&gt;[12]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;Depending on the nature of the Ajax application, dynamic page   updates may interfere disruptively with user interactions, especially if   working on an unstable internet connection. For instance, editing a   search field may trigger a query to the server for search completions,   but the user may not know that a search completion popup is forthcoming,   and if the internet connection is slow, the popup list may show up at   an inconvenient time, when the user has already proceeded to do   something else.&lt;/li&gt;
&lt;li&gt;Because most &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_crawler&quot; title=&quot;Web crawler&quot;&gt;web crawlers&lt;/a&gt; do not execute JavaScript code,&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-IBM-12&quot;&gt;[13]&lt;/a&gt;&lt;/sup&gt;  publicly indexable web applications should provide an alternative means   of accessing the content that would normally be retrieved with Ajax,   thereby allowing &lt;a href=&quot;http://en.wikipedia.org/wiki/Search_engine&quot; title=&quot;Search engine&quot;&gt;search engines&lt;/a&gt; to index it.&lt;/li&gt;
&lt;li&gt;Any user whose browser does not support JavaScript or   XMLHttpRequest, or simply has this functionality disabled, will not be   able to properly use pages which depend on Ajax. Similarly, devices such   as &lt;a href=&quot;http://en.wikipedia.org/wiki/Mobile_phone&quot; title=&quot;Mobile phone&quot;&gt;mobile phones&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/PDA&quot; title=&quot;PDA&quot;&gt;PDAs&lt;/a&gt;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Screen_reader&quot; title=&quot;Screen reader&quot;&gt;screen readers&lt;/a&gt;  may not have support for the required technologies. Screen readers that   are able to use Ajax may still not be able to properly read the   dynamically generated content.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-sitepoint-13&quot;&gt;[14]&lt;/a&gt;&lt;/sup&gt;  The only way to let the user carry out functionality is to fall back to   non-JavaScript methods. This can be achieved by making sure links and   forms can be resolved properly and do not rely solely on Ajax.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-14&quot;&gt;[15]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;The &lt;a href=&quot;http://en.wikipedia.org/wiki/Same_origin_policy&quot; title=&quot;Same origin policy&quot;&gt;same origin policy&lt;/a&gt; prevents some Ajax techniques from being used across domains,&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-xhr-standard-6&quot;&gt;[7]&lt;/a&gt;&lt;/sup&gt; although the W3C has a draft of the XMLHttpRequest object that would enable this functionality.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-xdr-15&quot;&gt;[16]&lt;/a&gt;&lt;/sup&gt; Methods exist to sidestep this security feature by using a special Cross Domain Communications channel embedded as an &lt;a href=&quot;http://en.wikipedia.org/wiki/Iframe&quot; title=&quot;Iframe&quot;&gt;iframe&lt;/a&gt; within a page,&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-CrossDomainCommunication-16&quot;&gt;[17]&lt;/a&gt;&lt;/sup&gt; or by the use of &lt;a href=&quot;http://en.wikipedia.org/wiki/JSONP#JSONP&quot; title=&quot;JSONP&quot;&gt;JSONP&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Ajax-powered interfaces may dramatically increase the number of   user-generated requests to web servers and their back-ends (databases,   or other). This can lead to longer response times and/or additional   hardware needs.&lt;/li&gt;
&lt;li&gt;The asynchronous, callback-style of programming required can lead to complex code that is hard to maintain or debug. &lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-async_wrong-17&quot;&gt;[18]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;ul&gt;&lt;li&gt;Ajax cannot easily be read by screen-reading technologies, such as   JAWS, without hints built into the corresponding HTML based on WAI-ARIA   standards. Screen-reading technologies are used by individuals with an   impairment that hinders or prevents the ability to read the content on a   screen.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29#cite_note-WAI_ARIA-18&quot;&gt;[19]&lt;/a&gt;&lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/3663950564627714174/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/ajax.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/3663950564627714174'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/3663950564627714174'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/ajax.html' title='AJAX'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-4314908697558056018</id><published>2011-04-22T18:07:00.002+07:00</published><updated>2011-04-29T09:28:20.059+07:00</updated><title type='text'>PHP CLI</title><content type='html'>&lt;div&gt;&lt;b&gt;What is PHP CLI?&lt;/b&gt;&amp;nbsp;&lt;/div&gt;&lt;div&gt;PHP CLI is a short for &lt;b&gt;PHP Command Line Interface&lt;/b&gt;.   As the name implies, this is a way of using PHP in the system command   line. Or by other words it is a way of running PHP Scripts that aren’t   on a web server (such as Apache web server or Microsoft IIS). People   usually treat PHP as web development, server side tool. However, PHP CLI   applies all advantages of PHP to shell scripting allowing to create   either service side supporting scripts or system application even with   GUI!&lt;/div&gt;&lt;div&gt;PHP CLI is available on all popular operating systems: Linux,   Windows, OSX, Solaris. Popular Linux distributions (such as Ubuntu,   Debian, Fedora Core, Suse and  etc.) allow to install PHP CLI from   package manager (e.g. Synaptic or similar) with couple of mouse clicks.   This makes installation hassle free and you can start using it within a   seconds!&lt;/div&gt;&lt;div id=&quot;googleads_adunit_300x250&quot;&gt;&lt;ins&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;ins&gt;&lt;/ins&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div&gt;&lt;b&gt;PHP CLI&lt;/b&gt; SAPI  was first released in PHP 4.2.0 as experimental, but&lt;b&gt; as of version PHP 4.3.0 (including PHP5), it is fully supported and enabled by default&lt;/b&gt;.   PHP CLI is just a new SAPI type (Server Application Programming   Interface) that focused on developing shell (or desktop as well)   applications with PHP. It’s worth mentioning that &lt;a href=&quot;http://www.php-cli.com/php-cli-cgi.shtml&quot;&gt;PHP CLI and PHP CGI&lt;/a&gt; are different SAPI’s although they do share many of the same behaviours.&lt;/div&gt;&lt;div&gt;If you have standard installation of PHP for Apache web server,   then there are very high chances that you already have PHP CLI installed   on your system. You chances are even higher if your system is running   Linux. If you unlucky enough not to have it buy default, then you need   to  recompile your  PHP with the –enable-cli  flag or reinstall from  the package that does have it. If you are  running Windows, then you  probably need to add php executable to your  system path.&lt;/div&gt;&lt;div&gt;The simplest PHP CLI script on Linux would look like this:&amp;nbsp; &lt;br /&gt;
&lt;div&gt;&lt;div&gt;#!/usr/bin/php -q&lt;/div&gt;&lt;div&gt;&amp;lt;?php echo “Hello world of PHP CLI!”; ?&amp;gt;&lt;/div&gt;&lt;/div&gt;Windows user would need to amend the first line with appropriate windows style path to php.exe:&lt;br /&gt;
&lt;div&gt;&lt;div&gt;#!C:\php\php.exe -q&lt;/div&gt;&lt;div&gt;&amp;lt;?php echo “Hello world of PHP CLI!”; ?&amp;gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Why to use PHP CLI? &lt;/b&gt; One want to use PHP CLI  SAPI  simply because there are several advantages in being able to run  PHP  code from command line such as:&amp;nbsp; &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;no need to learn another language such as Perl, Bash or Awk&lt;/li&gt;
&lt;li&gt;running scheduled (CRON) tasks written in php&lt;/li&gt;
&lt;li&gt;making GUI applications with PHP and GTK&lt;/li&gt;
&lt;li&gt;reusage of your existing components&lt;/li&gt;
&lt;li&gt;write very robust scripts for your system by using PHP5 multithreading capabilities&lt;/li&gt;
&lt;li&gt;access system STDIN, STDOUT, STERR with PHP&lt;/li&gt;
&lt;/ul&gt;&lt;div&gt;&lt;b&gt; Command Line Interface and CRON :&lt;/b&gt; Running  PHP  scripts in CRON allows you to do scheduled tasks. For example, check   weather links on your links page are still alive or run scheduled   billing or maintain customers accounts (email customers that their   account has to be renewed in next X days, backup for files and folders,   creating health checkers (pinging and retrieving your remote servers or   web pages regularly to make sure they are working and emailing you if   they are down or slow), staring other programs) or anything else that   you can imagine. CRON is available only for Linux. However, if you are a   Windows user you may use AT command to schedule execution time.&lt;/div&gt;&lt;div&gt;&lt;b&gt; Command Line Interface and GTK :&lt;/b&gt; YES! You  can do  GUI (graphical user interface) applications for your Windows or  Linux  box with PHP! All you need is PHP Command Line Interface and GTK  in a  pack. This will allow to create really portable GUI applications  and  won’t require to learn anything else. Just PHP. GTK is available  both  on Linux and Windows.&lt;/div&gt;&lt;div&gt;&lt;b&gt; Command Line Interface and Your Components :&lt;/b&gt; Bet  you have already written good  and re-usable classes or functions  that  you are using in every project. For example, database abstraction  layer  or just a DB connection function or it might be a logging script  or  date calculation class / library. With PHP Command Line Interface you   can reuse them in command line without reinventing the wheel by doing   the same in Perl or any other command line enabled language.&lt;/div&gt;&lt;div&gt;&lt;b&gt; Command Line Interface and PHP5 Multithreading :&lt;/b&gt;  If you have a bottle neck in database or network connection then you   can speed up your script up to  1000% just by implementing PHP5   multithreading. For example, you may spend 10 seconds just to establish   http connection when you fopening remote http page and just 1 second to   retrieve the content. If you need to fopen 1000 pages one by one then   you will spend 10*1000+1*1000 = 11000 seconds (3 hours and 3 minutes)!   If you run 100 threads then you will spend (10*1000+1*1000)/100 = 110   seconds (less then 2 minutes!). Obviously, you will need powerful enough   CPU, enough memory and network bandwidth.&lt;/div&gt;&lt;/div&gt;&lt;div&gt;source : http://www.php-cli.com/&lt;/div&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/4314908697558056018/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/php-cli.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/4314908697558056018'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/4314908697558056018'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/php-cli.html' title='PHP CLI'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-6730001003788393302</id><published>2011-04-22T18:06:00.006+07:00</published><updated>2011-04-29T09:28:25.372+07:00</updated><title type='text'>cron</title><content type='html'>&lt;b&gt;Cron&lt;/b&gt; is a time-based &lt;a href=&quot;http://en.wikipedia.org/wiki/Job_scheduler&quot; title=&quot;Job scheduler&quot;&gt;job scheduler&lt;/a&gt; in &lt;a href=&quot;http://en.wikipedia.org/wiki/Unix-like&quot; title=&quot;Unix-like&quot;&gt;Unix-like&lt;/a&gt; computer &lt;a href=&quot;http://en.wikipedia.org/wiki/Operating_system&quot; title=&quot;Operating system&quot;&gt;operating systems&lt;/a&gt;. The name &lt;i&gt;cron&lt;/i&gt; comes from the word “chronos”, Greek for “time”. Cron enables users to schedule jobs (commands or &lt;a href=&quot;http://en.wikipedia.org/wiki/Shell_script&quot; title=&quot;Shell script&quot;&gt;shell scripts&lt;/a&gt;)   to run periodically at certain times or dates. It is commonly used to   automate system maintenance or administration, though its   general-purpose nature means that it can be used for other purposes,   such as connecting to the &lt;a href=&quot;http://en.wikipedia.org/wiki/Internet&quot; title=&quot;Internet&quot;&gt;Internet&lt;/a&gt; and downloading &lt;a href=&quot;http://en.wikipedia.org/wiki/Email&quot; title=&quot;Email&quot;&gt;email&lt;/a&gt;.&lt;br /&gt;
&lt;h2&gt;Overview&lt;/h2&gt;Cron is driven by a &lt;i&gt;crontab&lt;/i&gt; (cron table) file, a configuration file that specifies &lt;a href=&quot;http://en.wikipedia.org/wiki/Unix_shell&quot; title=&quot;Unix shell&quot;&gt;shell&lt;/a&gt;  commands to run periodically on a given schedule. The crontab files are   stored where the lists of jobs and other instructions to the cron   daemon are kept. Users can have their own individual crontab files and   often there is a system wide crontab file (usually in &lt;code&gt;/etc&lt;/code&gt; or a subdirectory of &lt;code&gt;/etc&lt;/code&gt;) which only system administrators can edit.&lt;br /&gt;
Each line of a crontab file represents a job and is composed of a &lt;a href=&quot;http://en.wikipedia.org/wiki/CRON_expression&quot; title=&quot;CRON expression&quot;&gt;CRON expression&lt;/a&gt;, followed by a shell command to execute. Some implementations of cron, such as that in the popular &lt;a href=&quot;http://en.wikipedia.org/wiki/Bsd#4.3BSD&quot; title=&quot;Bsd&quot;&gt;4th BSD edition&lt;/a&gt; written by &lt;a href=&quot;http://en.wikipedia.org/wiki/Paul_Vixie&quot; title=&quot;Paul Vixie&quot;&gt;Paul Vixie&lt;/a&gt;  and included in many Linux distributions, add a sixth field to the   format: an account username that the specified job will be run by   (subject to user existence and permissions). This is only allowed in the   system crontabs, not in others which are each assigned to a single  user  to configure.&lt;br /&gt;
For “day of the week” (field 5), both 0 and 7 are considered Sunday,   though some versions of Unix such as AIX do not list “7″ as acceptable   in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Man_page&quot; title=&quot;Man page&quot;&gt;man page&lt;/a&gt;. While normally the job is executed when the time/date specification fields &lt;i&gt;all&lt;/i&gt;  match the current time and date, there is one exception: if both “day   of month” and “day of week” are restricted (not “*”), then &lt;b&gt;either&lt;/b&gt; the “day of month” field (3) &lt;b&gt;or&lt;/b&gt; the “day of week” field (5) must match the current day.&lt;br /&gt;
&lt;h3&gt;Examples&lt;/h3&gt;The following will clear the Apache error log at one minute past   midnight (00:01 of every day of the month, of every day of the week),   assuming that the default shell for the cron user is &lt;a href=&quot;http://en.wikipedia.org/wiki/Bourne_shell&quot; title=&quot;Bourne shell&quot;&gt;Bourne shell&lt;/a&gt; compliant.&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;pre&gt;1 0 * * *  echo -n &quot;&quot; &amp;gt; /www/apache/logs/error_log&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;The following would run cron every two hours like 2am, 4am, 6am, 8am&lt;br /&gt;
&lt;div dir=&quot;ltr&quot;&gt;&lt;div&gt;&lt;pre&gt;0 */2 * * *  /home/user/test.pl&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&lt;h3&gt;Predefined scheduling definitions&lt;/h3&gt;There are several special predefined values which can be used to substitute the CRON expression.&lt;br /&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;th&gt;Entry&lt;/th&gt; &lt;th&gt;Description&lt;/th&gt; &lt;th&gt;Equivalent To&lt;/th&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;code&gt;@yearly (or @annually)&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Run once a year&lt;/td&gt; &lt;td&gt;&lt;code&gt;0 0 1 1 *&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;code&gt;@monthly&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Run once a month&lt;/td&gt; &lt;td&gt;&lt;code&gt;0 0 1 * *&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;code&gt;@weekly&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Run once a week&lt;/td&gt; &lt;td&gt;&lt;code&gt;0 0 * * 0&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;code&gt;@daily (or @midnight)&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Run once a day&lt;/td&gt; &lt;td&gt;&lt;code&gt;0 0 * * *&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;code&gt;@hourly&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Run once an hour&lt;/td&gt; &lt;td&gt;&lt;code&gt;0 * * * *&lt;/code&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;tr&gt; &lt;td&gt;&lt;code&gt;@reboot&lt;/code&gt;&lt;/td&gt; &lt;td&gt;Run at startup&lt;/td&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;pre&gt;*     *     *   *    *        command to be executed
-     -     -   -    -
|     |     |   |    |
|     |     |   |    +----- day of week (0 - 6) (Sunday=0)
|     |     |   +------- month (1 - 12)
|     |     +--------- day of        month (1 - 31)
|     +----------- hour (0 - 23)
+------------- min (0 - 59)&lt;/pre&gt;&lt;code&gt;@reboot&lt;/code&gt; configures a job to run once when the daemon is   started. Since cron is typically never restarted, this typically   corresponds to the machine being booted. This behavior is enforced in   some variations of cron, such as that provided in Debian&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cron#cite_note-debiancron-2&quot;&gt;[3]&lt;/a&gt;&lt;/sup&gt;, so that simply restarting the daemon does not re-run &lt;code&gt;@reboot&lt;/code&gt; jobs.&lt;br /&gt;
&lt;code&gt;@reboot&lt;/code&gt; can be useful if there is a need to start up a   server or daemon under a particular user, and the user does not have   access to configure &lt;a href=&quot;http://en.wikipedia.org/wiki/Init&quot; title=&quot;Init&quot;&gt;init&lt;/a&gt; to start the program.&lt;br /&gt;
&lt;h3&gt;Cron permissions&lt;/h3&gt;The following two files play an important role:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;/etc/cron.allow&lt;/b&gt; – If this file exists, then you must be listed therein (your username must be listed) in order to be allowed to use cron jobs.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;/etc/cron.deny&lt;/b&gt; – If the cron.allow file does not  exist but  the /etc/cron.deny file does exist, then you must not be  listed in the  /etc/cron.deny file in order to use cron jobs.&lt;/li&gt;
&lt;/ul&gt;Please note that if neither of these files exists, then depending on   site-dependent configuration parameters, only the super user will be   allowed to use cron jobs, or all users will be able to use cron jobs.&lt;br /&gt;
&lt;h3&gt;Timezone handling&lt;/h3&gt;Most cron implementations simply interpret crontab entries in the   system time zone setting under which the cron daemon itself is run. This   can be a source of dispute if a large multiuser machine has users in   several time zones, especially if the system default timezone includes   the potentially confusing &lt;a href=&quot;http://en.wikipedia.org/wiki/DST&quot; title=&quot;DST&quot;&gt;DST&lt;/a&gt;.   Thus, a cron implementation may special-case any “TZ=&amp;lt;timezone&amp;gt;”   environment variable setting lines in user crontabs, interpreting   subsequent crontab entries relative to that timezone.&lt;sup&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cron#cite_note-solaristzcrontab-3&quot;&gt;[4]&lt;/a&gt;&lt;/sup&gt;&lt;br /&gt;
&lt;h2&gt;History&lt;/h2&gt;&lt;h3&gt;Early versions&lt;/h3&gt;The cron in &lt;a href=&quot;http://en.wikipedia.org/wiki/Version_7_Unix&quot; title=&quot;Version 7 Unix&quot;&gt;Version 7 Unix&lt;/a&gt;, written by &lt;a href=&quot;http://en.wikipedia.org/wiki/Brian_Kernighan&quot; title=&quot;Brian Kernighan&quot;&gt;Brian Kernighan&lt;/a&gt;, was a system service (later called &lt;a href=&quot;http://en.wikipedia.org/wiki/Daemon_%28computer_software%29&quot; title=&quot;Daemon (computer software)&quot;&gt;daemons&lt;/a&gt;) invoked from &lt;code&gt;/etc/inittab&lt;/code&gt; when the operating system entered multi-user mode. Its algorithm was straightforward:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;Read &lt;code&gt;/usr/etc/crontab&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Determine if any commands are to be run at the current date and time and if so, run them as the &lt;a href=&quot;http://en.wikipedia.org/wiki/Superuser&quot; title=&quot;Superuser&quot;&gt;Superuser&lt;/a&gt;, root.&lt;/li&gt;
&lt;li&gt;Sleep for one minute&lt;/li&gt;
&lt;li&gt;Repeat from step 1.&lt;/li&gt;
&lt;/ol&gt;This version of cron was basic and robust but it also consumed   resources whether it found any work to do or not. In an experiment at   Purdue University in the late 1970s to extend cron’s service to all 100   users on a time-shared &lt;a href=&quot;http://en.wikipedia.org/wiki/VAX&quot; title=&quot;VAX&quot;&gt;VAX&lt;/a&gt;, it was found to place too much load on the system.&lt;br /&gt;
&lt;h3&gt;Multi-user capability&lt;/h3&gt;The next version of cron, with the release of &lt;a href=&quot;http://en.wikipedia.org/wiki/Unix_System_V&quot; title=&quot;Unix System V&quot;&gt;Unix System V&lt;/a&gt;,   was created to extend the capabilities of cron to all users of a Unix   system, not just the superuser. Though this may seem trivial today with   most Unix and Unix-like systems having powerful processors and small   numbers of users, at the time it required a new approach on a 1 &lt;a href=&quot;http://en.wikipedia.org/wiki/Instructions_per_second&quot; title=&quot;Instructions per second&quot;&gt;MIPS&lt;/a&gt; system having roughly 100 user accounts.&lt;br /&gt;
In the August, 1977 issue of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Communications_of_the_ACM&quot; title=&quot;Communications of the ACM&quot;&gt;Communications of the ACM&lt;/a&gt;,   W. R. Franta and Kurt Maly published an article entitled “An efficient   data structure for the simulation event set” describing an event queue   data structure for discrete event-driven simulation systems that   demonstrated “performance superior to that of commonly used simple   linked list algorithms,” good behavior given non-uniform time   distributions, and worst case &lt;a href=&quot;http://en.wikipedia.org/wiki/Computational_complexity&quot; title=&quot;Computational complexity&quot;&gt;complexity&lt;/a&gt; &lt;img alt=&quot;O\left(\sqrt{n}\right)&quot; src=&quot;http://upload.wikimedia.org/math/1/2/6/126f3877a4bfba2c17a3be00b8f730f1.png&quot; /&gt;, “n” being the number of events in the queue.&lt;br /&gt;
A graduate student, Robert Brown, reviewing this article, recognized the parallel between cron and &lt;a href=&quot;http://en.wikipedia.org/wiki/Discrete_event_simulation&quot; title=&quot;Discrete event simulation&quot;&gt;discrete event simulators&lt;/a&gt;,   and created an implementation of the Franta-Maly event list manager   (ELM) for experimentation. Discrete event simulators run in “virtual   time”, peeling events off the event queue as quickly as possible and   advancing their notion of “now” to the scheduled time of the next event.   By running the event simulator in “real time” instead of virtual time,  a  version of cron was created that spent most of its time sleeping,   waiting for the moment in time when the task at the head of the event   list was to be executed.&lt;br /&gt;
The following school year brought new students into the graduate   program, including Keith Williamson, who joined the systems staff in the   Computer Science department. As a “warm up task” Brown asked him to   flesh out the prototype cron into a production service, and this   multi-user cron went into use at Purdue in late 1979. This version of   cron wholly replaced the &lt;code&gt;/etc/cron&lt;/code&gt; that was in use on the Computer Science department’s VAX 11/780 running 32/V.&lt;br /&gt;
The algorithm used by this cron is as follows:&lt;br /&gt;
&lt;ol&gt;&lt;li&gt;On start-up, look for a file named &lt;code&gt;.crontab&lt;/code&gt; in the home directories of all account holders.&lt;/li&gt;
&lt;li&gt;For each crontab file found, determine the next time in the future that each command is to be run.&lt;/li&gt;
&lt;li&gt;Place those commands on the Franta-Maly event list with their corresponding time and their “five field” time specifier.&lt;/li&gt;
&lt;li&gt;Enter main loop: &lt;ol&gt;&lt;li&gt;Examine the task entry at the head of the queue, compute how far in the future it is to be run.&lt;/li&gt;
&lt;li&gt;Sleep for that period of time.&lt;/li&gt;
&lt;li&gt;On awakening and after verifying the correct time, execute the task   at the head of the queue (in background) with the privileges of the  user  who created it.&lt;/li&gt;
&lt;li&gt;Determine the next time in the future to run this command and place it back on the event list at that time value.&lt;/li&gt;
&lt;/ol&gt;&lt;/li&gt;
&lt;/ol&gt;Additionally, the daemon would respond to &lt;a href=&quot;http://en.wikipedia.org/wiki/SIGHUP&quot; title=&quot;SIGHUP&quot;&gt;SIGHUP&lt;/a&gt;  signals to rescan modified crontab files and would schedule special   “wake up events” on the hour and half hour to look for modified crontab   files. Much detail is omitted here concerning the inaccuracies of   computer time-of-day tracking, Unix alarm scheduling, explicit   time-of-day changes, and process management, all of which account for   the majority of the lines of code in this cron. This cron also captured   the output of &lt;i&gt;stdout&lt;/i&gt; and &lt;i&gt;stderr&lt;/i&gt; and e-mailed any output to the crontab owner.&lt;br /&gt;
The resources consumed by this cron scale only with the amount of   work it is given and do not inherently increase over time with the   exception of periodically checking for changes.&lt;br /&gt;
Williamson completed his studies and departed the University with a   Masters of Science in Computer Science and joined AT&amp;amp;T Bell Labs in   Murray Hill, New Jersey, and took this cron with him. At Bell Labs, he   and others incorporated the Unix &lt;code&gt;at&lt;/code&gt; command into cron,   moved the crontab files out of users’ home directories (which were not   host-specific) and into a common host-specific spool directory, and of   necessity added the &lt;code&gt;crontab&lt;/code&gt; command to allow users to copy their crontabs to that spool directory.&lt;br /&gt;
This version of cron later appeared largely unchanged in &lt;a href=&quot;http://en.wikipedia.org/wiki/Unix_System_V&quot; title=&quot;Unix System V&quot;&gt;Unix System V&lt;/a&gt; and in BSD and their derivatives, the &lt;a href=&quot;http://en.wikipedia.org/wiki/Solaris_Operating_System&quot; title=&quot;Solaris Operating System&quot;&gt;Solaris Operating System&lt;/a&gt; from &lt;a href=&quot;http://en.wikipedia.org/wiki/Sun_Microsystems&quot; title=&quot;Sun Microsystems&quot;&gt;Sun Microsystems&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/IRIX&quot; title=&quot;IRIX&quot;&gt;IRIX&lt;/a&gt; from &lt;a href=&quot;http://en.wikipedia.org/wiki/Silicon_Graphics&quot; title=&quot;Silicon Graphics&quot;&gt;Silicon Graphics&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/HP-UX&quot; title=&quot;HP-UX&quot;&gt;HP-UX&lt;/a&gt; from &lt;a href=&quot;http://en.wikipedia.org/wiki/Hewlett-Packard&quot; title=&quot;Hewlett-Packard&quot;&gt;Hewlett-Packard&lt;/a&gt;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/IBM_AIX_%28operating_system%29&quot; title=&quot;IBM AIX (operating system)&quot;&gt;IBM AIX&lt;/a&gt;.   Technically, the original license for these implementations should be   with the Purdue Research Foundation who funded the work, but this took   place at a time when little concern was given to such matters.&lt;br /&gt;
&lt;h3&gt;Modern versions&lt;/h3&gt;With the advent of the &lt;a href=&quot;http://en.wikipedia.org/wiki/GNU_Project&quot; title=&quot;GNU Project&quot;&gt;GNU Project&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Linux&quot; title=&quot;Linux&quot;&gt;Linux&lt;/a&gt;, new crons appeared. The most prevalent of these is the Vixie cron, originally coded by &lt;a href=&quot;http://en.wikipedia.org/wiki/Paul_Vixie&quot; title=&quot;Paul Vixie&quot;&gt;Paul Vixie&lt;/a&gt; in 1987. Version 3 of &lt;b&gt;Vixie cron&lt;/b&gt; was released in late 1993. Version 4.1 was renamed to &lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Internet_Systems_Consortium&quot; title=&quot;Internet Systems Consortium&quot;&gt;ISC&lt;/a&gt; Cron&lt;/b&gt; and was released in January 2004. Version 3, with some minor bugfixes, is used in most distributions of Linux and BSDs.&lt;br /&gt;
In 2007, RedHat forked vixie-cron 4.1 to the cronie project and included anacron 2.3 in 2009.&lt;br /&gt;
Other popular implementations include &lt;a href=&quot;http://en.wikipedia.org/wiki/Anacron&quot; title=&quot;Anacron&quot;&gt;anacron&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Fcron&quot; title=&quot;Fcron&quot;&gt;fcron&lt;/a&gt;. However, &lt;a href=&quot;http://en.wikipedia.org/wiki/Anacron&quot; title=&quot;Anacron&quot;&gt;anacron&lt;/a&gt; is not an independent cron program; it relies on another cron program to call it in order to perform.&lt;br /&gt;
A &lt;a href=&quot;http://en.wikipedia.org/wiki/Webcron&quot; title=&quot;Webcron&quot;&gt;webcron solution&lt;/a&gt; schedules recurring tasks to run on a regular basis wherever cron implementations may not be available in a &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_hosting_service&quot; title=&quot;Web hosting service&quot;&gt;web hosting&lt;/a&gt; environment.&lt;br /&gt;
source : http://en.wikipedia.org/wiki/Cron&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/6730001003788393302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/cron.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6730001003788393302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6730001003788393302'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/cron.html' title='cron'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-1928582862004716031</id><published>2011-04-22T18:05:00.001+07:00</published><updated>2011-04-29T09:28:36.525+07:00</updated><title type='text'>Creating a Simple Twitter App using oAuth and PHP</title><content type='html'>Everyone on the web is updating to the  latest &amp;amp; the most secure  technologies with Twitter being the most  hyped one as it upgraded from  basic Authentication to the more secure  oAuth. Earlier people had to  risk their Twitter login credentials if  they wanted to use some  external Apps that gave them more control over  their Twitter profile.  Twitter would now be removing the basic Auth to  fully support oAuth. As  Twitter describes oAuth is:&lt;br /&gt;
&lt;a href=&quot;http://www.1stwebdesigner.com/tutorials/twitter-app-oauth-php/&quot; title=&quot;Creating a Simple Twitter App using oAuth and PHP&quot;&gt;&lt;img alt=&quot;Creating a Simple Twitter App using oAuth and PHP&quot; src=&quot;http://www.1stwebdesigner.com/wp-content/themes/1stwd/img/grey.gif&quot; width=&quot;570&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;blockquote&gt;OAuth is an authentication protocol that allows users to   approve      application to act on their behalf without sharing their   password.      More information can be found at      &lt;a href=&quot;http://oauth.net/&quot; rel=&quot;external&quot;&gt;oauth.net&lt;/a&gt; or in      the excellent &lt;a href=&quot;http://hueniverse.com/oauth/&quot; rel=&quot;external&quot;&gt;Beginner’s  Guide to OAuth&lt;/a&gt; from Hueniverse.&lt;/blockquote&gt;As the title suggests, today we’ll be  making a basic application  which updates your Twitter status using oAuth  and PHP. So let’s get  started without wasting anymore time!&lt;br /&gt;
&lt;a href=&quot;http://tutorialswalk.info/demo/twitter-update-php-oauth/&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;48&quot; src=&quot;http://www.1stwebdesigner.com/wp-content/themes/1stwd/img/grey.gif&quot; width=&quot;166&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/07/twitter-oauth.zip&quot; target=&quot;_blank&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;48&quot; src=&quot;http://www.1stwebdesigner.com/wp-content/themes/1stwd/img/grey.gif&quot; width=&quot;170&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;&lt;a href=&quot;http://tutorialswalk.info/demo/twitter-update-php-oauth/lib.zip&quot; target=&quot;_blank&quot;&gt;DOWNLOAD THE LIBRARY HERE!&lt;/a&gt;&lt;/h3&gt;NOTE: I  strongly suggest that you should click on each of the  screen-shots  below, so that you can clearly understand what’s going on!&lt;br /&gt;
Before starting up, I also suggest you to read the other article on &lt;i&gt;Updating Twitter using PHP&lt;/i&gt; as it has some background information about this article. &lt;a href=&quot;http://www.1stwebdesigner.com/tutorials/how-to-update-twitter-using-php-and-twitter-api/&quot; target=&quot;_blank&quot;&gt;Read it here!&lt;/a&gt;&lt;br /&gt;
&lt;h3&gt;SETTING IT UP&lt;/h3&gt;To get started open up notepad or any other code editor and make three files “&lt;i&gt;index.php, style.css &amp;amp; update.php&lt;/i&gt;“. Now download the “&lt;a href=&quot;http://tutorialswalk.info/demo/twitter-update-php-oauth/lib.zip&quot; target=&quot;_blank&quot;&gt;download  this Twitter oAuth library&lt;/a&gt;” made by &lt;a href=&quot;http://www.jaisenmathai.com/&quot; target=&quot;_blank&quot;&gt;Jaisen Mathai&lt;/a&gt; “&lt;a href=&quot;http://tutorialswalk.info/demo/twitter-update-php-oauth/lib.zip&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;“.  It is a &lt;a href=&quot;http://github.com/jmathai/twitter-async&quot; target=&quot;_blank&quot;&gt;ready-made library&lt;/a&gt;  “stamped” by Twitter’s API (itself) which helps you to connect to    Twitter using oAuth. Now place all these files in a folder and they   should look something like this:&lt;br /&gt;
&lt;a href=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/06/folder.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;407&quot; src=&quot;http://www.1stwebdesigner.com/wp-content/themes/1stwd/img/grey.gif&quot; width=&quot;581&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;REGISTERING YOUR APPLICATION ON TWITTER&lt;/h2&gt;First of all we’ll need to register an app for you on Twitter so that you get your &lt;i&gt;API keys&lt;/i&gt; you’ll use.&lt;br /&gt;
&lt;blockquote&gt;After reading that previous statement a question might have taken birth in &amp;nbsp;your mind, &lt;i&gt;&lt;b&gt;What’s the purpose of &amp;nbsp;getting these API Keys from Twitter?&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
We need the API Keys for getting our  Application (app) registered on  Twitter so that Twitter gives us the  right to get the users/visitors  authenticated and get their  credentials/profile info from Twitter. With  the increasing number of  Twitter account frauds these days, I think  that oAuth is the best step  taken by Twitter towards user security.  Also, the API keys let Twitter  know of the URL where the user will be  redirected to after successful  authentication/login.&lt;/blockquote&gt;So for that (getting our app registered on Twitter) &lt;a href=&quot;http://twitter.com/apps&quot; target=&quot;_blank&quot;&gt;click here&lt;/a&gt; or go to &lt;a href=&quot;http://twitter.com/apps&quot; target=&quot;_blank&quot;&gt;http://twitter.com/apps&lt;/a&gt;.   Note that you’ll need to login with your Twitter account to register  an  APP. The registration page that twitter provides is like the one  below.  I’ll describe everything as we go on!&lt;br /&gt;
&lt;a href=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/06/twitter-app.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;962&quot; src=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/06/twitter-app.png&quot; width=&quot;577&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
I have explained the form on the  screenshot above so I strongly  advise you to have a close look to the  form and see what to fill.  Below, I have explained all the elements of  the file;&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;&lt;b&gt;Application Icon:&lt;/b&gt; If you want to give a pictorial representation to your app then this is the way!&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Application Name: &lt;/b&gt;Your application’s name. Be ultra-sure to make it catchy!&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Description: &lt;/b&gt;A small description for your application.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Application Website: &lt;/b&gt;A direct link to your application’s website. (For reference)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Organisation: &lt;/b&gt;Your organisation {Your may name your website here}, although not needed.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Website: &lt;/b&gt;Your Organisation’s website {Your main homepage}, not needed {just for reference}&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Application Type: &lt;/b&gt;This will probably be Browser unless you use Twitter oAuth in a software.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Callback URL: &lt;/b&gt;The URL where Twitter should redirect a user after successful authentication! {See the screenshot for more}&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Default Access Type: &lt;/b&gt;It should be &lt;i&gt;Read &amp;amp; Write&lt;/i&gt; unless you just need to use the profile information of a user.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Use Twitter for login:&lt;/b&gt; If you are using Twitter as a &lt;i&gt;Login&lt;/i&gt; to your website/application then check this otherwise &lt;b&gt;no need!&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Captcha: &lt;/b&gt;That’s the most difficult part! &lt;img alt=&quot;;)&quot; class=&quot;wp-smiley&quot; src=&quot;http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif?m=1221153943g&quot; /&gt;  haha..Just a captcha and is required!&lt;/li&gt;
&lt;/ul&gt;After that just click on &lt;i&gt;Save&lt;/i&gt; and you’ll be redirected to a page where Twitter will give you your API info. in the form of a &lt;i&gt;Consumer Key &lt;/i&gt;&amp;amp; the &lt;i&gt;Consumer Secret Key&lt;/i&gt;. The page will look something like the one below:&lt;br /&gt;
&lt;a href=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/06/twitter-api-keys.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;637&quot; src=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/06/twitter-api-keys.png&quot; width=&quot;580&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;h2&gt;PREPARING TO MAKE THE APPLICATION&lt;/h2&gt;To get started, we’ll first need to fill the API keys, we got from   Twitter in our Application’s library so that we don’t get confused later   on! To do so open the &lt;i&gt;secret.php&lt;/i&gt; file in the &lt;i&gt;lib&lt;/i&gt; folder and you’ll see something like below:&lt;br /&gt;
&lt;pre&gt;&amp;lt;?php
$consumer_key = &#39;&amp;lt;PLACE YOUR CONSUMER KEY HERE&amp;gt;&#39;;
$consumer_secret = &#39;&amp;lt;PLACE YOUR CONSUMER SECRET KEY HERE&amp;gt;&#39;;
?&amp;gt;&lt;/pre&gt;Now just add the &lt;i&gt;Consumer Key &lt;/i&gt;&amp;amp; the &lt;i&gt;Consumer Secret&lt;/i&gt; you got from Twitter in between the quotes. Below is the copy of the &lt;i&gt;secret.php&lt;/i&gt; file that 1stwebdesigner’s Twitter oAuth application is using:&lt;br /&gt;
&lt;pre&gt;&amp;lt;?php
$consumer_key = &#39;vUztW1221HktEoi1MD3hxg&#39;;
$consumer_secret = &#39;8R7gXaKaGfHHjtMxj6ennJMd0c8esDP4nCsKjiJAk&#39;;
?&amp;gt;&lt;/pre&gt;These API keys {&lt;i&gt;consumer key, consumer secret&lt;/i&gt;} enable Twitter to redirect and process your oAuth request to Twitter for login.&lt;br /&gt;
&lt;h2&gt;OUR APPLICATION FILES&lt;/h2&gt;&lt;b&gt;Index.php:&lt;i&gt; &lt;/i&gt;&lt;/b&gt;Basically this file will do all   our work as it shows the “Sign In Through Twitter” button and then   processes all our oAuth request using the oAuth library we are using.   Co-incidentally, Twitter also redirects the user to this file after   successfull authentication {Remember the screenshot above ?}&lt;br /&gt;
&lt;b&gt;Update.php:&lt;/b&gt; You’ll update your Twitter status using this file. Uses &lt;i&gt;index.php&lt;/i&gt; file for form processing. (Explained below!)&lt;br /&gt;
&lt;b&gt;Style.css:&lt;/b&gt; Contains all the styles that we’ll use for our application.&lt;br /&gt;
&lt;h2&gt;WRITING THE APPLICATION&lt;/h2&gt;Open the &lt;i&gt;Index.php&lt;/i&gt; file you made and add the following code to it:&lt;br /&gt;
&lt;pre&gt;&amp;lt;?php

session_start();

include &#39;lib/EpiCurl.php&#39;;
include &#39;lib/EpiOAuth.php&#39;;
include &#39;lib/EpiTwitter.php&#39;;
include &#39;lib/secret.php&#39;;

$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);
$oauth_token = $_GET[&#39;oauth_token&#39;];
 if($oauth_token == &#39;&#39;)
 {
 $url = $twitterObj-&amp;gt;getAuthorizationUrl();
 echo &quot;&amp;lt;div style=&#39;width:200px;margin-top:200px;margin-left:auto;margin-right:auto&#39;&amp;gt;&quot;;
 echo &quot;&amp;lt;a href=&#39;$url&#39;&amp;gt;Sign In with Twitter&amp;lt;/a&amp;gt;&quot;;
 echo &quot;&amp;lt;/div&amp;gt;&quot;;
 }
 else
 {
 $twitterObj-&amp;gt;setToken($_GET[&#39;oauth_token&#39;]);
 $token = $twitterObj-&amp;gt;getAccessToken();
 $twitterObj-&amp;gt;setToken($token-&amp;gt;oauth_token, $token-&amp;gt;oauth_token_secret);
 $_SESSION[&#39;ot&#39;] = $token-&amp;gt;oauth_token;
 $_SESSION[&#39;ots&#39;] = $token-&amp;gt;oauth_token_secret;
 $twitterInfo= $twitterObj-&amp;gt;get_accountVerify_credentials();
 $twitterInfo-&amp;gt;response;

 $username = $twitterInfo-&amp;gt;screen_name;
 $profilepic = $twitterInfo-&amp;gt;profile_image_url;

 include &#39;update.php&#39;;

 }

if(isset($_POST[&#39;submit&#39;]))
 {
 $msg = $_REQUEST[&#39;tweet&#39;];

 $twitterObj-&amp;gt;setToken($_SESSION[&#39;ot&#39;], $_SESSION[&#39;ots&#39;]);
 $update_status = $twitterObj-&amp;gt;post_statusesUpdate(array(&#39;status&#39; =&amp;gt; $msg));
 $temp = $update_status-&amp;gt;response;

 echo &quot;&amp;lt;div align=&#39;center&#39;&amp;gt;Updated your Timeline Successfully .&amp;lt;/div&amp;gt;&quot;;

 }

?&amp;gt;&lt;/pre&gt;Now I’ll be explaining the whole code used above below (in point form):&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;We start off by firing our session using:&lt;b&gt; &lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;session_start();&lt;/pre&gt;&lt;b&gt; &lt;/b&gt;&lt;br /&gt;
&lt;b&gt; &lt;/b&gt;The pre-built PHP function that we are usign above just creates a session  or resumes the    current one.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;To keep the application as simple as we can we include all the files from the library including the &lt;i&gt;secret.php&lt;/i&gt; file:&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;include &#39;lib/EpiCurl.php&#39;;
 include &#39;lib/EpiOAuth.php&#39;;
 include &#39;lib/EpiTwitter.php&#39;;
 include &#39;lib/secret.php&#39;;&lt;/pre&gt;We do so as we’ll be interpreting everything in our &lt;i&gt;index.php&lt;/i&gt; file.&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;The rest of the code just helps in getting the user logged in to Twitter using the &lt;i&gt;access tokens&lt;/i&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;pre&gt;$twitterObj = new EpiTwitter($consumer_key, $consumer_secret);
 $oauth_token = $_GET[&#39;oauth_token&#39;];
 if($oauth_token == &#39;&#39;)
 {
 $url = $twitterObj-&amp;gt;getAuthorizationUrl();
 echo &quot;&amp;lt;div  style=&#39;width:200px;margin-top:200px;margin-left:auto;margin-right:auto&#39;&amp;gt;&quot;;
 echo &quot;&amp;lt;a href=&#39;$url&#39;&amp;gt;Sign In with Twitter&amp;lt;/a&amp;gt;&quot;;
 echo &quot;&amp;lt;/div&amp;gt;&quot;;
 }
 else
 {
 $twitterObj-&amp;gt;setToken($_GET[&#39;oauth_token&#39;]);
 $token = $twitterObj-&amp;gt;getAccessToken();
 $twitterObj-&amp;gt;setToken($token-&amp;gt;oauth_token,  $token-&amp;gt;oauth_token_secret);
 $_SESSION[&#39;ot&#39;] = $token-&amp;gt;oauth_token;
 $_SESSION[&#39;ots&#39;] = $token-&amp;gt;oauth_token_secret;
 $twitterInfo= $twitterObj-&amp;gt;get_accountVerify_credentials();
 $twitterInfo-&amp;gt;response;

 $username = $twitterInfo-&amp;gt;screen_name;
 $profilepic = $twitterInfo-&amp;gt;profile_image_url;

 include &#39;update.php&#39;;

 }&lt;/pre&gt;After that we define the variables &lt;i&gt;twitterObj &lt;/i&gt;&amp;amp; &lt;i&gt;oauth_token&lt;/i&gt; to make it easier for us to connect and authenticate with Twitter. Then  we open our &lt;i&gt;if&lt;/i&gt; statement and check the &lt;i&gt;oauth_token&lt;/i&gt;  which  is our access tokes for the  account that will be authenticated   with  Twitter. We then redirect the user to Twitter’s authentication   page  using the &lt;i&gt;$url &lt;/i&gt;which is defined in one the library files. The &lt;i&gt;$url &lt;/i&gt;is made using the access token and the Twitter oAuth login link. One of the sample &lt;i&gt;$url&lt;/i&gt; is:&lt;br /&gt;
&lt;pre&gt;http://twitter.com/oauth/authorize?oauth_token=c1iKl42xnvOA76jIqzV4zXRVqFZcYJlYBQsXJC4Hbhw&lt;/pre&gt;You can clearly see how Twitter well Twitter uses the &lt;i&gt;oauth_tokens&lt;/i&gt;. After that we just open our session with Twitter and then get the profile information of the user from Twitter:&lt;br /&gt;
&lt;pre&gt;$twitterInfo= $twitterObj-&amp;gt;get_accountVerify_credentials();
 $twitterInfo-&amp;gt;response;

 $username = $twitterInfo-&amp;gt;screen_name;
 $profilepic = $twitterInfo-&amp;gt;profile_image_url;&lt;/pre&gt;Here we defined the &lt;i&gt;twitterInfo&lt;/i&gt; variable which is in short getting a user’s profile credentials from the &lt;i&gt;$twitterObj&lt;/i&gt; data and then we use the &lt;i&gt;screen_name&lt;/i&gt; &amp;amp; &lt;i&gt;profile_image_url&lt;/i&gt;  functions to get the profile name and profile image of the logged in   user. At the same time we are assigning variables to the profile name   and profile and profile image which we will use in the &lt;i&gt;update.php &lt;/i&gt;file.&lt;br /&gt;
After that we are also including the &lt;i&gt;update.php&lt;/i&gt; file using the snippet below:&lt;br /&gt;
&lt;pre&gt;include &#39;update.php&#39;;&lt;/pre&gt;Now copy the code below to your &lt;i&gt;update.php&lt;/i&gt; file:&lt;br /&gt;
&lt;pre&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Twitter oAuth Application by 1stwebdesigner | Update your status&amp;lt;/title&amp;gt;
&amp;lt;link rel=&quot;stylesheet&quot; href=&quot;style.css&quot; type=&quot;text/css&quot; media=&quot;screen, projection&quot; /&amp;gt;

&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Hello and Welcome to the oAuth Tutorial&amp;lt;/h1&amp;gt;
&amp;lt;?php $_SESSION[&#39;twitter_profile&#39;]; ?&amp;gt;
&amp;lt;div id=&quot;form&quot;&amp;gt;&amp;lt;!--Start form--&amp;gt;
&amp;lt;p&amp;gt;Twitter Handle: &amp;lt;?php echo $username ?&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;Profile Picture: &amp;lt;br /&amp;gt;&amp;lt;?php echo &quot;&amp;lt;img src=&#39;$profilepic&#39; /&amp;gt;&quot; ?&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;/p&amp;gt;
&amp;lt;label&amp;gt;Update Twitter Timeline&amp;lt;/label&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;form method=&#39;post&#39; action=&#39;index.php&#39;&amp;gt;

&amp;lt;br /&amp;gt;
&amp;lt;textarea&amp;nbsp; name=&quot;tweet&quot; cols=&quot;50&quot; rows=&quot;5&quot; id=&quot;tweet&quot; &amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;br /&amp;gt;
&amp;lt;input type=&#39;submit&#39; value=&#39;Tweet&#39; name=&#39;submit&#39; id=&#39;submit&#39; /&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;!--End Form--&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;This is just a simple HTML page consisting of small chunks of PHP   code for showing the user’s username, profile picture of the user as   uploaded on Twitter. The page also consists of a text box which the user   can use to update his/her status timeline on Twitter. You might have   noticed by now that I am using the &lt;i&gt;index.php&lt;/i&gt; file for form processing. The code that processes this form and posts to twitter is the one below (already in our &lt;i&gt;index.php&lt;/i&gt; file):&lt;br /&gt;
&lt;pre&gt;if(isset($_POST[&#39;submit&#39;]))
 {
 $msg = $_REQUEST[&#39;tweet&#39;];

 $twitterObj-&amp;gt;setToken($_SESSION[&#39;ot&#39;], $_SESSION[&#39;ots&#39;]);
 $update_status = $twitterObj-&amp;gt;post_statusesUpdate(array(&#39;status&#39;  =&amp;gt; $msg));
 $temp = $update_status-&amp;gt;response;

 echo &quot;&amp;lt;div align=&#39;center&#39;&amp;gt;Updated your Timeline Successfully  .&amp;lt;/div&amp;gt;&quot;;

 }&lt;/pre&gt;Here we are taking the data from the textbox named &lt;i&gt;tweet&lt;/i&gt; and   then posting it to twitter and then notifying the user that his/her   message was successfully and his/her timeline was updated.&lt;br /&gt;
Our &lt;i&gt;style.css&lt;/i&gt; file doesn’t have any special styles that we need to discuss here. They were just used to style the update form.&lt;br /&gt;
&lt;b&gt;NOTE:&lt;/b&gt; You may want to add the character count and  limit as Twitter doesn’t  accept any Tweets which consists of more than  140 characters {Even from  the API}. I have explained it in &lt;a href=&quot;http://www.1stwebdesigner.com/tutorials/how-to-update-twitter-using-php-and-twitter-api&quot; target=&quot;_blank&quot;&gt;my previous tutorial&lt;/a&gt; on 1stwebdesigner about &lt;a href=&quot;http://www.1stwebdesigner.com/tutorials/how-to-update-twitter-using-php-and-twitter-api&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;Updating Twitter using Twitter API and PHP&lt;/i&gt;&lt;/a&gt;.&lt;br /&gt;
You may now download the &lt;a href=&quot;http://tutorialswalk.info/demo/twitter-update-php-oauth/twitter-oauth.zip&quot; target=&quot;_blank&quot;&gt;completed application files here&lt;/a&gt; but don’t forget to edit the &lt;i&gt;secret.php &lt;/i&gt;file with your API keys as it won’t work without it. Feel free to build on the application we made today!&lt;br /&gt;
&lt;h3&gt;&lt;b&gt;TWITTER APPLICATIONS YOU USE USING oAUTH&lt;/b&gt;&lt;/h3&gt;We all know that Twitter provides an easy-to-use interface for its   users. The main advantage of using oAuth is that users can see what   applications have access to their profiles. If you want to check that   then you can do so by:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Login through Twitter (web-service).&lt;/li&gt;
&lt;li&gt;Go to &lt;i&gt;Settings&lt;/i&gt; after successful login.&lt;/li&gt;
&lt;li&gt;Then click on the &lt;i&gt;Connections &lt;/i&gt;tab.&lt;/li&gt;
&lt;li&gt;On that page, Twitter gives a list of all the apps that have access to your profile.&lt;/li&gt;
&lt;/ul&gt;You can check that easily by following the screenshot below:&lt;br /&gt;
&lt;a href=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/06/connections-access-oauth.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;393&quot; src=&quot;http://www.1stwebdesigner.com/wp-content/uploads/2010/06/connections-access-oauth.png&quot; width=&quot;569&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This is a screen-shot of my &lt;i&gt;Connections&lt;/i&gt; page which is showing me all the Twitter websites/applications I have given access to!&lt;br /&gt;
source : http://www.1stwebdesigner.com/tutorials/twitter-app-oauth-php/&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/1928582862004716031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/creating-simple-twitter-app-using-oauth.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/1928582862004716031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/1928582862004716031'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/creating-simple-twitter-app-using-oauth.html' title='Creating a Simple Twitter App using oAuth and PHP'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-8975329107764146108</id><published>2011-04-22T18:02:00.006+07:00</published><updated>2011-04-29T09:28:39.389+07:00</updated><title type='text'>Yahoo Oauth Login Connect</title><content type='html'>Nowadays every website authenticating a user using some of the  greatest  trusty third party websites like Google, yahoo or some of the  social  networks. Today we are learning how to authenticate a user using  his  Yahoo account. By using third party login we make user feel happy  by  avoiding filling a registration form. So just start with a simple   illustration.&lt;br /&gt;
&lt;b&gt;The Basic work flow&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;img alt=&quot;Yahoo connect using Social sdk&quot; src=&quot;http://lh5.ggpht.com/_EzIJxJICfGw/TTAVNFbwh0I/AAAAAAAAALE/5YbiKo5x8IQ/basic_flow.png&quot; /&gt;&lt;/div&gt;&lt;b&gt;Little Description&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;1&lt;/b&gt;. If user want to login with his yahoo account he is redirected to yahoo login page from our website for authentication.&lt;br /&gt;
&lt;b&gt;2&lt;/b&gt;. After successful login yahoo issues user data along with his GUID (Globally Unique Identifier) to our website.&lt;br /&gt;
&lt;b&gt;3&lt;/b&gt;. We are identifying a user using his GUID in our  database. In  third step we need to check our database for existence of  GUID if it is  present the user is old user and display his account. If  GUID is not  present insert a new record and allot new privileges for  him by creating  a new account.&lt;br /&gt;
&lt;b&gt;4&lt;/b&gt;. Display user account with his data.&lt;br /&gt;
In order to start working with Yahoo SDK you need to register a web application and get the Application ID, Consumer keys.&lt;br /&gt;
&lt;b&gt;1. Creating a new Application&lt;/b&gt;&lt;br /&gt;
a) &lt;a href=&quot;http://developer.yahoo.com/dashboard/createKey.html&quot; target=&quot;_blank&quot;&gt;Register a new application&lt;/a&gt;&lt;br /&gt;
b) Get the &lt;i&gt;Application ID&lt;/i&gt;, &lt;i&gt;Consumer Key&lt;/i&gt; and &lt;i&gt;Consumer Secret&lt;/i&gt;.&lt;br /&gt;
&lt;div&gt;&lt;img alt=&quot;Yahoo connect using Social sdk&quot; src=&quot;http://lh3.ggpht.com/_EzIJxJICfGw/TTQXtrjwK9I/AAAAAAAAALY/RZ-w3VBxKxI/reg_step_1.png&quot; /&gt;&lt;/div&gt;&lt;div&gt;&lt;img alt=&quot;Yahoo connect using Social sdk&quot; src=&quot;http://lh3.ggpht.com/_EzIJxJICfGw/TTQXtoAk3HI/AAAAAAAAALc/cILYcY80H0Y/reg_step_2.png&quot; /&gt;&lt;/div&gt;&lt;div&gt;&lt;img alt=&quot;Yahoo connect using Social sdk&quot; src=&quot;http://lh4.ggpht.com/_EzIJxJICfGw/TTQXtgCBV-I/AAAAAAAAALg/HE6gz6uBHJ0/reg_step_3.png&quot; /&gt;&lt;/div&gt;&lt;div&gt;&lt;img alt=&quot;Yahoo connect using Social sdk&quot; src=&quot;http://lh6.ggpht.com/_EzIJxJICfGw/TS_2E-cbPaI/AAAAAAAAAKw/xFCu2iZqHss/app_id_secret.png&quot; /&gt;&lt;/div&gt;After getting the Keys for your application next step is to Create a Table for the users.&lt;br /&gt;
&lt;b&gt;2. Designing the Database&lt;/b&gt;&lt;br /&gt;
Create a table for the users with the fields &lt;i&gt;uid&lt;/i&gt;, &lt;i&gt;oauth_vendor&lt;/i&gt;, &lt;i&gt;oauth_id&lt;/i&gt;, &lt;i&gt;name&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;CREATE TABLE &lt;b&gt;users&lt;/b&gt;(&lt;br /&gt;
uid INT(11) PRIMARY KEY AUTO_INCREMENT,&lt;br /&gt;
oauth_vendor VARCHAR(15),&lt;br /&gt;
oauth_id varchar(50),&lt;br /&gt;
name VARCHAR(30)&lt;br /&gt;
);&lt;/div&gt;&lt;b&gt;3. User authentication and Storing User GUID&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;yahoo_connect.php&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&amp;lt;?php&lt;/b&gt;&lt;br /&gt;
// Include the YOS library.&lt;br /&gt;
require ‘lib/Yahoo.inc’;&lt;br /&gt;
include ‘db_config.php’;&lt;br /&gt;
session_start();&lt;br /&gt;
define(‘OAUTH_CONSUMER_KEY’, ‘your_consumer_key’); // Place Yoru Consumer Key here&lt;br /&gt;
define(‘OAUTH_CONSUMER_SECRET’, ‘your_consumer_secret’); // Place your Consumer Secret&lt;br /&gt;
define(‘OAUTH_APP_ID’, ‘your_app_id’); // Place Your App ID here&lt;br /&gt;
// If user clicks on LOGIN button&lt;br /&gt;
if (array_key_exists(“login”, $_GET))&lt;br /&gt;
{&lt;br /&gt;
$session = YahooSession::requireSession(OAUTH_CONSUMER_KEY, OAUTH_CONSUMER_SECRET, OAUTH_APP_ID);&lt;br /&gt;
if (is_object($session))&lt;br /&gt;
{&lt;br /&gt;
$user = $session-&amp;gt;getSessionedUser();&lt;br /&gt;
$profile = $user-&amp;gt;getProfile();&lt;br /&gt;
$name = $profile-&amp;gt;nickname; // Getting user name&lt;br /&gt;
$guid = $profile-&amp;gt;guid; // Getting Yahoo ID&lt;br /&gt;
//Retriving the user&lt;br /&gt;
$query = mysql_query(“SELECT guid,name from yahoo_users where guid = ‘$guid’ and oauth_type = ‘yahoo’”) or die (mysql_error());&lt;br /&gt;
$result = mysql_fetch_array($query);&lt;br /&gt;
if (empty($result))&lt;br /&gt;
{&lt;br /&gt;
// user not present in Database. Store a new user and Create new account for him&lt;br /&gt;
$query = mysql_query(“INSERT INTO yahoo_users(oauth_type, guid, name) VALUES(‘yahoo’, ‘$guid’, ‘$name’)”);&lt;br /&gt;
$query = mysql_query(“SELECT guid,name from yahoo_users where guid = ‘$guid’ and oauth_type = ‘yahoo’”);&lt;br /&gt;
$result = mysql_fetch_array($query);&lt;br /&gt;
}&lt;br /&gt;
// Creating session variable for User&lt;br /&gt;
$_SESSION[&#39;login&#39;] = true;&lt;br /&gt;
$_SESSION[&#39;name&#39;] = $result[&#39;name&#39;];&lt;br /&gt;
$_SESSION[&#39;guid&#39;] = $result[&#39;guid&#39;];&lt;br /&gt;
$_SESSION[&#39;oauth_provider&#39;] = ‘yahoo’;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
// If user clicks on LOGOUT button&lt;br /&gt;
if (array_key_exists(“logout”, $_GET)) {&lt;br /&gt;
// User logging out and Clearing all Session data&lt;br /&gt;
YahooSession::clearSession();&lt;br /&gt;
unset ($_SESSION[&#39;login&#39;]);&lt;br /&gt;
unset($_SESSION[&#39;name&#39;]);&lt;br /&gt;
unset($_SESSION[&#39;guid&#39;]);&lt;br /&gt;
unset($_SESSION[&#39;oauth_provider&#39;]); // After logout Redirection here&lt;br /&gt;
header(“Location: index.php”);&lt;br /&gt;
}&lt;br /&gt;
&lt;b&gt;?&amp;gt;&lt;/b&gt;&lt;/div&gt;&lt;b&gt;Login Page&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;login.php&lt;/b&gt;&lt;br /&gt;
&lt;div&gt;&lt;b&gt;&amp;lt;?php&lt;/b&gt;&lt;br /&gt;
include ‘yahoo_connect.php’;&lt;br /&gt;
&lt;b&gt;?&amp;gt;&lt;/b&gt;&amp;nbsp; &amp;lt;!DOCTYPE html PUBLIC “-//W3C//DTD HTML 4.01//EN”&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;head&amp;gt;&lt;br /&gt;
&amp;lt;title&amp;gt;Yahoo Authentication&amp;lt;/title&amp;gt;&lt;br /&gt;
&amp;lt;/head&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&lt;b&gt;&amp;lt;?php&lt;/b&gt;&lt;br /&gt;
if ($_SESSION[&#39;login&#39;] == true)&lt;br /&gt;
{&lt;br /&gt;
echo ‘&amp;lt;br/&amp;gt;&amp;lt;a href=”?logout”&amp;gt;&amp;lt;img src=”images/logout_btn.png” alt=”Yahoo Logout”/&amp;gt;&amp;lt;/a&amp;gt;’;&lt;br /&gt;
}&lt;br /&gt;
else&lt;br /&gt;
{&lt;br /&gt;
echo ‘&amp;lt;a href=”?login”&amp;gt;&amp;lt;img src=”images/login_btn.png” alt=”Yahoo Login”/&amp;gt;&amp;lt;/a&amp;gt;’;&lt;br /&gt;
}&lt;br /&gt;
&lt;b&gt;?&amp;gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;
&lt;/b&gt;&lt;/div&gt;source : http://www.9lessons.info/2011/01/yahoo-oauth-login-connect.html&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/8975329107764146108/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/yahoo-oauth-login-connect.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/8975329107764146108'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/8975329107764146108'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/yahoo-oauth-login-connect.html' title='Yahoo Oauth Login Connect'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_EzIJxJICfGw/TTAVNFbwh0I/AAAAAAAAALE/5YbiKo5x8IQ/s72-c/basic_flow.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-3552532426457353923</id><published>2011-04-22T18:00:00.002+07:00</published><updated>2011-04-29T09:28:43.800+07:00</updated><title type='text'>ExtJs + FCKeditor Form Field Extention</title><content type='html'>Hi there all…&lt;br /&gt;
I’m new in ExtJS and i have to admit it, it’s a very VERY good job… &lt;br /&gt;
So i’ve started using it and i liked it. The thing is that i needed  something better than the default HTML editor so i turned to FCKeditor.  My problem was that i didn’t find it usefull to manually convert every  textarea I needed into FCK (as discussed in previous threads) because  the fields are dynamically created inside dynamically created tabs etc.  So i thought “how difficult would be to create an FCKeditor extension  for the ExtJS Form Fields…”. Well, it is… I think this is why no one has  done it yet…&lt;br /&gt;
Anyway, i have done something that, surprisingly enough, it works!!! I  am almost certain that it’s not the optimum way to do it. This is why  I’m asking for some help from anyone out there who could help to modify  it and make it better, more useful and perhaps even a real extension…&lt;br /&gt;
In the following code, I’m Using FCKeditor 2.5 Beta and Ext JS Library 2.0 Alpha 1.&lt;br /&gt;
I’ve developed it based on the TextArea.js.&lt;br /&gt;
File ext.FCKeditor.js:&lt;br /&gt;
Code:&lt;br /&gt;
Ext.form.FCKeditor = function(config){&lt;br /&gt;
Ext.form.FCKeditor.superclass.constructor.call(this, config);&lt;br /&gt;
this.FCKid=0;&lt;br /&gt;
this.MyisLoaded=false;&lt;br /&gt;
this.MyValue=”;&lt;br /&gt;
};&lt;br /&gt;
Ext.extend(Ext.form.FCKeditor, Ext.form.TextArea,  {&lt;br /&gt;
onRender : function(ct, position){&lt;br /&gt;
if(!this.el){&lt;br /&gt;
this.defaultAutoCreate = {&lt;br /&gt;
tag: “textarea”,&lt;br /&gt;
style:”width:100px;height:60px;”,&lt;br /&gt;
autocomplete: “off”&lt;br /&gt;
};&lt;br /&gt;
}&lt;br /&gt;
Ext.form.TextArea.superclass.onRender.call(this, ct, position);&lt;br /&gt;
if(this.grow){&lt;br /&gt;
this.textSizeEl = Ext.DomHelper.append(document.body, {&lt;br /&gt;
tag: “pre”, cls: “x-form-grow-sizer”&lt;br /&gt;
});&lt;br /&gt;
if(this.preventScrollbars){&lt;br /&gt;
this.el.setStyle(“overflow”, “hidden”);&lt;br /&gt;
}&lt;br /&gt;
this.el.setHeight(this.growMin);&lt;br /&gt;
}&lt;br /&gt;
if (this.FCKid==0) this.FCKid=get_FCKeditor_id_value()&lt;br /&gt;
setTimeout(“loadFCKeditor(‘”+this.name+”‘);”,100);&lt;br /&gt;
},&lt;br /&gt;
setValue : function(value){&lt;br /&gt;
this.MyValue=value;&lt;br /&gt;
if (this.FCKid==0) this.FCKid=get_FCKeditor_id_value()&lt;br /&gt;
FCKeditorSetValue(this.FCKid,this.name,value)&lt;br /&gt;
Ext.form.TextArea.superclass.setValue.apply(this,[value]);&lt;br /&gt;
},&lt;br /&gt;
getValue : function(){&lt;br /&gt;
if (this.MyisLoaded){&lt;br /&gt;
value=FCKeditorGetValue(this.name);&lt;br /&gt;
Ext.form.TextArea.superclass.setValue.apply(this,[value]);&lt;br /&gt;
return Ext.form.TextArea.superclass.getValue(this);&lt;br /&gt;
}else{&lt;br /&gt;
return this.MyValue;&lt;br /&gt;
}&lt;br /&gt;
},&lt;br /&gt;
getRawValue : function(){&lt;br /&gt;
if (this.MyisLoaded){&lt;br /&gt;
value=FCKeditorGetValue(this.name);&lt;br /&gt;
Ext.form.TextArea.superclass.setRawValue.apply(this,[value]);&lt;br /&gt;
return Ext.form.TextArea.superclass.getRawValue(this);&lt;br /&gt;
}else{&lt;br /&gt;
return this.MyValue;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
});&lt;br /&gt;
Ext.reg(‘fckeditor’, Ext.form.FCKeditor);&lt;br /&gt;
function loadFCKeditor(element){&lt;br /&gt;
oFCKeditor = new FCKeditor( element ) ;&lt;br /&gt;
oFCKeditor.ToolbarSet = sFCKeditorToolbar ;&lt;br /&gt;
oFCKeditor.Config[&#39;SkinPath&#39;] = sFCKeditorSkinPath ;&lt;br /&gt;
oFCKeditor.Config[&#39;PreloadImages&#39;] = sFCKeditorSkinPath + ‘images/toolbar.start.gif’ + ‘;’ +&lt;br /&gt;
sFCKeditorSkinPath + ‘images/toolbar.end.gif’ + ‘;’ +&lt;br /&gt;
sFCKeditorSkinPath + ‘images/toolbar.bg.gif’ + ‘;’ +&lt;br /&gt;
sFCKeditorSkinPath + ‘images/toolbar.buttonarrow.gif’ ;&lt;br /&gt;
oFCKeditor.BasePath = sFCKeditorBasePath ;&lt;br /&gt;
oFCKeditor.Config[&#39;BaseHref&#39;] = sFCKeditorBaseHref ;&lt;br /&gt;
oFCKeditor.Height = 260 ;&lt;br /&gt;
oFCKeditor.ReplaceTextarea() ;&lt;br /&gt;
}&lt;br /&gt;
function FCKeditor_OnComplete(editorInstance){&lt;br /&gt;
Ext.getCmp(editorInstance.Name).MyisLoaded=true;&lt;br /&gt;
editorInstance.Events.AttachEvent(‘OnStatusChange’, function(){&lt;br /&gt;
Ext.getCmp(editorInstance.Name).setValue();&lt;br /&gt;
})&lt;br /&gt;
}&lt;br /&gt;
var FCKeditor_value=new Array();&lt;br /&gt;
function FCKeditorSetValue(id,name,value){&lt;br /&gt;
if ((id!=undefined)&amp;amp;&amp;amp;(name!=undefined)){&lt;br /&gt;
if (value!=undefined) FCKeditor_value[id]=value;&lt;br /&gt;
else if (FCKeditor_value[id]==undefined) FCKeditor_value[id]=”;&lt;br /&gt;
var oEditor = FCKeditorAPI.GetInstance(name) ;&lt;br /&gt;
if(oEditor!=undefined) oEditor.SetData(FCKeditor_value[id])&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
function FCKeditorGetValue(name){&lt;br /&gt;
if ((id!=undefined)&amp;amp;&amp;amp;(name!=undefined)){&lt;br /&gt;
var oEditor = FCKeditorAPI.GetInstance(name) ;&lt;br /&gt;
data=”;&lt;br /&gt;
if(oEditor!=undefined) data=oEditor.GetData()&lt;br /&gt;
return data;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
var FCKeditor_id_value;&lt;br /&gt;
function get_FCKeditor_id_value(){&lt;br /&gt;
if (!FCKeditor_id_value){&lt;br /&gt;
FCKeditor_id_value=0;&lt;br /&gt;
}&lt;br /&gt;
FCKeditor_id_value=FCKeditor_id_value+1;&lt;br /&gt;
return FCKeditor_id_value;&lt;br /&gt;
}&lt;br /&gt;
You have to load this file when you include the ext library and you  also have to add this code (with the appropriate modifications to match  your settings) after the inclusion:&lt;br /&gt;
Code:&lt;br /&gt;
var sFCKeditorToolbar = ‘Default’;&lt;br /&gt;
var sFCKeditorBasePath = ‘../clientscripts/FCKeditor/’;&lt;br /&gt;
var sFCKeditorBaseHref = ‘http://localhost/test/’;&lt;br /&gt;
var sFCKeditorSkinPath = ‘../editor/skins/office2003/’;&lt;br /&gt;
That’s it! In order to use it simply add the following lines in the  items of a form. This will give you an FCKEditor in that form&lt;br /&gt;
Code:&lt;br /&gt;
{&lt;br /&gt;
xtype:’fckeditor’,&lt;br /&gt;
name:’content_1′,&lt;br /&gt;
id:’content_1′,&lt;br /&gt;
fieldLabel:’Content’,&lt;br /&gt;
height:270&lt;br /&gt;
}&lt;br /&gt;
I hope you got the main idea…&lt;br /&gt;
I look forward for any comments, suggestions, help, modifications, …., anything…&lt;br /&gt;
Let’s make it real…&lt;br /&gt;
StashX &lt;br /&gt;
_________________&lt;br /&gt;
source : http://www.sencha.com/forum/showthread.php?17423-2.0-A.1-FCKeditor-Form-Field-Extention&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/3552532426457353923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/extjs-fckeditor-form-field-extention.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/3552532426457353923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/3552532426457353923'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/extjs-fckeditor-form-field-extention.html' title='ExtJs + FCKeditor Form Field Extention'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-4857273519140265333</id><published>2011-04-22T17:58:00.002+07:00</published><updated>2011-04-29T09:28:51.080+07:00</updated><title type='text'>FCKEditor – ToolbarSets</title><content type='html'>This function determines what functions will be available to access  from the toolbar. It also points out their arrangement on the toolbar.  The syntax of the function&lt;br /&gt;
* Functions are divided into sections by placing them inside square brackets ” [ ] “.&lt;br /&gt;
[&#39;Source&#39;]&lt;br /&gt;
* You may separate functions inside the section by putting a ”  ‘-’ ” sign beside them. It will appear as an pipe (|) in the toolbar.&lt;br /&gt;
[&#39;Source&#39;,&#39;-&#39;,&#39;DocProps&#39;]&lt;br /&gt;
* If you want to start a new line with functions put ” ,’/&#39;, ” between the section.&lt;br /&gt;
[&#39;Source&#39;,&#39;-&#39;,&#39;DocProps&#39;], ‘/’, [&#39;Bold&#39;,&#39;Italic&#39;]&lt;br /&gt;
* Remember there is no comma after the last row. &lt;br /&gt;
Full Code:&lt;br /&gt;
FCKConfig.ToolbarSets[&quot;Default&quot;] = [&lt;br /&gt;
[&#39;Source&#39;,&#39;DocProps&#39;,&#39;-&#39;,&#39;Save&#39;,&#39;NewPage&#39;,&#39;Preview&#39;,&#39;-&#39;,&#39;Templates&#39;],&lt;br /&gt;
[&#39;Cut&#39;,&#39;Copy&#39;,&#39;Paste&#39;,&#39;PasteText&#39;,&#39;PasteWord&#39;,&#39;-&#39;,&#39;Print&#39;,&#39;SpellCheck&#39;],&lt;br /&gt;
[&#39;Undo&#39;,&#39;Redo&#39;,&#39;-&#39;,&#39;Find&#39;,&#39;Replace&#39;,&#39;-&#39;,&#39;SelectAll&#39;,&#39;RemoveFormat&#39;],&lt;br /&gt;
[&#39;Form&#39;,&#39;Checkbox&#39;,&#39;Radio&#39;,&#39;TextField&#39;,&#39;Textarea&#39;,&#39;Select&#39;,&#39;Button&#39;,&#39;ImageButton&#39;,&#39;HiddenField&#39;],&lt;br /&gt;
‘/’,&lt;br /&gt;
[&#39;Bold&#39;,&#39;Italic&#39;,&#39;Underline&#39;,&#39;StrikeThrough&#39;,&#39;-&#39;,&#39;Subscript&#39;,&#39;Superscript&#39;],&lt;br /&gt;
[&#39;OrderedList&#39;,&#39;UnorderedList&#39;,&#39;-&#39;,&#39;Outdent&#39;,&#39;Indent&#39;,&#39;Blockquote&#39;],&lt;br /&gt;
[&#39;JustifyLeft&#39;,&#39;JustifyCenter&#39;,&#39;JustifyRight&#39;,&#39;JustifyFull&#39;],&lt;br /&gt;
[&#39;Link&#39;,&#39;Unlink&#39;,&#39;Anchor&#39;],&lt;br /&gt;
[&#39;Image&#39;,&#39;Flash&#39;,&#39;Table&#39;,&#39;Rule&#39;,&#39;Smiley&#39;,&#39;SpecialChar&#39;,&#39;PageBreak&#39;],&lt;br /&gt;
‘/’,&lt;br /&gt;
[&#39;Style&#39;,&#39;FontFormat&#39;,&#39;FontName&#39;,&#39;FontSize&#39;],&lt;br /&gt;
[&#39;TextColor&#39;,&#39;BGColor&#39;],&lt;br /&gt;
[&#39;FitWindow&#39;,&#39;ShowBlocks&#39;,&#39;-&#39;,&#39;About&#39;] // No comma for the last row.&lt;br /&gt;
] ;&lt;br /&gt;
It’s quite easy to customize the toolbar buttons to your needs. Just  edit the configuration file and modify or add new items to the  “FCKConfig.ToolbarSets” configuration entry or create this entry in your  custom Configuration File.&lt;br /&gt;
Take a look at the fckconfig.js file to see these two sample toolbarsets definitions:&lt;br /&gt;
FCKConfig.ToolbarSets[&quot;Default&quot;] = [&lt;br /&gt;
[&#39;Source&#39;,&#39;DocProps&#39;,&#39;-&#39;,&#39;Save&#39;,&#39;NewPage&#39;,&#39;Preview&#39;,&#39;-&#39;,&#39;Templates&#39;],&lt;br /&gt;
[&#39;Cut&#39;,&#39;Copy&#39;,&#39;Paste&#39;,&#39;PasteText&#39;,&#39;PasteWord&#39;,&#39;-&#39;,&#39;Print&#39;,&#39;SpellCheck&#39;],&lt;br /&gt;
[&#39;Undo&#39;,&#39;Redo&#39;,&#39;-&#39;,&#39;Find&#39;,&#39;Replace&#39;,&#39;-&#39;,&#39;SelectAll&#39;,&#39;RemoveFormat&#39;],&lt;br /&gt;
[&#39;Form&#39;,&#39;Checkbox&#39;,&#39;Radio&#39;,&#39;TextField&#39;,&#39;Textarea&#39;,&#39;Select&#39;,&#39;Button&#39;,&#39;ImageButton&#39;,&#39;HiddenField&#39;],&lt;br /&gt;
‘/’,&lt;br /&gt;
[&#39;Bold&#39;,&#39;Italic&#39;,&#39;Underline&#39;,&#39;StrikeThrough&#39;,&#39;-&#39;,&#39;Subscript&#39;,&#39;Superscript&#39;],&lt;br /&gt;
[&#39;OrderedList&#39;,&#39;UnorderedList&#39;,&#39;-&#39;,&#39;Outdent&#39;,&#39;Indent&#39;,&#39;Blockquote&#39;],&lt;br /&gt;
[&#39;JustifyLeft&#39;,&#39;JustifyCenter&#39;,&#39;JustifyRight&#39;,&#39;JustifyFull&#39;],&lt;br /&gt;
[&#39;Link&#39;,&#39;Unlink&#39;,&#39;Anchor&#39;],&lt;br /&gt;
[&#39;Image&#39;,&#39;Flash&#39;,&#39;Table&#39;,&#39;Rule&#39;,&#39;Smiley&#39;,&#39;SpecialChar&#39;,&#39;PageBreak&#39;],&lt;br /&gt;
‘/’,&lt;br /&gt;
[&#39;Style&#39;,&#39;FontFormat&#39;,&#39;FontName&#39;,&#39;FontSize&#39;],&lt;br /&gt;
[&#39;TextColor&#39;,&#39;BGColor&#39;],&lt;br /&gt;
[&#39;FitWindow&#39;,&#39;ShowBlocks&#39;,&#39;-&#39;,&#39;About&#39;] // No comma for the last row.&lt;br /&gt;
] ;&lt;br /&gt;
FCKConfig.ToolbarSets[&quot;Basic&quot;] = [&lt;br /&gt;
[&#39;Bold&#39;,&#39;Italic&#39;,&#39;-&#39;,&#39;OrderedList&#39;,&#39;UnorderedList&#39;,&#39;-&#39;,&#39;Link&#39;,&#39;Unlink&#39;,&#39;-&#39;,&#39;About&#39;]&lt;br /&gt;
] ;&lt;br /&gt;
Toolbar Bands&lt;br /&gt;
Every ToolBarSet is composed of a series of “toolbar bands” that are  grouped in the final toolbar layout. The bands items move together on  new rows when resizing the editor.&lt;br /&gt;
As you can see in the above toolbarsets definitions, every toolbar  band is defined as a separated JavaScript array of strings. Every string  corresponds to an available toolbar item defined in the editor code or  in a plugin. If the toolbar item doesn’t exist, a message is displayed  when loading the editor.&lt;br /&gt;
You can also include a separator in the toolbar band by including the “-” string on it.&lt;br /&gt;
Forcing Row Break&lt;br /&gt;
Looking at the “Default” ToolBarSet you will note that in one of the  rows you have a “/” string instead of an array. This slash can be used  to tell the editor that you want to force the next bands to be rendered  in a new row and not following the previous one.&lt;br /&gt;
Custom ToolBarSets&lt;br /&gt;
The editor comes with the “Default” and “Basic” ToolBarSets already  defined in the fckconfig.js file. You can modify them, but you can also  create new customized ones. For example, to create a toolbarset named  “MyToolbar”, just include the following in the configuration file or in  your custom Configuration File:&lt;br /&gt;
FCKConfig.ToolbarSets[&quot;MyToolbar&quot;] = [&lt;br /&gt;
[&#39;Cut&#39;,&#39;Copy&#39;,&#39;Paste&#39;,&#39;PasteText&#39;,&#39;PasteWord&#39;],&lt;br /&gt;
[&#39;Undo&#39;,&#39;Redo&#39;,&#39;-&#39;,&#39;Bold&#39;,&#39;Italic&#39;,&#39;Underline&#39;,&#39;StrikeThrough&#39;],&lt;br /&gt;
‘/’,&lt;br /&gt;
[&#39;OrderedList&#39;,&#39;UnorderedList&#39;,&#39;-&#39;,&#39;Outdent&#39;,&#39;Indent&#39;],&lt;br /&gt;
[&#39;Link&#39;,&#39;Unlink&#39;,&#39;Anchor&#39;],&lt;br /&gt;
‘/’,&lt;br /&gt;
[&#39;Style&#39;],&lt;br /&gt;
[&#39;Table&#39;,&#39;Image&#39;,&#39;Flash&#39;,&#39;Rule&#39;,&#39;SpecialChar&#39;],&lt;br /&gt;
[&#39;About&#39;]&lt;br /&gt;
] ;&lt;br /&gt;
Now you just need to set your ToolBarSet when creating an editor  instance. Below you will find examples how to do it in different server  side languages:&lt;br /&gt;
JavaScript&lt;br /&gt;
var oFCKeditor = new FCKeditor( ‘FCKeditor1′ ) ;&lt;br /&gt;
oFCKeditor.ToolbarSet = ‘MyToolbar’ ;&lt;br /&gt;
oFCKeditor.Create() ;&lt;br /&gt;
PHP&lt;br /&gt;
$oFCKeditor-&amp;gt;ToolbarSet = ‘MyToolbar’;&lt;br /&gt;
JSP (Java)&lt;br /&gt;
ASP&lt;br /&gt;
oFCKeditor.ToolbarSet = “MyToolbar”&lt;br /&gt;
ASP.NET&lt;br /&gt;
ColdFusion&lt;br /&gt;
fckEditor.toolbarSet = “MyToolbar”;&lt;br /&gt;
Additional information&lt;br /&gt;
* It’s a common mistake when customizing the toolbar, to just  remove some elements from the Default toolbar set, including the “About”  item, leaving the last row terminating with a comma (“,”). So, remember  that the last toolbar band doesn’t have a comma after it.&lt;br /&gt;
* Remember to clean up your browser’s cache when making changes to  the configuration file, otherwise you may not see your changes and will  simply not understand why. &lt;br /&gt;
Toolbar Behavior&lt;br /&gt;
On start behavior&lt;br /&gt;
You can easily determine how the toolbar will appear when the editor  starts runing. The toolbar can appear expanded (in maximized mode) or  collapsed (in minimized mode). If you want change the appearance of the  toolbar you should look throughout ToolbarStartExpanded option or just  insert the following code into the configuration file remembering that  ‘true’ sets the toolbar to expanded mode and ‘false’ sets it to  collapsed mode:&lt;br /&gt;
FCKConfig.ToolbarStartExpanded = true ;&lt;br /&gt;
Toolbar Collapsing&lt;br /&gt;
You can choose whether the user can collapse (minimize) the toolbar,  during work with the editor, or not. Just see the ToolbarCanCollapse  option or apply this entry in the configuration file remembering that  ‘true’ gives the permission to collapse the toolbar and ‘false’ doesn’t:&lt;br /&gt;
FCKConfig.ToolbarCanCollapse = false;&lt;br /&gt;
source :&lt;br /&gt;
- http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Configuration_Options/ToolbarSets&lt;br /&gt;
- http://docs.cksource.com/FCKeditor_2.x/Developers_Guide/Configuration/Toolbar&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/4857273519140265333/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/fckeditor-toolbarsets.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/4857273519140265333'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/4857273519140265333'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/fckeditor-toolbarsets.html' title='FCKEditor – ToolbarSets'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-1517498344340853707</id><published>2011-04-22T17:56:00.003+07:00</published><updated>2011-04-29T09:31:08.799+07:00</updated><title type='text'>JSON(JavaScript Object Notation)</title><content type='html'>&lt;b&gt;JSON&lt;/b&gt; (JavaScript Object Notation) is a lightweight  data-interchange   format. It is easy for humans to read and write. It  is easy for machines to   parse and generate. It is based on a subset of  the   &lt;a href=&quot;http://javascript.crockford.com/&quot;&gt;JavaScript   Programming Language&lt;/a&gt;,   &lt;a href=&quot;http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf&quot;&gt;Standard   ECMA-262 3rd Edition – December 1999&lt;/a&gt;.  JSON is a text format that is completely   language independent but  uses conventions that are familiar to programmers of   the C-family of  languages, including C, C++, C#, Java, JavaScript, Perl, Python,   and  many others. These properties make JSON an ideal data-interchange  language.&lt;br /&gt;
JSON is built on two structures:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;A collection of name/value pairs. In various languages, this is realized     as an &lt;i&gt;object&lt;/i&gt;, record, struct, dictionary, hash table, keyed list, or     associative array.&lt;/li&gt;
&lt;li&gt;An ordered list of values. In most languages, this is realized as an &lt;i&gt;array&lt;/i&gt;,     vector, list, or sequence.&lt;/li&gt;
&lt;/ul&gt;These are universal data structures. Virtually all modern programming  languages support them in one form or another. It makes sense that a  data format that is interchangable with programming languages also be  based on these structures.&lt;br /&gt;
In JSON, they take on these forms:&lt;br /&gt;
An &lt;i&gt;object&lt;/i&gt; is an unordered set of name/value pairs. An object   begins with &lt;tt&gt;{&lt;/tt&gt; (left brace) and ends   with &lt;tt&gt;}&lt;/tt&gt; (right brace). Each name is followed   by &lt;tt&gt;:&lt;/tt&gt; (colon) and the name/value pairs are   separated by &lt;tt&gt;,&lt;/tt&gt; (comma).&lt;br /&gt;
&lt;img alt=&quot;&quot; height=&quot;113&quot; src=&quot;http://www.json.org/object.gif&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;
An &lt;i&gt;array&lt;/i&gt; is an ordered collection of values. An array begins   with &lt;tt&gt;[&lt;/tt&gt; (left bracket) and ends   with &lt;tt&gt;]&lt;/tt&gt; (right bracket). Values are separated   by &lt;tt&gt;,&lt;/tt&gt; (comma).&lt;br /&gt;
&lt;img alt=&quot;&quot; height=&quot;113&quot; src=&quot;http://www.json.org/array.gif&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;
A &lt;i&gt;value&lt;/i&gt; can be a &lt;i&gt;string&lt;/i&gt; in double quotes, or a &lt;i&gt;number&lt;/i&gt;,   or &lt;tt&gt;true&lt;/tt&gt; or &lt;tt&gt;false&lt;/tt&gt; or &lt;tt&gt;null&lt;/tt&gt;, or an &lt;i&gt;object&lt;/i&gt; or   an &lt;i&gt;array&lt;/i&gt;. These structures can be nested.&lt;br /&gt;
&lt;img alt=&quot;&quot; height=&quot;278&quot; src=&quot;http://www.json.org/value.gif&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;
A &lt;i&gt;string&lt;/i&gt; is a sequence of zero or more Unicode characters,  wrapped   in double quotes, using backslash escapes. A character is  represented as a   single character string. A string is very much like a  C or Java string.&lt;br /&gt;
&lt;img alt=&quot;&quot; height=&quot;413&quot; src=&quot;http://www.json.org/string.gif&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;
A &lt;i&gt;number&lt;/i&gt; is very much like a C or Java number, except that the octal   and hexadecimal formats are not used.&lt;br /&gt;
&lt;img alt=&quot;&quot; height=&quot;266&quot; src=&quot;http://www.json.org/number.gif&quot; width=&quot;598&quot; /&gt;&lt;br /&gt;
Whitespace can be inserted between any pair of tokens. Excepting   a  few encoding details, that completely describes the language.&lt;br /&gt;
&lt;h1&gt;JSON in JavaScript&lt;/h1&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.crockford.com/javascript&quot;&gt;JavaScript&lt;/a&gt; is a general    purpose programming language that was introduced as the page scripting    language for Netscape Navigator. &lt;a href=&quot;http://www.crockford.com/javascript/javascript.html&quot;&gt;It    is still widely believed to be a subset of Java, but it is not&lt;/a&gt;. It    is a &lt;a href=&quot;http://www.crockford.com/javascript/little.html&quot;&gt;Scheme&lt;/a&gt;-like    language with &lt;a href=&quot;http://www.crockford.com/javascript/survey.html&quot;&gt;C-like    syntax&lt;/a&gt; and &lt;a href=&quot;http://www.crockford.com/javascript/inheritance.html&quot;&gt;soft    objects&lt;/a&gt;. JavaScript was standardized in the &lt;a href=&quot;http://www.ecma-international.org/publications/files/ecma-st/ECMA-262.pdf&quot;&gt;ECMAScript    Language Specification, Third Edition&lt;/a&gt;.&lt;br /&gt;
&lt;a href=&quot;http://www.json.org/&quot;&gt;JSON&lt;/a&gt; is a subset of the object  literal notation   of JavaScript. Since JSON is a subset of JavaScript,  it can be used in the language   with no muss or fuss.&lt;br /&gt;
&lt;pre&gt;var myJSONObject = {&quot;bindings&quot;: [
        {&quot;ircEvent&quot;: &quot;PRIVMSG&quot;, &quot;method&quot;: &quot;newURI&quot;, &quot;regex&quot;: &quot;^http://.*&quot;},
        {&quot;ircEvent&quot;: &quot;PRIVMSG&quot;, &quot;method&quot;: &quot;deleteURI&quot;, &quot;regex&quot;: &quot;^delete.*&quot;},
        {&quot;ircEvent&quot;: &quot;PRIVMSG&quot;, &quot;method&quot;: &quot;randomURI&quot;, &quot;regex&quot;: &quot;^random.*&quot;}
    ]
};&lt;/pre&gt;In this example, an object is created containing a single member &lt;tt&gt;&quot;bindings&quot;&lt;/tt&gt;, which contains an array containing three objects, each containing &lt;tt&gt;&quot;ircEvent&quot;&lt;/tt&gt;, &lt;tt&gt;&quot;method&quot;&lt;/tt&gt;, and &lt;tt&gt;&quot;regex&quot;&lt;/tt&gt; members.&lt;br /&gt;
Members can be retrieved using dot or subscript operators.&lt;br /&gt;
&lt;pre&gt;myJSONObject.bindings[0].method    // &quot;newURI&quot;&lt;/pre&gt;To convert a JSON text into an object, you can use the &lt;tt&gt;eval()&lt;/tt&gt; function. &lt;tt&gt;eval()&lt;/tt&gt;  invokes the JavaScript compiler. Since JSON    is a proper subset of  JavaScript, the compiler will correctly parse the    text and produce an  object structure. The text must be wrapped in parens    to avoid  tripping on an ambiguity in JavaScript’s syntax.&lt;br /&gt;
&lt;pre&gt;var myObject = eval(&#39;(&#39; + myJSONtext + &#39;)&#39;);&lt;/pre&gt;The &lt;code&gt;eval&lt;/code&gt; function is very fast. However, it can compile     and execute any JavaScript program, so there can be security issues.  The    use of &lt;code&gt;eval&lt;/code&gt; is indicated when the source is trusted  and competent.    It is much safer to use a JSON parser. In web  applications over XMLHttpRequest,    communication is permitted only to  the same origin that provide that page,    so it is trusted. But it  might not be competent. If the server is not    rigorous in its JSON  encoding, or if it does not scrupulously validate    all of its inputs,  then it could deliver invalid JSON text that could    be carrying  dangerous script. The &lt;code&gt;eval&lt;/code&gt; function would execute    the script, unleashing its malice.&lt;br /&gt;
To defend against this, a JSON parser should be used. A JSON parser  will    recognize only JSON text, rejecting all scripts. In browsers  that provide    native JSON support, JSON parsers are also much faster  than &lt;code&gt;eval&lt;/code&gt;.    It is expected that native JSON support will be included in the next ECMAScript    standard.&lt;br /&gt;
&lt;pre&gt;var myObject = JSON.parse(myJSONtext, reviver);&lt;/pre&gt;The optional &lt;code&gt;reviver&lt;/code&gt; parameter is a function that will  be    called for every key and value at every level of the final result.  Each    value will be replaced by the result of the &lt;code&gt;reviver&lt;/code&gt; function.    This can be used to reform generic objects into instances of pseudoclasses,    or to transform date strings into &lt;code&gt;Date&lt;/code&gt; objects.&lt;br /&gt;
&lt;pre&gt;myData = JSON.parse(text, function (key, value) {
    var type;
    if (value &amp;amp;&amp;amp; typeof value === &#39;object&#39;) {
        type = value.type;
        if (typeof type === &#39;string&#39; &amp;amp;&amp;amp; typeof window[type] === &#39;function&#39;) {
            return new (window[type])(value);
        }
    }
    return value;
});&lt;/pre&gt;A JSON stringifier goes in the opposite direction, converting  JavaScript   data structures into JSON text. JSON does not support  cyclic data structures,   so be careful to not give cyclical structures  to the JSON stringifier.&lt;br /&gt;
&lt;pre&gt;var myJSONText = JSON.stringify(myObject, replacer);&lt;/pre&gt;If the &lt;code&gt;stringify&lt;/code&gt; method sees an object that contains a &lt;code&gt;toJSON&lt;/code&gt;  method, it calls that method, and stringifies the value returned. This     allows an object to determine its own JSON representation.&lt;br /&gt;
The &lt;code&gt;stringifier&lt;/code&gt; method can take an optional array of  strings.   These strings are used to select the properties that will be  included   in the JSON text.&lt;br /&gt;
The &lt;code&gt;stringifier&lt;/code&gt; method can take an optional replacer function.    It will be called after the &lt;code&gt;toJSON&lt;/code&gt; method (if there is one)    on each of the values in the structure. It will be passed each key and    value as parameters, and &lt;code&gt;this&lt;/code&gt; will be bound to object holding    the key. The value returned will be stringified.&lt;br /&gt;
Values that do not have a representation in JSON (such as functions and    &lt;code&gt;undefined&lt;/code&gt;) are excluded.&lt;br /&gt;
Nonfinite numbers are replaced with &lt;code&gt;null&lt;/code&gt;. To substitute    other values, you could use a replacer function like this:&lt;br /&gt;
&lt;pre&gt;function replacer(key, value) {
    if (typeof value === &#39;number&#39; &amp;amp;&amp;amp; !isFinite(value)) {
        return String(value);
    }
    return value;
}&lt;/pre&gt;Giving a corresponding reviver to &lt;code&gt;JSON.parse&lt;/code&gt; can undo that.&lt;br /&gt;
source : http://www.json.org/&lt;br /&gt;
&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/1517498344340853707/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/jsonjavascript-object-notation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/1517498344340853707'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/1517498344340853707'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/jsonjavascript-object-notation.html' title='JSON(JavaScript Object Notation)'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-5589935382436606735</id><published>2011-04-22T17:55:00.002+07:00</published><updated>2011-04-29T09:29:01.237+07:00</updated><title type='text'>Extjs – Fully hide header of column of gridpanel</title><content type='html'>&lt;code&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;span style=&quot;color: #007700;&quot;&gt;var grid = new &lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;Ext&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;GridPanel&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;({&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;: &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#39;adminUsersGrid&#39;&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;,&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;border&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;false&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;,&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;title&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#39;lobby&#39;&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;,&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;listeners&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;:&amp;nbsp;{&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;render&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;:&amp;nbsp;function(&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;)&amp;nbsp;{&lt;br /&gt;
&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;grid&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;getView&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;el&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;select&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#39;.x-grid3-header&#39;&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;color: #0000bb;&quot;&gt;setStyle&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#39;display&#39;&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;, &lt;/span&gt;&lt;span style=&quot;color: #dd0000;&quot;&gt;&#39;none&#39;&lt;/span&gt;&lt;span style=&quot;color: #007700;&quot;&gt;);&lt;br /&gt;
}&lt;br /&gt;
};&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/5589935382436606735/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/extjs-fully-hide-header-of-column-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/5589935382436606735'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/5589935382436606735'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/extjs-fully-hide-header-of-column-of.html' title='Extjs – Fully hide header of column of gridpanel'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-6525401773910795816</id><published>2011-04-22T17:53:00.006+07:00</published><updated>2011-04-29T09:29:05.525+07:00</updated><title type='text'>Dynamic Grid Panel for Ext JS</title><content type='html'>I am using &lt;a href=&quot;http://extjs.com/&quot;&gt;Ext JS&lt;/a&gt; in my web application projects and I decided that it is time to give back to the community.&lt;br /&gt;
If you are developing a &lt;a href=&quot;http://en.wikipedia.org/wiki/Create,_read,_update_and_delete&quot;&gt;CRUD&lt;/a&gt;  application and using grids to display data from your database you   should define similar column models, fields, readers, stores etc. for   your grids. It is not a big concern if it is not the first time you do   the same things or you have your own components not to repeat yourself.   But what if your database table needs a change in its structure? Let me   guess… You change field and column model definitions in your grids and   doing the same again and again even there are small changes.&lt;br /&gt;
Here is a small Ext JS component that I wrote:&lt;br /&gt;
&lt;blockquote&gt;Ext.ux.DynamicGridPanel = Ext.extend(Ext.grid.GridPanel, {&lt;br /&gt;
initComponent: function(){&lt;br /&gt;
/**&lt;br /&gt;
* Default configuration options.&lt;br /&gt;
*&lt;br /&gt;
* You are free to change the values or add/remove options.&lt;br /&gt;
* The important point is to define a data store with JsonReader&lt;br /&gt;
* without configuration and columns with empty array. We are going&lt;br /&gt;
* to setup our reader with the metaData information returned by the server.&lt;br /&gt;
* See http://extjs.com/deploy/dev/docs/?class=Ext.data.JsonReader for more&lt;br /&gt;
* information how to configure your JsonReader with metaData.&lt;br /&gt;
*&lt;br /&gt;
* A data store with remoteSort = true displays strange behaviours such as&lt;br /&gt;
* not to display arrows when you sort the data and inconsistent ASC, DESC option.&lt;br /&gt;
* Any suggestions are welcome&lt;br /&gt;
*/&lt;br /&gt;
var config = {&lt;br /&gt;
viewConfig: {forceFit: true},&lt;br /&gt;
enableColLock: false,&lt;br /&gt;
loadMask: true,&lt;br /&gt;
border: false,&lt;br /&gt;
stripeRows: true,&lt;br /&gt;
ds: new Ext.data.Store({&lt;br /&gt;
url: this.storeUrl,&lt;br /&gt;
reader: new Ext.data.JsonReader()&lt;br /&gt;
}),&lt;br /&gt;
columns: []&lt;br /&gt;
};&lt;br /&gt;
Ext.apply(this, config);&lt;br /&gt;
Ext.apply(this.initialConfig, config);&lt;br /&gt;
Ext.ux.DynamicGridPanel.superclass.initComponent.apply(this, arguments);&lt;br /&gt;
},&lt;br /&gt;
onRender: function(ct, position){&lt;br /&gt;
this.colModel.defaultSortable = true;&lt;br /&gt;
Ext.ux.DynamicGridPanel.superclass.onRender.call(this, ct, position);&lt;br /&gt;
/**&lt;br /&gt;
* Grid is not masked for the first data load.&lt;br /&gt;
* We are masking it while store is loading data&lt;br /&gt;
*/&lt;br /&gt;
this.el.mask(‘Loading…’);&lt;br /&gt;
this.store.on(‘load’, function(){&lt;br /&gt;
/**&lt;br /&gt;
* Thats the magic! &amp;lt;img src=”http://erhanabay.com/wp-includes/images/smilies/icon_smile.gif” alt=”:)”&amp;gt;&lt;br /&gt;
*&lt;br /&gt;
* JSON data returned from server has the column definitions&lt;br /&gt;
*/&lt;br /&gt;
if(typeof(this.store.reader.jsonData.columns) === ‘object’) {&lt;br /&gt;
var columns = [];&lt;br /&gt;
/**&lt;br /&gt;
* Adding RowNumberer or setting selection model as CheckboxSelectionModel&lt;br /&gt;
* We need to add them before other columns to display first&lt;br /&gt;
*/&lt;br /&gt;
if(this.rowNumberer) { columns.push(new Ext.grid.RowNumberer()); }&lt;br /&gt;
if(this.checkboxSelModel) { columns.push(new Ext.grid.CheckboxSelectionModel()); }&lt;br /&gt;
Ext.each(this.store.reader.jsonData.columns, function(column){&lt;br /&gt;
columns.push(column);&lt;br /&gt;
});&lt;br /&gt;
/**&lt;br /&gt;
* Setting column model configuration&lt;br /&gt;
*/&lt;br /&gt;
this.getColumnModel().setConfig(columns);&lt;br /&gt;
}&lt;br /&gt;
/**&lt;br /&gt;
* Unmasking grid&lt;br /&gt;
*/&lt;br /&gt;
this.el.unmask();&lt;br /&gt;
}, this);&lt;br /&gt;
/**&lt;br /&gt;
* And finally load the data from server!&lt;br /&gt;
*/&lt;br /&gt;
this.store.load();&lt;br /&gt;
}&lt;br /&gt;
});&lt;/blockquote&gt;How to use it?&lt;br /&gt;
&lt;blockquote&gt;new Ext.ux.DynamicGridPanel({&lt;br /&gt;
id: ‘my-grid’,&lt;br /&gt;
storeUrl: ‘server/url/address/’,&lt;br /&gt;
rowNumberer: true,&lt;br /&gt;
checkboxSelModel: true,&lt;br /&gt;
sm: new Ext.grid.CheckboxSelectionModel(),&lt;br /&gt;
});&lt;/blockquote&gt;And here is the JSON which should be returned from server to dynamically create column and field definitions:&lt;br /&gt;
&lt;blockquote&gt;{&lt;br /&gt;
“metaData”: {&lt;br /&gt;
“totalProperty”: “total”,&lt;br /&gt;
“root”: “records”,&lt;br /&gt;
“id”: “id”,&lt;br /&gt;
“fields”: [&lt;br /&gt;
{&lt;br /&gt;
&quot;name&quot;: &quot;id&quot;,&lt;br /&gt;
&quot;type&quot;: &quot;int&quot;&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&quot;name&quot;: &quot;name&quot;,&lt;br /&gt;
&quot;type&quot;: &quot;string&quot;&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
},&lt;br /&gt;
“success”: true,&lt;br /&gt;
“total”: 50,&lt;br /&gt;
“records”: [&lt;br /&gt;
{&lt;br /&gt;
&quot;id&quot;: &quot;1&quot;,&lt;br /&gt;
&quot;name&quot;: &quot;AAA&quot;&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&quot;id&quot;: &quot;2&quot;,&lt;br /&gt;
&quot;name&quot;: &quot;BBB&quot;&lt;br /&gt;
}&lt;br /&gt;
],&lt;br /&gt;
“columns”: [&lt;br /&gt;
{&lt;br /&gt;
&quot;header&quot;: &quot;#&quot;,&lt;br /&gt;
&quot;dataIndex&quot;: &quot;id&quot;&lt;br /&gt;
},&lt;br /&gt;
{&lt;br /&gt;
&quot;header&quot;: &quot;User&quot;,&lt;br /&gt;
&quot;dataIndex&quot;: &quot;name&quot;&lt;br /&gt;
}&lt;br /&gt;
]&lt;br /&gt;
}&lt;/blockquote&gt;The code itself is somewhat self-explanatory but for newbie users  learning center is a good start to understand how to extend Ext JS or  simply understand how the framework works.&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/6525401773910795816/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/dynamic-grid-panel-for-ext-js.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6525401773910795816'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6525401773910795816'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/dynamic-grid-panel-for-ext-js.html' title='Dynamic Grid Panel for Ext JS'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-6966453087597609806</id><published>2011-04-22T17:50:00.002+07:00</published><updated>2011-04-29T09:29:12.376+07:00</updated><title type='text'>Create a window browser inside the browser with extjs</title><content type='html'>by : &lt;a href=&quot;http://stackoverflow.com/users/219328/fernando-martinez&quot;&gt;Fernando Martínez&lt;/a&gt;&lt;br /&gt;
&lt;blockquote&gt;Ext.IframeWindow = Ext.extend(Ext.Window, {&lt;br /&gt;
onRender: function() {&lt;br /&gt;
this.bodyCfg = {&lt;br /&gt;
tag: ‘iframe’,&lt;br /&gt;
src: this.src,&lt;br /&gt;
cls: this.bodyCls,&lt;br /&gt;
style: {&lt;br /&gt;
border: ’0px none’&lt;br /&gt;
}&lt;br /&gt;
};&lt;br /&gt;
Ext.IframeWindow.superclass.onRender.apply(this, arguments);&lt;br /&gt;
}&lt;br /&gt;
});&lt;br /&gt;
var w = new Ext.IframeWindow({&lt;br /&gt;
id:id,&lt;br /&gt;
width:640,&lt;br /&gt;
height:480,&lt;br /&gt;
maximizable:true,&lt;br /&gt;
title:”Knowledge Control Solutions Iframe Window Sample”,&lt;br /&gt;
src:”http://www.google.co.id”&lt;br /&gt;
})&lt;br /&gt;
w.show();&lt;/blockquote&gt;source : http://stackoverflow.com/questions/1783919/create-a-window-browser-inside-the-browser-with-extjs&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/6966453087597609806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/create-window-browser-inside-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6966453087597609806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/6966453087597609806'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/create-window-browser-inside-browser.html' title='Create a window browser inside the browser with extjs'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-3261425043597465814</id><published>2011-04-22T17:49:00.001+07:00</published><updated>2011-04-29T09:29:14.620+07:00</updated><title type='text'>Generating PDF files using CodeIgniter</title><content type='html'>EllisLab is blessed with two of the greatest communities that can be   found anywhere on the internet in ExpressionEngine and more recently   CodeIgniter.&amp;nbsp; Despite being a relative newcomer to the scene, the people   attracted to CodeIgniter are among the smartest, most talented and   down-to-earth developers around today.&amp;nbsp; From time to time we want to   highlight some of these talented people, and we’ve asked them to lend   their voice to ours.&amp;nbsp;  &lt;i&gt;&lt;a href=&quot;http://codeigniter.com/forums/viewannounce/81650_49/&quot;&gt;Have your voice&lt;/a&gt;&lt;/i&gt;.&amp;nbsp; I hope you enjoy what they have to say as much as I did.&lt;br /&gt;
This week, our Community Voice author is Chris Monnat, known on the forums as &lt;a href=&quot;http://codeigniter.com/forums/member/34172/&quot;&gt;mrtopher&lt;/a&gt;,   who writes a helpful step by step guide to generating PDF files from   CodeIgniter.&amp;nbsp; Chris is a full time web application developer and part   time entrepreneur. In addition to building web sites for the medical   industry during the day, at night Chris also runs his own development   company &lt;a href=&quot;http://www.leftofcentercom.com/&quot;&gt;Left of Center Communications&lt;/a&gt;. He recently started a personal blog at &lt;a href=&quot;http://www.chrismonnat.com/&quot;&gt;http://www.chrismonnat.com&lt;/a&gt; where he keeps a record of his exploits and discusses, among other things, CodeIgniter.&lt;br /&gt;
&lt;hr /&gt;PDF files rock! Some of the programs used to view them could use some   work, but the file format itself is real handy. As a programmer I have   found PDF’s to be most helpful when generating reports that need to be   printable. I know we are all supposed to be doing our part to make our   offices “greener” and use less resources like paper. But some things   just need to be printed (especially when your talking about the   financial and legal industries).&lt;br /&gt;
When generating reports in PDF format you suddenly have a lot more   control over layout and design than  you do with plain old HTML and CSS   (although much progress is being made with print style sheets). You can   create some really nice reports on the fly that your users can view,   save for later or e-mail to their co-workers for review. In this post I   will show you how I generate PDF reports using &lt;a href=&quot;http://codeigniter.com/&quot;&gt;CodeIgniter&lt;/a&gt;.&lt;br /&gt;
&lt;h4&gt;Quick Note&lt;/h4&gt;There are a number of PHP libraries out there for generating PDF files (like &lt;a href=&quot;http://www.fpdf.org/&quot;&gt;FPDF&lt;/a&gt;, &lt;a href=&quot;http://www.stillhq.com/opensource.html&quot;&gt;Panda&lt;/a&gt; and &lt;a href=&quot;http://www.digitaljunkies.ca/dompdf/&quot;&gt;dompdf&lt;/a&gt;) but the best one I have come across is the &lt;a href=&quot;http://www.ros.co.nz/pdf/&quot;&gt;R&amp;amp;OS pdf class&lt;/a&gt;. I was first introduced to it from the &lt;a href=&quot;http://www.sitepoint.com/books/phpant1/?SID=beb1c45753ae71830305e53194bf4faf&quot;&gt;PHP Anthology&lt;/a&gt;  first edition by Harry Fuecks. I have tried other PDF libraries (some   PHP 5 specific and some not) and none of them have been able to provide   me with the same control or ease of use that the R&amp;amp;OS class has   which is why I’m using it for this tutorial.&lt;br /&gt;
&lt;h4&gt;Getting Started&lt;/h4&gt;Before we start, lets get everyone to the same place so you can   follow along as we go. I’ve prepared a .zip file containing everything   you’ll need to follow along. The archive includes CI 1.6.3 along with   all the code and libraries we will discuss in this tutorial. Simply &lt;a href=&quot;http://codeigniter.com/files/ci_blog/pdf_tutorial.zip&quot;&gt;download the archive&lt;/a&gt;, unzip it on your web server and follow along.&lt;br /&gt;
I have done all the work of downloading the code library and putting   the files in their right place for you, but I wanted to mention where   things were for the detail oriented among you. There are 2 files that   are necessary in order to use the R&amp;amp;OS library: &lt;b&gt;class.ezpdf.php&lt;/b&gt; and &lt;b&gt;class.pdf.php&lt;/b&gt;.   Those two files have been placed in the application/library folder.   R&amp;amp;OS also requires some font files in order to function and they   have been placed at the root of the .zip file in a folder called &lt;b&gt;fonts&lt;/b&gt;.&lt;br /&gt;
You do have to make a minor modification to the &lt;b&gt;class.ezpdf.php&lt;/b&gt; file so that it will work properly within CI. First I renamed the file to &lt;b&gt;cezpdf.php&lt;/b&gt;, which makes it easier to load using the CI loader. Then you have to modify the include statement on line 3 to:&lt;br /&gt;
&lt;blockquote&gt;&lt;div&gt;&lt;code&gt; include_once(APPPATH&amp;nbsp;.&amp;nbsp;&#39;libraries/class.pdf.php&#39;); &lt;/code&gt;&lt;/div&gt;&lt;/blockquote&gt;This will keep PHP from saying that it can’t find included file. Once   those modifications are made the R&amp;amp;OS class is ready to use with   CI.&lt;br /&gt;
In the archive, I have also made a controller called&lt;b&gt; tutorial.php&lt;/b&gt; and a helper called &lt;b&gt;pdf_helper&lt;/b&gt;.&lt;b&gt;php&lt;/b&gt;  both in their respective directories. With the background info. out of   the way, lets get our hands dirty with a real simple example.&lt;br /&gt;
&lt;h4&gt;Hello World&lt;/h4&gt;&lt;div&gt;&lt;blockquote&gt;&lt;code&gt; function&amp;nbsp;hello_world()&lt;br /&gt;
{&lt;br /&gt;
$this-&amp;gt;load-&amp;gt;library(&#39;cezpdf&#39;);&lt;/code&gt;&lt;br /&gt;
$this-&amp;gt;cezpdf-&amp;gt;ezText(‘Hello&amp;nbsp;World’,&amp;nbsp;12,&amp;nbsp;array(‘justification’&amp;nbsp;=&amp;gt;&amp;nbsp;’center’));&lt;br /&gt;
$this-&amp;gt;cezpdf-&amp;gt;ezSetDy(-10);&lt;br /&gt;
$content&amp;nbsp;=&amp;nbsp;’The&amp;nbsp;quick,&amp;nbsp;brown&amp;nbsp;fox&amp;nbsp;jumps&amp;nbsp;over&amp;nbsp;a&amp;nbsp;lazy&amp;nbsp;dog.&amp;nbsp;DJs&amp;nbsp;flock&amp;nbsp;by&amp;nbsp;when&amp;nbsp;MTV&amp;nbsp;ax&amp;nbsp;quiz&amp;nbsp;prog.&lt;br /&gt;
Junk&amp;nbsp;MTV&amp;nbsp;quiz&amp;nbsp;graced&amp;nbsp;by&amp;nbsp;fox&amp;nbsp;whelps.&amp;nbsp;Bawds&amp;nbsp;jog,&amp;nbsp;flick&amp;nbsp;quartz,&amp;nbsp;vex&amp;nbsp;nymphs.’;&lt;br /&gt;
$this-&amp;gt;cezpdf-&amp;gt;ezText($content,&amp;nbsp;10);&lt;br /&gt;
$this-&amp;gt;cezpdf-&amp;gt;ezStream();&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;The above code produces a PDF file &lt;a href=&quot;http://codeigniter.com/files/ci_blog/hello_world.pdf&quot;&gt;like this&lt;/a&gt;.&lt;br /&gt;
In the above, first thing we do is load the R&amp;amp;OS library for use. Next we use the &lt;b&gt;ezText()&lt;/b&gt;  function to create a title for our document. This function takes the   text it will display as the first argument, the size of that text and an   optional array of additional configuration options. In this instance  we  pass along a justification option of center. That will center our  title  at the top of our document.&lt;br /&gt;
After the title we insert some extra white space using the &lt;b&gt;ezSetDy()&lt;/b&gt;  function. After the whites pace we put the rest of the content for the   document in a variable called $content and add it to our document using   the &lt;b&gt;ezText()&lt;/b&gt; function again. Finally, we create our document using the &lt;b&gt;ezStream()&lt;/b&gt;  function which actually creates the document and sends it to the users   which prompts them to view/download the generated PDF document.&lt;br /&gt;
&lt;h4&gt;Handling Tabular Data&lt;/h4&gt;When your dealing with business reports the odds are good that you   will need to generate reports with tables to display tabular data. From   my experience with other PDF libraries, this is not an easy task. But   with the R&amp;amp;OS library it’s about as hard as creating an array.&lt;br /&gt;
&lt;div&gt;&lt;blockquote&gt;&lt;code&gt; function&amp;nbsp;tables()&lt;br /&gt;
{&lt;br /&gt;
$this-&amp;gt;load-&amp;gt;library(&#39;cezpdf&#39;);&lt;/code&gt;&lt;br /&gt;
$db_data[]&amp;nbsp;=&amp;nbsp;array(‘name’&amp;nbsp;=&amp;gt;&amp;nbsp;’Jon&amp;nbsp;Doe’,&amp;nbsp;’phone’&amp;nbsp;=&amp;gt;&amp;nbsp;’111-222-3333′,&amp;nbsp;’email’&amp;nbsp;=&amp;gt;&amp;nbsp;’jdoe@someplace.com’);&lt;br /&gt;
$db_data[]&amp;nbsp;=&amp;nbsp;array(‘name’&amp;nbsp;=&amp;gt;&amp;nbsp;’Jane&amp;nbsp;Doe’,&amp;nbsp;’phone’&amp;nbsp;=&amp;gt;&amp;nbsp;’222-333-4444′,&amp;nbsp;’email’&amp;nbsp;=&amp;gt;&amp;nbsp;’jane.doe@something.com’);&lt;br /&gt;
$db_data[]&amp;nbsp;=&amp;nbsp;array(‘name’&amp;nbsp;=&amp;gt;&amp;nbsp;’Jon&amp;nbsp;Smith’,&amp;nbsp;’phone’&amp;nbsp;=&amp;gt;&amp;nbsp;’333-444-5555′,&amp;nbsp;’email’&amp;nbsp;=&amp;gt;&amp;nbsp;’jsmith@someplacepsecial.com’);&lt;br /&gt;
$col_names&amp;nbsp;=&amp;nbsp;array(&lt;br /&gt;
‘name’&amp;nbsp;=&amp;gt;&amp;nbsp;’Name’,&lt;br /&gt;
‘phone’&amp;nbsp;=&amp;gt;&amp;nbsp;’Phone&amp;nbsp;Number’,&lt;br /&gt;
‘email’&amp;nbsp;=&amp;gt;&amp;nbsp;’E-mail&amp;nbsp;Address’&lt;br /&gt;
);&lt;br /&gt;
$this-&amp;gt;cezpdf-&amp;gt;ezTable($table_data,&amp;nbsp;$col_names,&amp;nbsp;’Contact&amp;nbsp;List’,&amp;nbsp;array(‘width’=&amp;gt;550));&lt;br /&gt;
$this-&amp;gt;cezpdf-&amp;gt;ezStream();&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;The above code should produce a PDF file &lt;a href=&quot;http://codeigniter.com/files/ci_blog/tables.pdf&quot;&gt;like this&lt;/a&gt;.&lt;br /&gt;
In the above code I create an array of data called $db_data. I put   this together so that it imitates a typical database result set because   that’s usually where you will be getting your data from. Below my data   array I have created a $col_names array that associates the data   elements in the $db_data array with a column title for the table. This   is where the R&amp;amp;OS gets the title to display at the top of each table   column. Once I have the data and column titles I create the table by   calling the &lt;b&gt;ezTable()&lt;/b&gt; function. This function takes the   data array, an associative array for column names, the title for the   table and an optional array of configuration options. There are a number   of options that can be configured through that last optional array,  but  I’m not going to go into them in this tutorial.&lt;br /&gt;
&lt;h4&gt;Headers and Footers&lt;/h4&gt;Most reports in a corporate setting come with some kind of standard   header and/or footer. They can include anything from the date/time   generated, the user who generated them, to page numbers and the like.   Headers and footers are handy to have, but unfortunately there isn’t a   real good way to add them to printable reports generated in HTML and   CSS. There’s one more reason to use the portable document format when   creating printable reports.&lt;br /&gt;
The process of adding headers and footers to a PDF using the R&amp;amp;OS   library is the slightest bit complicated. There are a lot of lines of   code just to accomplish it, that’s why I have created a helper file.   Since the code is in a helper function, you just need load the helper   and call the function whenever you need to add headers/footers to a PDF.&lt;br /&gt;
&lt;div&gt;&lt;blockquote&gt;&lt;code&gt; function&amp;nbsp;prep_pdf($orientation&amp;nbsp;=&amp;nbsp;&#39;portrait&#39;)&lt;br /&gt;
{&lt;br /&gt;
$CI&amp;nbsp;=&amp;nbsp;&amp;amp;amp;&amp;nbsp;get_instance();&lt;/code&gt;&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;selectFont(base_url()&amp;nbsp;.&amp;nbsp;’/fonts’);&lt;br /&gt;
$all&amp;nbsp;=&amp;nbsp;$CI-&amp;gt;cezpdf-&amp;gt;openObject();&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;saveState();&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;setStrokeColor(0,0,0,1);&lt;br /&gt;
if($orientation&amp;nbsp;==&amp;nbsp;’portrait’)&amp;nbsp;{&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;ezSetMargins(50,70,50,50);&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;ezStartPageNumbers(500,28,8,”,’{PAGENUM}’,1);&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;line(20,40,578,40);&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;addText(50,32,8,’Printed&amp;nbsp;on&amp;nbsp;’&amp;nbsp;.&amp;nbsp;date(‘m/d/Y&amp;nbsp;h:i:s&amp;nbsp;a’));&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;addText(50,22,8,’CI&amp;nbsp;PDF&amp;nbsp;Tutorial&amp;nbsp;-&amp;nbsp;http://www.christophermonnat.com’);&lt;br /&gt;
}&lt;br /&gt;
else&amp;nbsp;{&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;ezStartPageNumbers(750,28,8,”,’{PAGENUM}’,1);&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;line(20,40,800,40);&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;addText(50,32,8,’Printed&amp;nbsp;on&amp;nbsp;’.date(‘m/d/Y&amp;nbsp;h:i:s&amp;nbsp;a’));&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;addText(50,22,8,’CI&amp;nbsp;PDF&amp;nbsp;Tutorial&amp;nbsp;-&amp;nbsp;http://www.christophermonnat.com’);&lt;br /&gt;
}&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;restoreState();&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;closeObject();&lt;br /&gt;
$CI-&amp;gt;cezpdf-&amp;gt;addObject($all,’all’);&lt;br /&gt;
}&lt;/blockquote&gt;&lt;/div&gt;An example of how I use this helper is provided in the headers()   function of the tutorial.php controller. That code produces a PDF file &lt;a href=&quot;http://codeigniter.com/files/ci_blog/headers.pdf&quot;&gt;like this&lt;/a&gt;.&lt;br /&gt;
The above code is the &lt;b&gt;prep_pdf()&lt;/b&gt; function located in the &lt;b&gt;pdf_helper.php&lt;/b&gt;  file. This function does all the hard work of creating a footer for my   PDF reports for me. All I have to do is load the helper in my  controller  and call the function. Since the reports could be portrait  or landscape  I have also included the ability to pass the orientation  to the  function and the code will modify the document margins  accordingly.&lt;br /&gt;
I’m not going to go into a lot of detail about the above code because   this tutorial could become very long. But the general idea is that I’m   using the R&amp;amp;OS library to modify the margins of the document I’m   creating, add page numbers and text to the very bottom of the document.   R&amp;amp;OS has some functions that makes this easy like &lt;b&gt;ezStartPageNumbers()&lt;/b&gt; and &lt;b&gt;line()&lt;/b&gt;. Once all that is done I can add any kind of content to the document back in my controller and then just call &lt;b&gt;ezStream()&lt;/b&gt; to generate the final document.&lt;br /&gt;
&lt;h4&gt;Wrap Up&lt;/h4&gt;I barely scratched the surface of what you can do with the R&amp;amp;OS   PDF library in this tutorial. I encourage you to spend some quality time   with the &lt;b&gt;readme.pdf&lt;/b&gt; documentation file that comes  with  the library when you download it. That file goes over all the  functions  and their options in great detail.&lt;br /&gt;
So there you have it, generating PDF files with CodeIgniter and the   R&amp;amp;OS library. If this method doesn’t quite do it for you, there are a   few helpful articles on the CodeIgniter &lt;a href=&quot;http://codeigniter.com/wiki/&quot;&gt;wiki&lt;/a&gt;, like &lt;a href=&quot;http://codeigniter.com/wiki/PDF_generation_using_dom/&quot;&gt;this one&lt;/a&gt; and &lt;a href=&quot;http://codeigniter.com/wiki/fpdf_CIed/&quot;&gt;this one&lt;/a&gt;,   which walk you through some additional options. Whatever solution you   choose I hope this tutorial has helped to introduce you to some of the   options you have at your disposal for creating PDF reports with   CodeIgniter.&lt;br /&gt;
source:&lt;a href=&quot;http://codeigniter.com/news/codeigniter_community_voice_generating_pdf_files_using_codeigniter/&quot; target=&quot;_blank&quot;&gt;http://codeigniter.com/news/codeigniter_community_voice_generating_pdf_files_using_codeigniter/&lt;/a&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/3261425043597465814/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/generating-pdf-files-using-codeigniter.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/3261425043597465814'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/3261425043597465814'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/generating-pdf-files-using-codeigniter.html' title='Generating PDF files using CodeIgniter'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-40180647823802017</id><published>2011-04-22T17:42:00.002+07:00</published><updated>2011-04-29T09:29:19.882+07:00</updated><title type='text'>ExtJS : Export DataGrid to Excel</title><content type='html'>I found an article in&lt;br /&gt;
&lt;a href=&quot;http://loianegroner.com/2010/02/extjs-how-to-export-datagrid-to-excel/&quot; target=&quot;_blank&quot;&gt;http://loianegroner.com/2010/02/extjs-how-to-export-datagrid-to-excel/&lt;/a&gt;&lt;br /&gt;
but in the sencha forum, have this too&lt;br /&gt;
&lt;a href=&quot;http://www.sencha.com/forum/showthread.php?32400-GridPanel-directly-to-Excel.&quot; target=&quot;_blank&quot;&gt;http://www.sencha.com/forum/showthread.php?32400-GridPanel-directly-to-Excel.&lt;/a&gt;&lt;br /&gt;
any way, this the article:&lt;br /&gt;
_____________________________________________________________________&lt;br /&gt;
&lt;a href=&quot;http://loianegroner.com/wp-content/uploads/2010/01/extjs_export_gridpanel_excel.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;340&quot; src=&quot;http://loianegroner.com/wp-content/uploads/2010/01/extjs_export_gridpanel_excel.png&quot; title=&quot;extjs_export_gridpanel_excel&quot; width=&quot;599&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
This tutorial will walk through how to export data from ExtJS DataGrid directly to Excel.&lt;br /&gt;
Sometimes the user wants to export the data from the datagrid to an excel file. There is an ExtJS &lt;a href=&quot;http://www.extjs.com/forum/showthread.php?t=32400&quot; target=&quot;_blank&quot;&gt;third party plugin&lt;/a&gt; that does it for you.&lt;br /&gt;
There are some “issues” you have to be aware of before you start:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;It needs a browser that supports &lt;a href=&quot;http://en.wikipedia.org/wiki/Data_URI_scheme&quot; target=&quot;_blank&quot;&gt;data URLs&lt;/a&gt;, such as Firefox, Opera and IE&lt;b&gt;8&lt;/b&gt;.&lt;/li&gt;
&lt;li&gt;I tested it with the following ExtJS versions: 2.2.1, 3.0, 3.0.3 and   3.1, but it only worked with ExtJS 3.0. If anyone is using other ExtJS   version and the plugin worked, please, let me know.&lt;/li&gt;
&lt;li&gt;It only works on the data in the Store – if you are using   server-side paging, then perform this processing on the server. For   quick and dirty conversion of a small table to Excel, this might be   useful.&lt;/li&gt;
&lt;li&gt;If the data in the Store is volatile (It gets reloaded or edited), the data URL will have to be recalculated.&lt;/li&gt;
&lt;/ul&gt;Let’s get started:&lt;br /&gt;
First, create a file in your projet and paste this content in it (I called it exporter.js): &lt;a href=&quot;http://github.com/loiane/extjs-export-excel/blob/master/WebContent/js/exporter.js&quot; target=&quot;_blank&quot;&gt;http://github.com/loiane/extjs-export-excel/blob/master/WebContent/js/exporter.js&lt;/a&gt; (this file has too many lines, that’s why I’m not going to past its content here).&lt;br /&gt;
Then, in your datagrid, add this code:&lt;br /&gt;
&lt;div&gt;&lt;div id=&quot;highlighter_303812&quot;&gt;&lt;div&gt;&lt;a href=&quot;http://loianegroner.com/2010/02/extjs-how-to-export-datagrid-to-excel/#&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt; &lt;td&gt;&lt;br /&gt;
&lt;/td&gt; &lt;td&gt;&lt;div&gt;&lt;div&gt;&lt;code&gt;var&lt;/code&gt; &lt;code&gt;linkButton = &lt;/code&gt;&lt;code&gt;new&lt;/code&gt; &lt;code&gt;Ext.LinkButton({&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt; &lt;/code&gt;&lt;code&gt;id: &lt;/code&gt;&lt;code&gt;&#39;grid-excel-button&#39;&lt;/code&gt;&lt;code&gt;,&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt; &lt;/code&gt;&lt;code&gt;text: &lt;/code&gt;&lt;code&gt;&#39;Export to Excel&#39;&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;});&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;//create the Grid&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;var&lt;/code&gt; &lt;code&gt;grid = &lt;/code&gt;&lt;code&gt;new&lt;/code&gt; &lt;code&gt;Ext.grid.GridPanel({&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt; &lt;/code&gt;&lt;code&gt;bbar: &lt;/code&gt;&lt;code&gt;new&lt;/code&gt; &lt;code&gt;Ext.Toolbar({&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt; &lt;/code&gt;&lt;code&gt;buttons: [linkButton]&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt; &lt;/code&gt;&lt;code&gt;})&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;});&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;linkButton.getEl().child(&lt;/code&gt;&lt;code&gt;&#39;a&#39;&lt;/code&gt;&lt;code&gt;, &lt;/code&gt;&lt;code&gt;true&lt;/code&gt;&lt;code&gt;).href = &lt;/code&gt;&lt;code&gt;&#39;data:application/vnd.ms-excel;base64,&#39;&lt;/code&gt; &lt;code&gt;+&lt;/code&gt;&lt;/div&gt;&lt;div&gt;&lt;code&gt;Base64.encode(grid.getExcelXml());&lt;/code&gt;&lt;/div&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt;
&lt;/tbody&gt; &lt;/table&gt;&lt;/div&gt;&lt;/div&gt;And if you try to export the data, it will look like this:&lt;br /&gt;
&lt;a href=&quot;http://loianegroner.com/wp-content/uploads/2010/01/extjs_export_gridpanel_excel_file.png&quot;&gt;&lt;img alt=&quot;&quot; height=&quot;359&quot; src=&quot;http://loianegroner.com/wp-content/uploads/2010/01/extjs_export_gridpanel_excel_file.png&quot; title=&quot;extjs_export_gridpanel_excel_file&quot; width=&quot;627&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Feel free to change the color, fonts. Take a look in the code and try to understand it to make the changes you want.&lt;br /&gt;
&lt;a href=&quot;http://edspencer.net/&quot; target=&quot;_blank&quot; title=&quot;Ed Spencer&quot;&gt;Ed Spencer&lt;/a&gt; also developed a &lt;a href=&quot;http://github.com/edspencer/Ext.ux.Exporter&quot; target=&quot;_blank&quot; title=&quot;similar plugin&quot;&gt;similar plugin&lt;/a&gt;. The source code is cleaner than this one. The output is the same, though.&lt;br /&gt;
You can download my sample app from my GitHub repository (JEE project): &lt;a href=&quot;http://github.com/loiane/extjs-export-excel&quot; target=&quot;_blank&quot;&gt;http://github.com/loiane/extjs-export-excel&lt;/a&gt;&lt;br /&gt;
Happy coding!&lt;br /&gt;
source : &lt;a href=&quot;http://loianegroner.com/2010/02/extjs-how-to-export-datagrid-to-excel/&quot; target=&quot;_blank&quot;&gt;http://loianegroner.com/2010/02/extjs-how-to-export-datagrid-to-excel/&lt;/a&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/40180647823802017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/extjs-export-datagrid-to-excel.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/40180647823802017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/40180647823802017'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/extjs-export-datagrid-to-excel.html' title='ExtJS : Export DataGrid to Excel'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8257443989554875454.post-4015071962695687354</id><published>2011-04-22T14:37:00.001+07:00</published><updated>2011-04-29T09:29:24.198+07:00</updated><title type='text'>Javascript HTML tag remover</title><content type='html'>A little regular expression to remove all HTML tags from a string.&lt;br /&gt;
&lt;br /&gt;
Input code&lt;br /&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code id=&quot;input-code&quot;&gt;&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;
&amp;lt;p&amp;gt;Here you will find posts about news,&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code id=&quot;input-code&quot;&gt;trends and developing for internet, 
mainly focusing on browsers and&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code id=&quot;input-code&quot;&gt;web user interfaces.&amp;lt;/p&amp;gt;
&amp;lt;p&amp;gt;&amp;lt;a href=&quot;/about&quot;&amp;gt;Read more&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;Output text&lt;br /&gt;
&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;About
Here you will find posts about news,&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;trends and developing for internet,
mainly focusing on browsers and &lt;/code&gt;
&lt;code&gt;web user interfaces.
Read more&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;br /&gt;
The script&lt;br /&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;function removeHTMLTags(){
if(document.getElementById &amp;amp;&amp;amp; _&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;   document.getElementById(&quot;input-code&quot;)){
  var strInputCode = document.getElementById(&quot;input-code&quot;).innerHTML;
  strInputCode = strInputCode.replace(/&amp;amp;(lt|gt);/g,&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;     function (strMatch, p1){
      return (p1 == &quot;lt&quot;)? &quot;&amp;lt;&quot; : &quot;&amp;gt;&quot;;
  });
  var strTagStrippedText = strInputCode.replace(/&amp;lt;\/?[^&amp;gt;]+(&amp;gt;|$)/g, &quot;&quot;);
    alert(&quot;Input code:\n&quot; + strInputCode + &quot;\n\nOutput text:\n&quot; + _&amp;nbsp;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;    strTagStrippedText); 
  } 
}&lt;/code&gt;&lt;/pre&gt;&lt;script src=&quot;http://scr.kliksaya.com/js-ad.php?zid=67158&quot; type=&quot;text/javascript&quot;&gt;
&lt;/script&gt;</content><link rel='replies' type='application/atom+xml' href='http://webdevelopmentcode.blogspot.com/feeds/4015071962695687354/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/javascript-html-tag-remover.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/4015071962695687354'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8257443989554875454/posts/default/4015071962695687354'/><link rel='alternate' type='text/html' href='http://webdevelopmentcode.blogspot.com/2011/04/javascript-html-tag-remover.html' title='Javascript HTML tag remover'/><author><name>Parwanto</name><uri>http://www.blogger.com/profile/00497619017490543195</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='24' height='32' src='http://i93.photobucket.com/albums/l62/kong_jhalie/p101015.jpg'/></author><thr:total>0</thr:total></entry></feed>