<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2enclosuresfull.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-3595613705597819503</atom:id><lastBuildDate>Wed, 14 Oct 2009 04:20:35 +0000</lastBuildDate><title>ThinkTank</title><description>PHP | PHP SYMFONY | PHP SMARTY | PHP MYSQL| PHP EXAMPLES | JSF | NOKIA | SONY ERICSSION | LINUX | THINKTANK | IPHONE | JPA | WINDOWS | FIREFOX 4 | HTML 5 | AJAX | MICROSOFT</description><link>http://technothinktank.blogspot.com/</link><managingEditor>sky.dodiya@gmail.com (SKY)</managingEditor><generator>Blogger</generator><openSearch:totalResults>24</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/blogspot/wGPX" /><media:copyright>@Copyright</media:copyright><media:thumbnail url="http://www.mp4converter.net/images/upload/iphone_home.gif" /><media:keywords>iPhone,Sony,Ericssion,Nokia</media:keywords><media:category scheme="http://www.itunes.com/dtds/podcast-1.0.dtd">Technology/Gadgets</media:category><itunes:owner><itunes:email>sky.dodiya@gmail.com</itunes:email></itunes:owner><itunes:explicit>no</itunes:explicit><itunes:image href="http://www.mp4converter.net/images/upload/iphone_home.gif" /><itunes:keywords>iPhone,Sony,Ericssion,Nokia</itunes:keywords><itunes:subtitle>Technology in Deep</itunes:subtitle><itunes:summary>Whats new in Cell phone market??</itunes:summary><itunes:category text="Technology"><itunes:category text="Gadgets" /></itunes:category><feedburner:emailServiceId>blogspot/wGPX</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-8680743487332145282</guid><pubDate>Thu, 06 Nov 2008 03:18:00 +0000</pubDate><atom:updated>2008-11-05T19:19:58.325-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Google blogs</category><title>Google Code Blog: Introducing Powerful Visualizations for your server-side data</title><description>&lt;a href="http://google-code-updates.blogspot.com/2008/11/introducing-powerful-visualizations-for.html"&gt;Google Code Blog: Introducing Powerful Visualizations for your server-side data&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Today, we're publicly documenting the Google Visualization API's open-wire protocol, thus dramatically expanding the capabilities of this API beyond what had been available since we first launched in March of this year. Organizations can now expose their server-side data, such as in SQL databases and even in Excel spreadsheets, and display this data through visualizations from our growing directory. This flexibility makes it possible to connect easily almost any data source to a wealth of 40+ visualizations, including standard pie and line charts and complex heat maps and motion charts.&lt;br /&gt;&lt;br /&gt;To make it even easier for developers to get started, we have documented an open-source Python library that enables any Python developer to quickly start using the API. What we find particularly cool about this library is that it also runs on Google's AppEngine. You don't even need to be an owner of your own servers to expose your data: You can place it on AppEngine and use the Visualization API to expose your data in meaningful, insightful ways in dashboards and reports. Expect to see additional server-side tools for the Visualization API in the near future.&lt;br /&gt;&lt;br /&gt;Moreover, this week at the Dreamforce conference, Salesforce announced they've created tools, including code snippets and API harnesses, to make the Google Visualization API even easier to use. Salesforce customers can now quickly and easily add dashboards and custom reporting applications over their Salesforce data and publish these on any webpage. ISVs and BI firms such as Panorama and Conceptual Clarity, who are already marketing their powerful reporting tools over Google Spreadsheets using the Visualization API, now have access to Salesforce customers. The icing on the cake: since they use the Visualization API, they can address this new market without adding new code to their existing applications.&lt;br /&gt;&lt;br /&gt;To learn more about how to implement your data store as a Visualization API data source, by checking out our documentation.&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-8680743487332145282?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RKhgPoqCnaJBLNhgdgN1HngJnw4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RKhgPoqCnaJBLNhgdgN1HngJnw4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RKhgPoqCnaJBLNhgdgN1HngJnw4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RKhgPoqCnaJBLNhgdgN1HngJnw4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=LuDEClzV"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=QWzwlcMf"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=3uQsB2Ls"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=3uQsB2Ls" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Ybmue4lC"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Gotm579G"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=Gotm579G" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=MGCO70wO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=XrerUtzm"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=XrerUtzm" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Rvc1Q4Ps"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=E9hbeGuz"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=E9hbeGuz" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=xW8MuQfs"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/99z8frzufxc" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/99z8frzufxc/google-code-blog-introducing-powerful.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">1</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/11/google-code-blog-introducing-powerful.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-1211226626915629992</guid><pubDate>Thu, 06 Nov 2008 01:49:00 +0000</pubDate><atom:updated>2008-11-05T19:19:58.327-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Google blogs</category><title>Official Gmail Blog: Tip: Your email, wherever you are on the web, with Toolbar</title><description>&lt;a href="http://gmailblog.blogspot.com/2008/11/tip-your-email-wherever-you-are-on-web.html"&gt;Official Gmail Blog: Tip: Your email, wherever you are on the web, with Toolbar&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-1211226626915629992?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LfxX9L7UwnygavixsksJiRP3Li0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LfxX9L7UwnygavixsksJiRP3Li0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LfxX9L7UwnygavixsksJiRP3Li0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LfxX9L7UwnygavixsksJiRP3Li0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=d7cybLlk"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=CWBs0H33"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=r6vV7ZxN"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=r6vV7ZxN" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=9XvDXmBr"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Z11sFITo"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=Z11sFITo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=UunjMN0S"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=d2XwHSdb"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=d2XwHSdb" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=mX0uWbdq"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=NMrKSw7U"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=NMrKSw7U" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=IfJT0a7N"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/IHcSTFfiH6w" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/IHcSTFfiH6w/official-gmail-blog-tip-your-email.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/11/official-gmail-blog-tip-your-email.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-5006581916402960552</guid><pubDate>Wed, 05 Nov 2008 14:29:00 +0000</pubDate><atom:updated>2009-04-08T02:48:59.003-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PageRank on Google</category><title>Boost Traffic</title><description>&lt;div xmlns=""&gt;&lt;h1 class="western"&gt;HOW TO: Boost Your Blog Traffic&lt;/h1&gt;Nov 03, 2005 in How To's, Internet&lt;br /&gt;
&lt;a href="" id="more-101" name="more-101"&gt;Many first time bloggers automatically assume that once their blog is setup and they put a few posts on it, they will get some hits and regular readers. This is quite untrue. You won’t get any traffic if no one knows about your website. In this article I hope to tackle these problems and discuss some of the common ways bloggers and webmasters drive more traffic to their site by understanding the user. I have received many emails from aspiring bloggers asking me what they can do to get more traffic, so hopefully this will help out at least those people. Don’t forget to checkout the prequel,How To: Start Blogging, that covers the technical side of setting up a blog.&lt;/a&gt;&lt;br /&gt;
&lt;h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Blog Usability&lt;/a&gt;&lt;/h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Before I get into getting your name out there, your blog has to have some style. Most web users are instantly turned off by tacky site designs or extreme neon colors. I know I won’t stay at a website too long if the layout or navigation annoys me. The goal is to have a unique blog, different than all the other weblogs on the net. The one thing I really stress to others is making it easy for your readers to contact you. It shouldn’t take a reader more than a click, if any, to find your email address or a contact form. This makes the reader feel like someone actually runs and cares about the website. An about page is also a great asset to have on a personal site or blog. The more a reader knows about you, the more they trust your content. I highly recommend reading this weblog usability article by usability guru Jakob Nielsen.&lt;/a&gt;&lt;br /&gt;
&lt;h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Content&lt;/a&gt;&lt;/h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Your blog’s usability goes hand in hand with its content. You can specialize in a niche subject as long as you have an idea of how many people might be interested in that subject. If you do well with your niche subject matter, you could get some crazy traffic for being the only decent blog online with that type of content. On the other hand you could have widely used content, such as some aspect of technology, but add your own twist with your opinion or comparing/contrasting from other tech analysts. People won’t go to your site to read something they could have read on CNet or Tom’s Hardware, they want a unique take on it. If you learn anything from this article, I hope its that reblogging is a very bad thing. The one thing to kill your traffic is having identical content to another several hundred blogs. I suggest taking a glance at Mr. Veloso’s Evils of Constant Reblogging to get a better idea. Finding out what your content should be is a key element of your blog’s identity and the type of image your blog will ultimately emit.&lt;/a&gt;&lt;br /&gt;
&lt;h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Technorati is Your Best Friend&lt;/a&gt;&lt;/h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Technorati is one of the best traffic providers for bloggers. It makes your blog much easier to find when people search by technorati tags. Technorati is also a large blog ranking engine. Based on the number of links to your blog from various websites, your blog is given a rank. The higher your rank the easier your blog is to find when people search for things. A higher rank gives your blog greater credibility in technorati. If you don’t already have a technorati account, get one. After you have setup the main settings, such as your profile, you need to claim your blog. Go to Account and then down the page to Your Blogs. Enter the URL of your blog in the URL field and then hit “Claim this weblog.” Once you’ve done that go to “Configure this Blog” and fill in what you can. Click the checkbox to select “Include this blog in Technorati’s Blog Finder” and fill out as many tags or keywords that accurately represent the content in your blog. When you’ve done that, click “ Save Changes” and then grab your claim code. There are two types of codes that you may put somewhere in your blog for technorati to verify that your blog exists and keep track of it. If you have a blog that is Blogger powered or some other blog host that does not give you direct control of your blog files you will want to use the “Link Code” and post it somewhere on your blog. If you are using a more versatile blog publishing system, such as a custom WordPress orMovable Type installation you should copy the “ Embed Code.” You can edit your sidebar, header, or footer file and put it wherever you like. You also have the option of posting a Technorati search box or various links on your blog without altering the code you just pasted. Select the options you like and click “Save Changes.” Everything is done by automatically by Technorati. One last thing you might consider is adding the Technorati ping link to your weblog. Doing this will let Technorati know when you have updated your blog. Find out how to do that on Technorati’s Ping Configuration page.&lt;/a&gt;&lt;br /&gt;
&lt;h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Final Thoughts&lt;/a&gt;&lt;/h4&gt;&lt;a href="" id="more-101" name="more-101"&gt;Hopefully my suggestions have helped out at least a few people. If you post guides or reviews on your blog that you think many people can benefit or learn from, I suggest posting a link on del.icio.us or Digg. If your page gets on the frontpage of Digg or on del.icio.us popular, you’re set. Many tech websites have an email address for tips. If you think your content is worthy, I would try sending them an email with your article. You never know, they might post it. Even if they do not have a tips line, a polite email to the editor-in-chief or webmaster could do the trick. As a blogger, you really should not have any trouble talking to strangers… you practically preach to them everyday. While looking for companies to send me review products for my other website, I must have sent out over 150 emails. It is amazing what a nice email can get you. I gained a contact with at Akasa, who was kind enough to trust me and send some computer products for review after a few emails. Even at the lowest level you will establish some rapport between that company or person, which may help you out in the future.&lt;/a&gt;&lt;br /&gt;
&lt;a href="" id="more-101" name="more-101"&gt;Also, holding a contest can greatly boost traffic. Even if it is for a small thing such as aWordPress golden ticket, you will be amazed at how many people find out about it. You can establish a relationship with some of your readers, and they might link to your blog on theirs. Commenting on other blogs can also earn you a few hits if you put down your URL. Oh and how could I forget a de-lurking post to talk to those hidden readers of yours.&lt;/a&gt;&lt;br /&gt;
&lt;div style="margin-bottom: 0cm;"&gt;&lt;a href="" id="more-101" name="more-101"&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div style="margin-bottom: 0cm;"&gt;&lt;a href="" id="more-101" name="more-101"&gt;Post your blog here : &lt;a href="http://www.skyforums.org"&gt;Skyforums&lt;/a&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;a href="" id="more-101" name="more-101"&gt; &lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.page-rank10.com/"&gt;Get Page Rank 10&lt;/a&gt; - SEO Experiment&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-5006581916402960552?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XFjtpC72FHARAODGkLrrV_aJREM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XFjtpC72FHARAODGkLrrV_aJREM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XFjtpC72FHARAODGkLrrV_aJREM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XFjtpC72FHARAODGkLrrV_aJREM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=NZYlKPtP"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=GZtfiF7c"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Vdid7BEt"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=Vdid7BEt" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=jUcvfrDG"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=dJOADO6h"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=dJOADO6h" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=QtZKuZGw"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=gMG8NxaE"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=gMG8NxaE" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=WkJGtVAO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=owW4Ps5Y"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=owW4Ps5Y" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=8ScFrfLl"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/W1ct2ns6YWQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/W1ct2ns6YWQ/boost-traffic.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/11/boost-traffic.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-8575634803401327187</guid><pubDate>Tue, 12 Aug 2008 03:52:00 +0000</pubDate><atom:updated>2008-09-08T07:14:59.842-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Ajax</category><title>SlideShow Viewer</title><description>Stylish gallery script with a 'lightbox' effect. Intuitive interface, it provides basic slideshow functionalities.&lt;br /&gt;The current image in the viewer has a nice flow effect applied.&lt;br /&gt;&lt;br /&gt;The viewer is free to use in personal or commercial web pages, provided that the script is not sold or exchanged for profit.&lt;br /&gt;An unbranded version of the slideshow, suitable also for resale, may be purchased for a one-time per-site license fee.&lt;br /&gt;Too bad is not free.&lt;br /&gt;&lt;br /&gt;Play with this script by changing the html bellow. Submit your changes by clicking on this bar. Refresh the page to reset changes.&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;base href="http://www.ajaxdaddy.com/web20/slideshow-viewer/"&amp;gt;&lt;br /&gt;&amp;lt;style type="text/css"&amp;gt;&lt;br /&gt;body {color: white;background: #52616F;}&lt;br /&gt;a { color: white; }&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/style&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;script type="text/javascript" src="javascript/slide.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type="text/javascript"&amp;gt;&lt;br /&gt;&amp;lt;!--&lt;br /&gt;var viewer = new PhotoViewer();&lt;br /&gt;viewer.add('images/img1.jpg');&lt;br /&gt;viewer.add('images/img2.jpg');&lt;br /&gt;viewer.add('images/img3.jpg');&lt;br /&gt;//--&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;center&amp;gt;&lt;br /&gt;&amp;lt;a onclick="return viewer.show(0)" href="images/img1.jpg"&amp;gt;&lt;br /&gt;&amp;lt;img width="70" height="70" alt="" src="images/img1_t.jpg" border="0"/&amp;gt; &amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a onclick="return viewer.show(1)" href="images/img2.jpg"&amp;gt;&lt;br /&gt;&amp;lt;img width="70" height="70" alt="" src="images/img2_t.jpg" border="0"/&amp;gt; &amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a onclick="return viewer.show(2)" href="images/img3.jpg"&amp;gt;&lt;br /&gt;&amp;lt;img width="70" height="70" alt="" src="images/img3.jpg" border="0"/&amp;gt; &amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;a href="javascript:void(viewer.show(0))"&amp;gt;Slideshow&amp;lt;/a&amp;gt;&lt;br /&gt;&amp;lt;/center&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="http://slideshow.triptracker.net/index.html"&gt;Read more and download "SlideShow Viewer"&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:180%;" &gt;&lt;span style="color: rgb(51, 102, 255);"&gt;PHP / Ajax upload example&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While the upload via XMLHttpRequest is not possible are there many examples and tutorials to upload file via some "virtual IFRAME".&lt;br /&gt;&lt;br /&gt;In this quick tutorial we will show how-to create such an Ajax upload form using the jQuery Form plug-in and our easy upload class. There is also a upload demo page available if you like to have a quick view on how it works. Okay let's start...&lt;br /&gt;&lt;br /&gt;The system is very simple, build your upload form just like normal. In place of posting the form to the script you use some JavaScript code to post the data to some PHP script in the background.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;Requirements&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    * A LAMP server with PHP5 and Imagemagicks enabled (optional)&lt;br /&gt;    * the Easy Upload PHP class&lt;br /&gt;    * the jQuery Javascript Library&lt;br /&gt;    * and the jQuery Form Plugin&lt;br /&gt;&lt;br /&gt;Download the required files and place the JavaScript files into the same directory as your HTML document and place the following JavaScript code into the HTML header.&lt;br /&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;jquery.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;jquery.form.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;&lt;br /&gt;$(document).ready(function() {&lt;br /&gt;    $(&amp;quot;#loading&amp;quot;)&lt;br /&gt;    .ajaxStart(function(){&lt;br /&gt;        $(this).show();&lt;br /&gt;    })&lt;br /&gt;    .ajaxComplete(function(){&lt;br /&gt;        $(this).hide();&lt;br /&gt;    });&lt;br /&gt;    var options = {&lt;br /&gt;        beforeSubmit:  showRequest,&lt;br /&gt;        success:       showResponse,&lt;br /&gt;        url:       'upload4jquery.php',  // your upload script&lt;br /&gt;        dataType:  'json'&lt;br /&gt;    };&lt;br /&gt;    $('#Form1').submit(function() {&lt;br /&gt;        document.getElementById('message').innerHTML = '';&lt;br /&gt;        $(this).ajaxSubmit(options);&lt;br /&gt;        return false;&lt;br /&gt;    });&lt;br /&gt;});&lt;br /&gt;&lt;br /&gt;function showRequest(formData, jqForm, options) {&lt;br /&gt;    var fileToUploadValue = $('input[@name=fileToUpload]').fieldValue();&lt;br /&gt;    if (!fileToUploadValue[0]) {&lt;br /&gt;        document.getElementById('message').innerHTML = 'Please select a file.';&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    return true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function showResponse(data, statusText)  {&lt;br /&gt;    if (statusText == 'success') {&lt;br /&gt;        if (data.img != '') {&lt;br /&gt;            document.getElementById('result').innerHTML = '&amp;lt;img src=&amp;quot;/files/thumb/'+data.img+'&amp;quot; /&amp;gt;';&lt;br /&gt;            document.getElementById('message').innerHTML = data.error;&lt;br /&gt;        } else {&lt;br /&gt;            document.getElementById('message').innerHTML = data.error;&lt;br /&gt;        }&lt;br /&gt;    } else {&lt;br /&gt;        document.getElementById('message').innerHTML = 'Unknown error!';&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Next create a PHP script named "upload4jquery.php" and place it in the same directory where other files are located. Place this code into that new file:&lt;br /&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;include($_SERVER['DOCUMENT_ROOT'].'/classes/upload/foto_upload_script.php');&lt;br /&gt;&lt;br /&gt;$foto_upload = new Foto_upload;   &lt;br /&gt;&lt;br /&gt;$json['size'] = $_POST['MAX_FILE_SIZE'];&lt;br /&gt;$json['img'] = '';&lt;br /&gt;&lt;br /&gt;$foto_upload-&amp;gt;upload_dir = $_SERVER['DOCUMENT_ROOT'].&amp;quot;/upload/&amp;quot;;&lt;br /&gt;$foto_upload-&amp;gt;foto_folder = $_SERVER['DOCUMENT_ROOT'].&amp;quot;/upload/&amp;quot;;&lt;br /&gt;$foto_upload-&amp;gt;thumb_folder = $_SERVER['DOCUMENT_ROOT'].&amp;quot;/upload/thumb/&amp;quot;;&lt;br /&gt;$foto_upload-&amp;gt;extensions = array(&amp;quot;.jpg&amp;quot;, &amp;quot;.gif&amp;quot;, &amp;quot;.png&amp;quot;);&lt;br /&gt;$foto_upload-&amp;gt;language = &amp;quot;en&amp;quot;;&lt;br /&gt;$foto_upload-&amp;gt;x_max_size = 480;&lt;br /&gt;$foto_upload-&amp;gt;y_max_size = 360;&lt;br /&gt;$foto_upload-&amp;gt;x_max_thumb_size = 120;&lt;br /&gt;$foto_upload-&amp;gt;y_max_thumb_size = 120;&lt;br /&gt;&lt;br /&gt;$foto_upload-&amp;gt;the_temp_file = $_FILES['fileToUpload']['tmp_name'];&lt;br /&gt;$foto_upload-&amp;gt;the_file = $_FILES['fileToUpload']['name'];&lt;br /&gt;$foto_upload-&amp;gt;http_error = $_FILES['fileToUpload']['error'];&lt;br /&gt;$foto_upload-&amp;gt;rename_file = true;&lt;br /&gt;&lt;br /&gt;if ($foto_upload-&amp;gt;upload()) {&lt;br /&gt;    $foto_upload-&amp;gt;process_image(false, true, true, 80);&lt;br /&gt;    $json['img'] = $foto_upload-&amp;gt;file_copy;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$json['error'] = strip_tags($foto_upload-&amp;gt;show_error_string());&lt;br /&gt;echo json_encode($json);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This tutorial or guide is not about how to use the easy upload class. If you never used the class before try the example files first and than start with this Ajax upload form.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 204, 255); font-weight: bold;"&gt;Paths and upload directories&lt;/span&gt;&lt;br /&gt;You need to create some upload directories (2 one for the upload and one for the thumbs) and check the permission (chmod the upload directory with 777). If you use the same structure as suggested in the class file you don't need to change the include at the top from the PHP script.&lt;br /&gt;&lt;br /&gt;Now we need the form HTML and some other containers where the response data is placed.&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;form id=&amp;quot;Form1&amp;quot; name=&amp;quot;Form1&amp;quot; method=&amp;quot;post&amp;quot; action=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;    &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;MAX_FILE_SIZE&amp;quot; value=&amp;quot;&amp;lt;?php echo $max_size; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;p&amp;gt;Select an image from your hard disk:&amp;lt;/p&amp;gt;&lt;br /&gt;    &amp;lt;div&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;file&amp;quot; name=&amp;quot;fileToUpload&amp;quot; id=&amp;quot;fileToUpload&amp;quot; size=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;        &amp;lt;input type=&amp;quot;Submit&amp;quot; value=&amp;quot;Submit&amp;quot; id=&amp;quot;buttonForm&amp;quot; /&amp;gt;&lt;br /&gt;    &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&amp;lt;img id=&amp;quot;loading&amp;quot; src=&amp;quot;loading.gif&amp;quot; style=&amp;quot;display:none;&amp;quot; /&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;p id=&amp;quot;message&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;p id=&amp;quot;result&amp;quot;&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The file loading.gif is the upload indicator image, pick the I used on the demo page or check Google for more stylish images or image generators.&lt;br /&gt;&lt;br /&gt;Some final note, the code works as it is. Don't change name or if attributes if you not sure if you use them inside the JavaScript code.&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-8575634803401327187?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/C7oEBeCmDbl_1xoUM4fyNA3iDH4/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C7oEBeCmDbl_1xoUM4fyNA3iDH4/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/C7oEBeCmDbl_1xoUM4fyNA3iDH4/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/C7oEBeCmDbl_1xoUM4fyNA3iDH4/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=9ftBwOcs"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=op7YWZij"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=fssmkp56"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=fssmkp56" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=hiuRnMuO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=vN8e9NI5"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=vN8e9NI5" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=UoIXK4BZ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=wZKd5MKl"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=wZKd5MKl" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=hEu625Hk"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=OhWOtfEt"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=OhWOtfEt" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=exVxNIwU"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/uiN3O-x6zj4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/uiN3O-x6zj4/slideshow-viewer.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/08/slideshow-viewer.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-7337549117011669213</guid><pubDate>Mon, 04 Aug 2008 08:17:00 +0000</pubDate><atom:updated>2008-08-04T01:22:58.019-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Ajax</category><title>Ajax autosuggest/autocomplete from database</title><description>Since google introduced the autosuggest or autocomplete search form on their toolbar everyone started looking for this piece of code to put on their websites. It's not new in the Ajax world but it's not seen as often as it should if you ask me. Why? It's hard to find good examples or examples that match everyone's needs. An Ajax autosuggest script is supposed to help the visitor and present in real time (as they type) some possible results based on their entered words/characters. In my opinion, this is a great feature to enhance the user experience. It's not hard to build an autocomplete search form. In fact, it's very easy. Our application will use &lt;a href="http://script.aculo.us/" target="_blank"&gt;script.aculo.us&lt;/a&gt; which is a rich Javascript library for the Ajax effect, an index page that will hold the search form and a response page that will perform the search based on the $_POST parameter received from our index and display some possible matches/results/suggestions. Since it's very easy to follow the demos and examples from the scriptaculous website we will focus more on the response page and the way that it will select the results and display them. Using what's explained in the &lt;a href="http://www.roscripts.com/PHP_search_engine-119.html" target="_blank"&gt;PHP search engine&lt;/a&gt; tutorial I managed to build a nice response page in order to display my suggestions using Ajax. The response page will check the post data, stem it (plurals to singulars etc.), clean it (for common words, too short words etc.) and perform an sql search do display the entries that might match our words.
&lt;br /&gt;
&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;
&lt;br /&gt;&amp;lt;?php
&lt;br /&gt;
&lt;br /&gt;   require_once('db.php');
&lt;br /&gt;   include('classes/stem.php');
&lt;br /&gt;   include('classes/cleaner.php');
&lt;br /&gt; 
&lt;br /&gt;   if( !empty ( $_POST['search'] ) ):
&lt;br /&gt; 
&lt;br /&gt;       $string = $_POST['search'];
&lt;br /&gt;       $main_url = 'http://www.roscripts.com/';
&lt;br /&gt; 
&lt;br /&gt;       $stemmer = new PorterStemmer;
&lt;br /&gt;       $stemmed_string = $stemmer-&amp;gt;stem ( $string );
&lt;br /&gt; 
&lt;br /&gt;       $clean_string = new jSearchString();
&lt;br /&gt;       $stemmed_string = $clean_string-&amp;gt;parseString ( $stemmed_string );      
&lt;br /&gt;     
&lt;br /&gt;       $new_string = '';
&lt;br /&gt;       foreach ( array_unique ( split ( " ",$stemmed_string ) ) as $array =&amp;gt; $value )
&lt;br /&gt;       {
&lt;br /&gt;           if(strlen($value) &amp;gt;= 3)
&lt;br /&gt;           {
&lt;br /&gt;               $new_string .= ''.$value.' ';
&lt;br /&gt;           }
&lt;br /&gt;       }
&lt;br /&gt;
&lt;br /&gt;       $new_string = substr ( $new_string,0, ( strLen ( $new_string ) -1 ) );
&lt;br /&gt;     
&lt;br /&gt;       if ( strlen ( $new_string ) &amp;gt; 3 ):
&lt;br /&gt;     
&lt;br /&gt;           $split_stemmed = split ( " ",$new_string );
&lt;br /&gt;             
&lt;br /&gt;               mysql_select_db($database);
&lt;br /&gt;           $sql = "SELECT DISTINCT COUNT(*) as occurences, title, subtitle FROM articles WHERE (";
&lt;br /&gt;                  
&lt;br /&gt;           while ( list ( $key,$val ) = each ( $split_stemmed ) )
&lt;br /&gt;           {
&lt;br /&gt;                     if( $val!='' &amp;amp;&amp;amp; strlen ( $val ) &amp;gt; 0 )
&lt;br /&gt;                     {
&lt;br /&gt;                         $sql .= "((title LIKE '%".$val."%' OR subtitle LIKE '%".$val."%' OR content LIKE '%".$val."%')) OR";
&lt;br /&gt;                     }
&lt;br /&gt;           }
&lt;br /&gt;         
&lt;br /&gt;           $sql=substr ( $sql,0, ( strLen ( $sql )-3 ) );//this will eat the last OR
&lt;br /&gt;           $sql .= ") GROUP BY title ORDER BY occurences DESC LIMIT 10";
&lt;br /&gt;     
&lt;br /&gt;           $query = mysql_query($sql) or die ( mysql_error () );
&lt;br /&gt;           $row_sql = mysql_fetch_assoc ( $query );
&lt;br /&gt;           $total = mysql_num_rows ( $query );
&lt;br /&gt;          
&lt;br /&gt;           if($total&amp;gt;0):
&lt;br /&gt; 
&lt;br /&gt;                   echo '    &amp;lt;div class="entry"&amp;gt;'."n";
&lt;br /&gt;               echo '        &amp;lt;ul&amp;gt;'."n";
&lt;br /&gt;                   while ( $row = mysql_fetch_assoc ( $query ) )
&lt;br /&gt;                   {              
&lt;br /&gt;                       echo '            &amp;lt;li&amp;gt;'."n";
&lt;br /&gt;                       echo '                &amp;lt;a href="'.$main_url.'articles/show/'.$row['id'].'"&amp;gt;'.$row['title'].''."n";
&lt;br /&gt;                       echo '                &amp;lt;em&amp;gt;'.$row['subtitle'].'&amp;lt;/em&amp;gt;'."n";
&lt;br /&gt;                       echo '                &amp;lt;span&amp;gt;Added on 2007-06-03 by roScripts&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;'."n";
&lt;br /&gt;                       echo '            &amp;lt;/li&amp;gt;'."n";              
&lt;br /&gt;                   }
&lt;br /&gt;                 
&lt;br /&gt;               echo '        &amp;lt;/ul&amp;gt;'."n";
&lt;br /&gt;               echo '    &amp;lt;/div&amp;gt;'."n";
&lt;br /&gt;           endif;
&lt;br /&gt;       endif;
&lt;br /&gt;   endif;  
&lt;br /&gt;?&amp;gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;It's more like a complex code and I encourage you to read and understand the &lt;a href="http://www.roscripts.com/PHP_search_engine-119.html" target="_blank"&gt;PHP search engine&lt;/a&gt; tutorial, you can delete everything that is above and enter an sql query that you built in case you don't want to use this method of searching. As a short overview of the code engine I must say that no results will be shown if the string's length (after it will be stemmed and cleaned for common words/stop words) will be smaller than 3 characters:
&lt;br /&gt;
&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;
&lt;br /&gt;if ( strlen ( $new_string ) &gt; 3 ):
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;and that the result (if any) must be an unordered list (ul).
&lt;br /&gt;Here's a &lt;a href="http://www.roscripts.com/uploads/articles/153" target="_blank"&gt;demo&lt;/a&gt; with our application (download link lower on the page). Have fun!       
&lt;br /&gt;       &lt;/pre&gt;         &lt;!--         &lt;div style="margin-top:10px;padding:5px;border:1px solid #ccc"&gt;         &lt;div style="width:300px; float:left"&gt; 		&lt;a href="http://www.phplogin.net" title="PHP login script" target="_blank" border="0"&gt;&lt;img border="0" src="http://www.roscripts.com/uploads/banners/phplogin300.jpg" alt="PHP login script" /&gt;&lt;/a&gt;         &lt;/div&gt;         &lt;div style="width:330px; float:right"&gt; 	        &lt;a href="http://www.wallpaperscript.net" title="Wallpaper script" target="_blank" border="0"&gt;&lt;img border="0" src="http://www.roscripts.com/uploads/banners/330_250.gif" alt="Wallpaper script" /&gt;&lt;/a&gt;		         &lt;/div&gt;         &lt;div class="clear"&gt;&lt;/div&gt;         &lt;/div&gt; --&gt; &lt;pre&gt;
&lt;br /&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-7337549117011669213?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cssyojpCdpCXUCv1Lqcuc1ZjrEs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cssyojpCdpCXUCv1Lqcuc1ZjrEs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cssyojpCdpCXUCv1Lqcuc1ZjrEs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cssyojpCdpCXUCv1Lqcuc1ZjrEs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Z1VeOg1a"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=LUDTWqts"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Ts7Q94qk"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=Ts7Q94qk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=NpcTO5ZK"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=lUKz55Og"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=lUKz55Og" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=ujxhWrhc"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=w8HBt2sX"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=w8HBt2sX" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=jufXAGE2"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=q6rOrV7B"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=q6rOrV7B" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=ZQjxy976"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/WhsekYMfxwE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/WhsekYMfxwE/ajax-autosuggestautocomplete-from.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/08/ajax-autosuggestautocomplete-from.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-5341806875341825640</guid><pubDate>Sat, 05 Jul 2008 14:29:00 +0000</pubDate><atom:updated>2008-07-05T07:36:09.890-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Examples</category><title>PHP Examples</title><description>&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:130%;" &gt;Paging in PHP&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A Example Script of Paging in PHP&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;// =====================================================&lt;br /&gt;// FILE: Paging.php&lt;br /&gt;//&lt;br /&gt;// =====================================================&lt;br /&gt;class Paging {&lt;br /&gt;&lt;br /&gt;var $int_num_result;  // Number of result to show per page (decided by user)&lt;br /&gt;var $int_nbr_row;     // Total number of items (SQL count from db)&lt;br /&gt;var $int_cur_position;// Current position in recordset&lt;br /&gt;var $str_ext_argv;    // Extra argv of query string&lt;br /&gt;&lt;br /&gt;// ------------------------------------------------------------------------ Constructor&lt;br /&gt;//&lt;br /&gt;function Paging( $int_nbr_row, $int_cur_position, $int_num_result, $str_ext_argv = "" ){&lt;br /&gt;  $this-&gt;int_nbr_row = $int_nbr_row;&lt;br /&gt;  $this-&gt;int_num_result = $int_num_result;&lt;br /&gt;  $this-&gt;int_cur_position = $int_cur_position;&lt;br /&gt;  $this-&gt;str_ext_argv = urldecode( $str_ext_argv );&lt;br /&gt;} // End constructor&lt;br /&gt;&lt;br /&gt;// ------------------------------------------------------------------- getNumberOfPage()&lt;br /&gt;// This function returns the total number of page to display.&lt;br /&gt;function getNumberOfPage(){&lt;br /&gt;  $int_nbr_page = $this-&gt;int_nbr_row / $this-&gt;int_num_result;&lt;br /&gt;  return $int_nbr_page;&lt;br /&gt;} // end function&lt;br /&gt;&lt;br /&gt;// -------------------------------------------------------------------- getCurrentPage()&lt;br /&gt;// This function returns the current page number.&lt;br /&gt;function getCurrentPage(){&lt;br /&gt;  $int_cur_page = ( $this-&gt;int_cur_position * $this-&gt;getNumberOfPage() ) / $this-&gt;int_nbr_row;&lt;br /&gt;  return number_format( $int_cur_page, 0 );&lt;br /&gt;} // end function&lt;br /&gt;&lt;br /&gt;// ----------------------------------------------------------------------- getPagingArray()&lt;br /&gt;// This function print the paging to the screen.&lt;br /&gt;// This function returns an array:&lt;br /&gt;// $array_paging['lower'] lower limit of where we are in result set&lt;br /&gt;// $array_paging['upper'] upper limit of where we are in result set&lt;br /&gt;// $array_paging['total'] total number of result&lt;br /&gt;// $array_paging['previous_link'] href tag for previous link&lt;br /&gt;// $array_paging['next_link'] href tag for next link&lt;br /&gt;function getPagingArray(){&lt;br /&gt;  global $PHP_SELF;&lt;br /&gt;&lt;br /&gt;  $array_paging['lower'] = ( $this-&gt;int_cur_position + 1 );&lt;br /&gt;&lt;br /&gt;  if( $this-&gt;int_cur_position + $this-&gt;int_num_result &gt;= $this-&gt;int_nbr_row ){&lt;br /&gt;    $array_paging['upper'] = $this-&gt;int_nbr_row;&lt;br /&gt;  }else{&lt;br /&gt;    $array_paging['upper'] = ( $this-&gt;int_cur_position + $this-&gt;int_num_result );&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  $array_paging['total'] = $this-&gt;int_nbr_row;&lt;br /&gt;&lt;br /&gt;  if ( $this-&gt;int_cur_position != 0 ){&lt;br /&gt;    $array_paging['previous_link'] = "&lt;a href="http://www.blogger.com/%5C" int_cur_position=""&gt;int_cur_position - $this-&gt;int_num_result ).$this-&gt;str_ext_argv ."\"&gt;";&lt;br /&gt;  }         &lt;br /&gt;&lt;br /&gt;  if( ( $this-&gt;int_nbr_row - $this-&gt;int_cur_position ) &gt; $this-&gt;int_num_result ){&lt;br /&gt;    $int_new_position = $this-&gt;int_cur_position + $this-&gt;int_num_result; &lt;br /&gt;    $array_paging['next_link'] = "&lt;/a&gt;&lt;a href="http://www.blogger.com/%5C" int_cur_position="$int_new_position"&gt;str_ext_argv ."\"&gt;";&lt;br /&gt;  }&lt;br /&gt;  return $array_paging;&lt;br /&gt;} // end function&lt;br /&gt;&lt;br /&gt;// ----------------------------------------------------------------------- getPagingRowArray()&lt;br /&gt;// This function returns an array of string (href link with the page number)&lt;br /&gt;function getPagingRowArray(){&lt;br /&gt;  global $PHP_SELF;&lt;br /&gt;&lt;br /&gt;  for( $i=0; $i&lt;$this-&gt;getNumberOfPage(); $i++ ){&lt;br /&gt;    // if current page, do not make a link&lt;br /&gt;    if( $i == $this-&gt;getCurrentPage() ){&lt;br /&gt;      $array_all_page[$i] = "&lt;b&gt;". ($i+1) ."&lt;/b&gt;";&lt;br /&gt;    }else{&lt;br /&gt;      $int_new_position = ( $i * $this-&gt;int_num_result );&lt;br /&gt;      $array_all_page[$i] = "&lt;/a&gt;&lt;a href="http://www.blogger.com/%5C" int_cur_position="$int_new_position$this-"&gt;str_ext_argv\"&gt;". ($i+1) ."&lt;/a&gt;";&lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;  return $array_all_page;&lt;br /&gt;} // end function&lt;br /&gt;}; // End Class&lt;br /&gt;&lt;br /&gt;// ==========================================&lt;br /&gt;// Exemple Usage&lt;br /&gt;// Note: I make 2 query to the database for this exemple, it&lt;br /&gt;// could (and should) be made with only one query...&lt;br /&gt;// ==========================================&lt;br /&gt;&lt;br /&gt;include( "db_mysql.php" );&lt;br /&gt;&lt;br /&gt;// New instance of database object, from phplib (http://phplib.sourceforge.net/)&lt;br /&gt;$db = new db_data();&lt;br /&gt;&lt;br /&gt;// If current position is not set, set it to zero&lt;br /&gt;if( !isset( $int_cur_position ) || $int_cur_position == 0 ){&lt;br /&gt;$int_cur_position = 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Number of result to display on the page, will be in the LIMIT of the sql query also&lt;br /&gt;$int_num_result = 20;&lt;br /&gt;$extargv = "&amp;amp;argv1=1&amp;amp;argv2=2"; // extra argv here (could be anything depending on your page)&lt;br /&gt;&lt;br /&gt;// Get the total number of result from db&lt;br /&gt;$sql1 = "Select count( key ) as nbr FROM table";&lt;br /&gt;&lt;br /&gt;if ( !$db-&gt;query( $sql1 )){ print "\n&lt;/span&gt;                &lt;p&gt;&lt;span style="font-size:100%;"&gt;ERREUR $sql1"; exit; }&lt;br /&gt;$db-&gt;next_record();&lt;br /&gt;$result_from_sql1 = $db-&gt;f("nbr");&lt;br /&gt;&lt;br /&gt;// New instance of the Paging class, you can modify the color and the width of the html table&lt;br /&gt;$p = new Paging( $result_from_sql1, $int_cur_position, $int_num_result, $extargv );&lt;br /&gt;&lt;br /&gt;// Load up the 2 array in order to display result&lt;br /&gt;$array_paging = $p-&gt;getPagingArray();&lt;br /&gt;$array_row_paging = $p-&gt;getPagingRowArray();&lt;br /&gt;&lt;br /&gt;// Display the result as you like...&lt;br /&gt;print "Results ". $array_paging['lower'];&lt;br /&gt;print " to ". $array_paging['upper'];&lt;br /&gt;print " of ". $array_paging['total'];&lt;br /&gt;print "  ". $array_paging['previous_link'] ."&lt;&lt;&lt; " ; for( $i=0; $i&lt;/span&gt;&lt;sizeof($array_row_paging); print="" next_link=""&gt;&lt;span style="font-size:100%;"&gt;&gt;&gt;";&lt;br /&gt;&lt;br /&gt;// The above exemple print somethings like:&lt;br /&gt;// Results 1 to 20 of 597  &lt;&lt;&lt;&gt;&gt;&gt;&lt;br /&gt;// Of course you can now play with array_row_paging in order to print&lt;br /&gt;// only the results you would like...&lt;br /&gt;&lt;br /&gt;// Now go on with the rest of you page...&lt;br /&gt;//  Select only fields needed according to paging&lt;br /&gt;$sql2 = "Select * FROM my_table ORDER BY id "&lt;br /&gt;."LIMIT $int_cur_position, $int_num_result";&lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/sizeof($array_row_paging);&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-5341806875341825640?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/acsLfAJtjF6Upq_YhZOj50vzMEE/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/acsLfAJtjF6Upq_YhZOj50vzMEE/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/acsLfAJtjF6Upq_YhZOj50vzMEE/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/acsLfAJtjF6Upq_YhZOj50vzMEE/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=5SkWCb0a"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=oU1SSlxb"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=COxEaEHC"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=COxEaEHC" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=jKh6GP8D"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=tsBWn1cJ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=tsBWn1cJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=7ztzL7DH"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=b41c3Gxy"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=b41c3Gxy" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=gbfeo01K"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Q03WIGP8"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=Q03WIGP8" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=TZiAeHBy"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/H0IRntlZr6g" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/H0IRntlZr6g/php-examples_05.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/07/php-examples_05.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-1314073439293425651</guid><pubDate>Fri, 04 Jul 2008 04:24:00 +0000</pubDate><atom:updated>2008-07-04T21:01:44.636-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Examples</category><title>PHP Examples</title><description>&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP Session&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Session support in PHP consists of a way to preserve certain data across subsequent accesses. This enables you to build more customized applications and increase the appeal of your web site.&lt;br /&gt;A visitor accessing your web site is assigned a unique id, the session id. This is either stored in a cookie on the user side or is propagated in the URL or can be stored in database.&lt;br /&gt;A normal HTML website will not pass data from one page to another. In other words, all information is forgotten when a new page is loaded. This makes it quite a problem for tasks like a shopping cart, which requires data (the user’s selected product) to be remembered from one page to the next.&lt;br /&gt;Sometimes we store id, name and other information about user in PHP Sessions. A PHP session solves this problem by allowing you to store user information on the server for later use (i.e. username, shopping cart items, etc). However, this session information is temporary and is usually deleted very quickly after the user has left the website that uses sessions.&lt;br /&gt;Sessions work by creating a unique identification (UID) number for each visitor and storing variables based on this ID. This helps to prevent two users’ data from getting confused with one another when visiting the same web page.&lt;br /&gt;We can start, call or retrieve and use or destroy session or session data.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Starting a PHP Session&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before you can begin storing user information in your PHP session, you must first start the session. When you start a session, it must be at the very beginning of your code, before any HTML or text is sent.&lt;br /&gt;Below is a simple script that you should place at the beginning of your PHP code to start up a PHP session.&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;session_start();&lt;br /&gt;// start up your PHP session!&lt;br /&gt;// this code must be at the top of web page.&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Storing A Session Variable&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;session_start();&lt;br /&gt;$_SESSION['downloads'] = 1; // store session data&lt;br /&gt;echo "Downloads = ". $_SESSION['donloads']; //retrieve data&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;Using PHP issetFunction&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;session_start();&lt;br /&gt;if(isset($_SESSION['views']))&lt;br /&gt;$_SESSION['views'] = $_SESSION['views']+ 1;&lt;br /&gt;else&lt;br /&gt;$_SESSION['views'] = 1;&lt;br /&gt;echo "views = ". $_SESSION['views'];&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Destroying Sessions&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;session_start();&lt;br /&gt;session_destroy();&lt;br /&gt;// By this all the session data will be erased and session will be reset, free and empty.&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;OR&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;session_start();&lt;br /&gt;session_destroy();&lt;br /&gt;$_SESSION=array();&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Selectively Destroying Session Data&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;session_start();&lt;br /&gt;unset($_SESSION['downloads']);&lt;br /&gt;unset($_SESSION['userName']);&lt;br /&gt;// session_destroy();&lt;br /&gt;// $_SESSION=array();&lt;br /&gt;// By this all the session data will not be lost. Just downloads and userName will be destroyed from session and if other data is ther, it will stay there.&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:180%;" &gt;PHP Email&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP: Send plain text email&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;function send_email($from, $to, $cc, $bcc, $subject, $message){&lt;br /&gt;$headers = "From: ".$from."rn";&lt;br /&gt;$headers .= "Reply-To: ".$from."rn";&lt;br /&gt;$headers .= "Return-Path: ".$from."rn";&lt;br /&gt;$headers .= "CC: ".$cc."rn";&lt;br /&gt;$headers .= "BCC: ".$to."rn";&lt;br /&gt;&lt;br /&gt;if (mail($to,$subject,$message,$headers) ) {&lt;br /&gt;   echo "email sent";&lt;br /&gt;} else {&lt;br /&gt;   echo "email could not be sent";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$subject = "Hello!";&lt;br /&gt;$message = "Hello! How are you today?";&lt;br /&gt;send_email("youraddress@domain.com", "recpeient@domain.com",&lt;br /&gt;"someone@domain.com", "hidden_email@domain.com",&lt;br /&gt;$subject ,&lt;br /&gt;$message);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In our send_email function we set the appropriate headers. Reply-To and Return-Path points to the email you want the recipient to reply to. Some server requires the use of Return-Path, so it's good to leave it in there.&lt;br /&gt;Next we call the send_email function which sends out the email.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:130%;" &gt;PHP: Send HTML email&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;function send_email($from, $to, $subject, $message){&lt;br /&gt;$headers = "From: ".$from."rn";&lt;br /&gt;$headers .= "Reply-To: ".$from."rn";&lt;br /&gt;$headers .= "Return-Path: ".$from."rn";&lt;br /&gt;$headers .= "Content-type: text/htmlrn";&lt;br /&gt;&lt;br /&gt;if (mail($to,$subject,$message,$headers) ) {&lt;br /&gt;   echo "email sent";&lt;br /&gt;} else {&lt;br /&gt;   echo "email couldn't be sent";&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$subject = "Helloooo!";&lt;br /&gt;$message .= "&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;";&lt;br /&gt;$message .= "&amp;lt;b&amp;gt;Hey! How are you today?&amp;lt;/b&amp;gt;";&lt;br /&gt;$message .= "&amp;lt;br&amp;gt;Regards";&lt;br /&gt;$message .= "&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;";&lt;br /&gt;send_email("youraddress@domain.com", "recpeient@domain.com",&lt;br /&gt;$subject ,&lt;br /&gt;$message);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In our send_email function we set the content type headers to text/html. It is important to do so because it tells the email server that the email contains html code and to format and display the email correctly when it is opened.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);font-size:130%;" &gt;Export MySql Data to CSV file&lt;/span&gt;&lt;br /&gt;This function will export all data in the Mysql table. It will place the fieldnames on the first row of the CSV file.&lt;br /&gt;The function will export all Mysql data to a file called ‘export.csv’ by default.&lt;br /&gt;You can change this by adding an extra parameter to the exportMysqlToCsv: exportMysqlToCsv($tablename,$filename).&lt;br /&gt;When the export finishes all your data will be inserted into the csv file and the file will be presented as a download.&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;function exportMysqlToCsv($table,$filename = 'export.csv')&lt;br /&gt;{&lt;br /&gt;  $csv_terminated = "\n";&lt;br /&gt;  $csv_separator = ",";&lt;br /&gt;  $csv_enclosed = '"';&lt;br /&gt;  $csv_escaped = "\\";&lt;br /&gt;  $sql_query = "select * from $table";&lt;br /&gt;&lt;br /&gt;  // Gets the data from the database&lt;br /&gt;  $result = mysql_query($sql_query);&lt;br /&gt;  $fields_cnt = mysql_num_fields($result);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  $schema_insert = '';&lt;br /&gt;&lt;br /&gt;  for ($i = 0; $i &lt; $fields_cnt; $i++)    {        $l = $csv_enclosed . str_replace($csv_enclosed, $csv_escaped . $csv_enclosed,            stripslashes(mysql_field_name($result, $i))) . $csv_enclosed;        $schema_insert .= $l;        $schema_insert .= $csv_separator;    } // end for     $out = trim(substr($schema_insert, 0, -1));    $out .= $csv_terminated;     // Format the data    while ($row = mysql_fetch_array($result))    {        $schema_insert = '';        for ($j = 0; $j &lt; $fields_cnt; $j++)        {            if ($row[$j] == '0' || $row[$j] != '')            {                 if ($csv_enclosed == '')                {                    $schema_insert .= $row[$j];                } else                {                    $schema_insert .= $csv_enclosed .                    str_replace($csv_enclosed, $csv_escaped . $csv_enclosed, $row[$j]) . $csv_enclosed;                }            } else            {                $schema_insert .= '';            }             if ($j &lt; $fields_cnt - 1)            {                $schema_insert .= $csv_separator;            }        } // end for         $out .= $schema_insert;        $out .= $csv_terminated;    } // end while     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");    header("Content-Length: " . strlen($out));    // Output to browser with appropriate mime type, you choose ;)    header("Content-type: text/x-csv");    //header("Content-type: text/csv");    //header("Content-type: application/csv");    header("Content-Disposition: attachment; filename=$filename");    echo $out;    exit;  } &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-1314073439293425651?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/2wGkKiDGhkds3IvJbq9teIU4DeY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2wGkKiDGhkds3IvJbq9teIU4DeY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/2wGkKiDGhkds3IvJbq9teIU4DeY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/2wGkKiDGhkds3IvJbq9teIU4DeY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=tFy4J6oO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=uzg8ZqTH"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=r94LGJY2"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=r94LGJY2" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=c6hlLIod"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=b6hKrK1T"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=b6hKrK1T" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=tERfIWx1"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=TgooayoF"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=TgooayoF" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=HfGPOWV4"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=OA6ZTyeM"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=OA6ZTyeM" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=YwOucULy"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/2rniFkj9QcY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/2rniFkj9QcY/php-examples_03.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/07/php-examples_03.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-3321651126681685696</guid><pubDate>Thu, 03 Jul 2008 05:20:00 +0000</pubDate><atom:updated>2008-07-02T22:44:36.325-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Examples</category><title>PHP Examples</title><description>&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Setting and Retrieving a cookie- PHP&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;$check = "test";&lt;br /&gt;$check .= $filename;&lt;br /&gt;if ($test == $check)&lt;br /&gt;{&lt;br /&gt;print("&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;You have already voted. Thank you.&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;");&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;$rated = "test";&lt;br /&gt;$rated .= $filename;&lt;br /&gt;setcookie(test, $rated, time()+86400);&lt;br /&gt;print("&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;&amp;lt;br&amp;gt;You haven't voted before so I recorded your vote&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;");&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;Generating a random  number from 0 to 9 - PHP&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;srand(time());&lt;br /&gt;$random = (rand()%9);&lt;br /&gt;print("Random number between 0 and 9 is: $random");&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Random text link advertising using predefined arrays- PHP&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?&lt;br /&gt;$random_url = array("http://www.tdscripts.com/linkorg.html",&lt;br /&gt;               "http://www.tdscripts.com/keno.html",&lt;br /&gt;               "http://www.tdscripts.com/ezibill.shtml",&lt;br /&gt;               "http://www.tdscripts.com/tdforum.shtml",&lt;br /&gt;               "http://www.tdscripts.com/picofday.html",&lt;br /&gt;               "http://www.tdscripts.com/gutsorglory.html");&lt;br /&gt;&lt;br /&gt;$url_title = array("Link Organizer",&lt;br /&gt;              "TD Keno",&lt;br /&gt;              "eziBill *Free Promotion!",&lt;br /&gt;              "TD Forum",&lt;br /&gt;              "TD Pic of Day PHP",&lt;br /&gt;              "Guts or Glory Poker PHP");&lt;br /&gt;$url_desc = array("- A comprehensive link list organizer",&lt;br /&gt;"- Offer your site visitors an engaging Keno game without the monetary risk",&lt;br /&gt;"- Sell access to and protect your membership area using iBill and our eziBill script",&lt;br /&gt;"- An unthreaded messageboard script to exchange ideas with your site visitors",&lt;br /&gt;"- Run your own picture of the day script from any site anywhere with this handy script",&lt;br /&gt;"- A casino-style card game written entirely in PHP");&lt;br /&gt;srand(time());&lt;br /&gt;$sizeof = count($random_url);&lt;br /&gt;$random = (rand()%$sizeof);&lt;br /&gt;print("&amp;lt;center&amp;gt;&amp;lt;a href="$random_url[$random]"&amp;gt;$url_title[$random]&amp;lt;/a&amp;gt; $url_desc[$random]&amp;lt;/center&amp;gt;");&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:130%;" &gt;Displaying Date and Time- PHP&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;1- &amp;lt;?php date("Y-m-d"); ?&amp;gt;&lt;br /&gt;2- &amp;lt;?php date("D M j G:i:s T Y"); ?&amp;gt;&lt;br /&gt;3- &amp;lt;?php date("H:i:s"); ?&amp;gt;&lt;br /&gt;4- &amp;lt;?php date("F j, Y, g:i a"); ?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Your output will be:&lt;br /&gt;1- 2006-09-09&lt;br /&gt;2- Sat Sep 9 4:13:18 CDT 2006&lt;br /&gt;3- 04:13:18&lt;br /&gt;4- September 9, 2006, 4:13 am&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Automatic Page Refresh- PHP&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Functions like this are used in big portals to automatically refresh the home page (or subpages) in order&lt;br /&gt;to give always updated news.&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;header("Refresh: 120;");&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In this exmaple the current page is automatically reloaded after 2 minutes, note that time is expressed in seconds so to have 2 minutes between 2 refreshed you need to type 120&lt;br /&gt;You can use this php line also to redirect (with the preselected delay) to another page of your site, or external to your site.&lt;br /&gt;&lt;br /&gt;This will send the visitor to the forums (assuming you have the forums running under the folder "forums" as ours) after 6 seconds.&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;header("Refresh: 6; url=/forums/");&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This will send the visitor to www.php.net after 10 seconds.&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;header("Refresh: 10; url=http://www.php.net");&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Remember that using the PHP header function you always have to put it at the very beginning of your page, just after the &amp;lt;html&amp;gt; tag. Any other header sent before our header function will make it cause an error.&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt;&lt;br /&gt;More Examples : See &lt;a href="http://technothinktank.blogspot.com/2008/07/php-examples.html#links"&gt;&lt;span style="color: rgb(255, 102, 0); font-weight: bold;"&gt;&lt;/span&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 102, 0); font-weight: bold;"&gt;&lt;a&gt;PHP exmaples&lt;/a&gt;  &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-3321651126681685696?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QCAE4J3kX_JaIassnpQ2Pawg5mQ/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QCAE4J3kX_JaIassnpQ2Pawg5mQ/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QCAE4J3kX_JaIassnpQ2Pawg5mQ/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QCAE4J3kX_JaIassnpQ2Pawg5mQ/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=PoBIkVte"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=njynvlXZ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=zyw1vzar"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=zyw1vzar" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=HM5eT4z0"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=ElwvSYUr"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=ElwvSYUr" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Z4YEbIlj"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=SxojiQHn"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=SxojiQHn" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=a2W2ZB3J"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=u29IQQm0"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=u29IQQm0" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=oML3Z9Yh"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/y-cHlHBGlWE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/y-cHlHBGlWE/setting-and-retrieving-cookie-check.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/07/setting-and-retrieving-cookie-check.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-7032173640394138330</guid><pubDate>Wed, 02 Jul 2008 05:41:00 +0000</pubDate><atom:updated>2008-07-02T19:13:18.616-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Examples</category><title>PHP Examples</title><description>&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:130%;" &gt;PHP - Files&lt;/span&gt;&lt;br /&gt;Manipulating files is a basic necessity for serious programmers and PHP gives you a great deal of tools for creating, uploading, and editing files.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP - How to Create a File&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The fopen function needs two important pieces of information to operate correctly. First, we must supply it with the name of the file that we want it to open. Secondly, we must tell the function what we plan on doing with that file (i.e. read from the file, write information, etc).&lt;br /&gt;&lt;br /&gt;Since we want to create a file, we must supply a file name and tell PHP that we want to write to the file. Note: We have to tell PHP we are writing to the file, otherwise it will not create a new file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$fileName = "testfile.txt";&lt;br /&gt;$fileHandle = fopen($fileName, 'w') or die("can't open file");&lt;br /&gt;fclose($fileHandle);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The file "testFile.txt" should be created in the same directory where this PHP code resides. PHP will see that "testFile.txt" does not exist and will create it after running this code. There's a lot of information in those three lines of code, let's make sure you understand it.&lt;br /&gt;&lt;br /&gt; 1. $fileName = "testfile.txt";&lt;br /&gt;&lt;br /&gt;    Here we create the name of our file, "testfile.txt" and store it into a PHP String variable $fileName.&lt;br /&gt; 2. $fileHandle = fopen($fileName, 'w') or die("can't open file");&lt;br /&gt;&lt;br /&gt;    This bit of code actually has two parts. First we use the function fopen and give it two arguments: our file name and we inform PHP that we want to write by passing the character "w".&lt;br /&gt;&lt;br /&gt;    Second, the fopen function returns what is called a file handle, which will allow us to manipulate the file. We save the file handle into the $fileHandle variable. We will talk more about file handles later on.&lt;br /&gt; 3. fclose($fileHandle);&lt;br /&gt;&lt;br /&gt;    We close the file that was opened. fclose takes the file handle that is to be closed. We will talk more about this more in the file closing lesson&lt;br /&gt;___________________________________________________________________&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;font-size:130%;" &gt;PHP - Permissions&lt;/span&gt;&lt;br /&gt;If you are trying to get this program to run and you are having errors, you might want to check that you have granted your PHP file access to write information to the hard drive. Setting permissions is most often done with the use of an FTP program to execute a command called CHMOD. Use CHMOD to allow the PHP file to write to disk, thus allowing it to create a file.&lt;br /&gt;&lt;br /&gt;In the near future Tizag.com will have a more in-depth tutorial on how to use CHMOD to set file permissions.&lt;br /&gt;&lt;br /&gt;  * Read: 'r'&lt;br /&gt;&lt;br /&gt;Open a file for read only use. The file pointer begins at the front of the file.&lt;br /&gt;&lt;br /&gt;  * Write: 'w'&lt;br /&gt;&lt;br /&gt;Open a file for write only use. In addition, the data in the file is erased and you will begin writing data at the beginning of the file. This is also called truncating a file, which we will talk about more in a later lesson. The file pointer begins at the start of the file.&lt;br /&gt;&lt;br /&gt;  * Append: 'a'&lt;br /&gt;&lt;br /&gt;Open a file for write only use. However, the data in the file is preserved and you begin will writing data at the end of the file. The file pointer begins at the end of the file.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  * Read/Write: 'r+'&lt;br /&gt;&lt;br /&gt;Opens a file so that it can be read from and written to. The file pointer is at the beginning of the file.&lt;br /&gt;&lt;br /&gt;  * Write/Read: 'w+'&lt;br /&gt;&lt;br /&gt;This is exactly the same as r+, except that it deletes all information in the file when the file is opened.&lt;br /&gt;&lt;br /&gt;  * Append: 'a+'&lt;br /&gt;&lt;br /&gt;This is exactly the same as r+, except that the file pointer is at the end of the file.&lt;br /&gt;A file pointer is PHP's way of remembering its location in a file. When you open a file for reading, the file pointer begins at the start of the file. This makes sense because you will usually be reading data from the front of the file.&lt;br /&gt;&lt;br /&gt;However, when you open a file for appending, the file pointer is at the end of the file, as you most likely will be appending data at the end of the file. When you use reading or writing functions they begin at the location specified by the file pointer.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Code example&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$fileName = "testfile.txt";&lt;br /&gt;$fh = fopen($fileName, 'X') or die("Can't open file");&lt;br /&gt;fclose($fh);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Close&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;In a previous tutorial, we had a call to the function fclose to close down a file after we were done with it. Here we will repeat that example and discuss the importance of closing a file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$ourFileName = "testFile.txt";&lt;br /&gt;$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");&lt;br /&gt;fclose($ourFileHandle);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The function fclose requires the file handle that we want to close down. In our example we set our variable "$fileHandle" equal to the file handle returned by the fopen function.&lt;br /&gt;&lt;br /&gt;After a file has been closed down with fclose it is impossible to read, write or append to that file unless it is once more opened up with the fopen function.&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP - File Write&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Now that you know how to open and close a file, lets get on to the most useful part of file manipulation, writing! There is really only one main function that is used to write and it's logically called fwrite&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP - File Write: fwrite Function&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;We can use php to write to a text file. The fwrite function allows data to be written to any type of file. Fwrite's first parameter is the file handle and its second parameter is the string of data that is to be written. Just give the function those two bits of information and you're good to go!&lt;br /&gt;&lt;br /&gt;Below we are writing a couple of names into our test file testFile.txt and separating them with a carriaged return.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'w') or die("can't open file");&lt;br /&gt;$stringData = "Bobby Bopper\n";&lt;br /&gt;fwrite($fh, $stringData);&lt;br /&gt;$stringData = "Tracy Tanner\n";&lt;br /&gt;fwrite($fh, $stringData);&lt;br /&gt;fclose($fh);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The $fh variable contains the file handle for testFile.txt. The file handle knows the current file pointer, which for writing, starts out at the beginning of the file.&lt;br /&gt;&lt;br /&gt;We wrote to the file testFile.txt twice. Each time we wrote to the file we sent the string $stringData that first contained Bobby Bopper and second contained Tracy Tanner. After we finished writing we closed the file using the fclose function.&lt;br /&gt;&lt;br /&gt;If you were to open the testFile.txt file in NOTEPAD it would look like this:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Contents of the testFile.txt File:&lt;/span&gt;&lt;br /&gt;Bobby Bopper&lt;br /&gt;Tracy Tanner&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Write: Overwriting&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Now that testFile.txt contains some data we can demonstrate what happens when you open an existing file for writing. All the data contained in the file is wiped clean and you start with an empty file. In this example we open our existing file testFile.txt and write some new data into it.&lt;br /&gt;PHP Code:&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'w') or die("can't open file");&lt;br /&gt;$stringData = "Floppy Jalopy\n";&lt;br /&gt;fwrite($fh, $stringData);&lt;br /&gt;$stringData = "Pointy Pinto\n";&lt;br /&gt;fwrite($fh, $stringData);&lt;br /&gt;fclose($fh);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;If you now open the testFile.txt file you will see that Bobby and Tracy have both vanished, as we expected, and only the data we just wrote is present.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Contents of the testFile.txt File:&lt;/span&gt;&lt;br /&gt;Floppy Jalopy&lt;br /&gt;Pointy Pinto&lt;br /&gt;&lt;br /&gt;In the next lesson we will show you how to get information out of a file by using PHP's read data functions!&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Read&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;My apologies for taking so long to actually get to the point where you get information from files. In this lesson we will teach you how to read data from a file using various PHP functions.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Read: fread Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The fread function is the staple for getting data out of a file. The function requires a file handle, which we have, and an integer to tell the function how much data, in bytes, it is supposed to read.&lt;br /&gt;&lt;br /&gt;One character is equal to one byte. If you wanted to read the first five characters then you would use five as the integer.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'r');&lt;br /&gt;$theData = fread($fh, 5);&lt;br /&gt;fclose($fh);&lt;br /&gt;echo $theData;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Display:&lt;/span&gt;&lt;br /&gt;Flopp&lt;br /&gt;&lt;br /&gt;The first five characters from the testFile.txt file are now stored inside $theData. You could echo this string, $theData, or write it to another file.&lt;br /&gt;&lt;br /&gt;If you wanted to read all the data from the file, then you need to get the size of the file. The filesize function returns the length of a file, in bytes, which is just what we need! The filesize function requires the name of the file that is to be sized up.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'r');&lt;br /&gt;$theData = fread($fh, filesize($myFile));&lt;br /&gt;fclose($fh);&lt;br /&gt;echo $theData;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Display:&lt;/span&gt;&lt;br /&gt;Floppy Jalopy Pointy Pinto&lt;br /&gt;&lt;br /&gt;Note: It is all on one line because our "testFile.txt" file did not have a&lt;br /&gt;tag to create an HTML line break. Now the entire contents of the testFile.txt file is stored in the string variable $theData.&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Read: gets Function&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;PHP also lets you read a line of data at a time from a file with the gets function. This can or cannot be useful to you, the programmer. If you had separated your data with new lines then you could read in one segment of data at a time with the gets function.&lt;br /&gt;&lt;br /&gt;Lucky for us our "testFile.txt" file is separated by new lines and we can utilize this function.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'r');&lt;br /&gt;$theData = fgets($fh);&lt;br /&gt;fclose($fh);&lt;br /&gt;echo $theData;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;testFile.txt Contents:&lt;/span&gt;&lt;br /&gt;Floppy Jalopy&lt;br /&gt;&lt;br /&gt;The fgets function searches for the first occurrence of "\n" the newline character. If you did not write newline characters to your file as we have done in File Write, then this function might not work the way you expect it to.&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Delete&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You know how to create a file. You know how to open a file in an assortment of different ways. You even know how to read and write data from a file!&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - Unlink Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remember from the PHP File Create lesson that we created a file named testFile.txt.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'w') or die("can't open file");&lt;br /&gt;fclose($fh);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Now to delete testFile.txt we simply run a PHP script that is located in the same directory. Unlink just needs to know the name of the file to start working its destructive magic.&lt;br /&gt;PHP Code:&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;unlink($myFile);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The testFile.txt should now be removed.&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP - File Append&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;So far we have learned how to open, close, read, and write to a file. However, the ways in which we have written to a file so far have caused the data that was stored in the file to be deleted. If you want to append to a file, that is, add on to the existing data, then you need to open the file in append mode.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP - File Write: Appending Data&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Using the testFile.txt file we created in the File Write lesson , we are going to append on some more data.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'a') or die("can't open file");&lt;br /&gt;$stringData = "New Stuff 1\n";&lt;br /&gt;fwrite($fh, $stringData);&lt;br /&gt;$stringData = "New Stuff 2\n";&lt;br /&gt;fwrite($fh, $stringData);&lt;br /&gt;fclose($fh);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You should noticed that the way we write data to the file is exactly the same as in the Write lesson. The only thing that is different is that the file pointer is placed at the end of the file in append mode, so all data is added to the end of the file.&lt;br /&gt;&lt;br /&gt;The contents of the file testFile.txt would now look like this:&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Contents of the testFile.txt File:&lt;/span&gt;&lt;br /&gt;Floppy Jalopy&lt;br /&gt;Pointy Pinto&lt;br /&gt;New Stuff 1&lt;br /&gt;New Stuff 2&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP - File Truncate&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As we have mentioned before, when you open a file for writing with the paramater 'w' it completely wipes all data from that file. This action is also referred to as "truncating" a file. Truncate literally means to shorten.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Open: Truncate&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To erase all the data from our testFile.txt file we need to open the file for normal writing. All existing data within testFile.txt will be lost.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$myFile = "testFile.txt";&lt;br /&gt;$fh = fopen($myFile, 'w');&lt;br /&gt;fclose($fh);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP - File Upload&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A very useful aspect of PHP is its ability to manage file uploads to your server. Allowing users to upload a file to your server opens a whole can of worms, so please be careful when enabling file uploads.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Upload: HTML Form&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Before you can use PHP to manage your uploads, you must first build an HTML form that lets users select a file to upload. See our HTML Form lesson for a more in-depth look at forms.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;HTML Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;&amp;lt;form enctype="multipart/form-data" action="uploader.php" method="POST"&amp;gt;&lt;br /&gt;&amp;lt;input type="hidden" name="MAX_FILE_SIZE" value="100000" /&amp;gt;&lt;br /&gt;Choose a file to upload: &amp;lt;input name="uploadedfile" type="file" /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;input type="submit" value="Upload File" /&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Here is a brief description of the important parts of the above code:&lt;br /&gt;&lt;br /&gt;  * enctype="multipart/form-data" - Necessary for our to-be-created PHP file to function properly.&lt;br /&gt;  * action="uploader.php" - The name of our PHP page that will be created, shortly.&lt;br /&gt;  * method="POST" - Informs the browser that we want to send information to the server using POST.&lt;br /&gt;  * input type="hidden" name="MA... - Sets the maximum allowable file size, in bytes, that can be uploaded. This safety mechanism is easily bypassed and we will show a solid backup solution in PHP. We have set the max file size to 100KB in this example.&lt;br /&gt;  * input name="uploadedfile" - uploadedfile is how we will access the file in our PHP script.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP - File Upload: uploader.php&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;When the uploader.php file is executed, the uploaded file exists in a temporary storage area on the server. If the file is not moved to a different location it will be destroyed! To save our precious file we are going to need to make use of the $_FILES associative array.&lt;br /&gt;&lt;br /&gt;The $_FILES array is where PHP stores all the information about files. There are two elements of this array that we will need to understand for this example.&lt;br /&gt;&lt;br /&gt;  * uploadedfile - uploadedfile is the reference we assigned in our HTML form. We will need this to tell the $_FILES array which file we want to play around with.&lt;br /&gt;  * $_FILES['uploadedfile']['name'] - name contains the original path of the user uploaded file.&lt;br /&gt;  * $_FILES['uploadedfile']['tmp_name'] - tmp_name contains the path to the temporary file that resides on the server. The file should exist on the server in a temporary directory with a temporary name.&lt;br /&gt;&lt;br /&gt;Now we can finally start to write a basic PHP upload manager script! Here is how we would get the temporary file name, choose a permanent name, and choose a place to store the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;// Where the file is going to be placed&lt;br /&gt;$target_path = "uploads/";&lt;br /&gt;&lt;br /&gt;/* Add the original filename to our target path.&lt;br /&gt;Result is "uploads/filename.extension" */&lt;br /&gt;$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);&lt;br /&gt;$_FILES['uploadedfile']['tmp_name'];&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;NOTE: You will need to create a new directory in the directory where uploader.php resides, called "uploads", as we are going to be saving files there.&lt;br /&gt;&lt;br /&gt;We now have all we need to successfully save our file to the server. $target_path contains the path where we want to save our file to.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;PHP - File Upload: move_uploaded_file Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Now all we have to do is call the move_uploaded_file function and let PHP do its magic. The move_uploaded_file function needs to know 1) The path of the temporary file (check!) 2) The path where it is to be moved to (check!).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;PHP Code:&lt;/span&gt;&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;$target_path = "uploads/";&lt;br /&gt;&lt;br /&gt;$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);&lt;br /&gt;&lt;br /&gt;if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {&lt;br /&gt;  echo "The file ".  basename( $_FILES['uploadedfile']['name']).&lt;br /&gt;  " has been uploaded";&lt;br /&gt;} else{&lt;br /&gt;  echo "There was an error uploading the file, please try again!";&lt;br /&gt;}&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;If the upload is successful, then you will see the text "The file filename has been uploaded". This is because $move_uploaded_file returns true if the file was moved, and false if it had a problem.&lt;br /&gt;&lt;br /&gt;If there was a problem then the error message "There was an error uploading the file, please try again!" would be displayed.&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP: Export Database Schema as XML&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sometimes it can be useful to have a dump of the current database schema. The script below reads the schema from a MySQL database and outputs XML that describes the schema.&lt;br /&gt;&lt;br /&gt;At first we connect to a MySQL database and use the SHOW TABLES command to return all the tables in the database. Next, we iterate over each table and return the fields for each table using the SHOW FIELDS command. Finally, we put all of the returned information into XML.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Have a look at the code:&lt;/span&gt;&lt;br /&gt;&lt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;// database constants&lt;br /&gt;// make sure the information is correct&lt;br /&gt;define("DB_SERVER", "localhost");&lt;br /&gt;define("DB_USER", "root");&lt;br /&gt;define("DB_PASS", "password");&lt;br /&gt;define("DB_NAME", "tutorials");&lt;br /&gt;&lt;br /&gt;// connection to the database&lt;br /&gt;$dbhandle = mysql_connect(DB_SERVER, DB_USER, DB_PASS)&lt;br /&gt; or die("Unable to connect to MySQL");&lt;br /&gt;&lt;br /&gt;// select a database to work with&lt;br /&gt;$selected = mysql_select_db(DB_NAME, $dbhandle)&lt;br /&gt; or die("Could not select examples");&lt;br /&gt;&lt;br /&gt;// return all available tables&lt;br /&gt;$result_tbl = mysql_query( "SHOW TABLES FROM ".DB_NAME, $dbhandle );&lt;br /&gt;&lt;br /&gt;$tables = array();&lt;br /&gt;while ($row = mysql_fetch_row($result_tbl)) {&lt;br /&gt; $tables[] = $row[0];&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$output = "&amp;lt;?xml version="1.0" ?&amp;gt;n";&lt;br /&gt;$output .= "&amp;lt;schema&amp;gt;";&lt;br /&gt;&lt;br /&gt;// iterate over each table and return the fields for each table&lt;br /&gt;foreach ( $tables as $table ) {&lt;br /&gt; $output .= "&amp;lt;table name="$table"&amp;gt;";&lt;br /&gt; $result_fld = mysql_query( "SHOW FIELDS FROM ".$table, $dbhandle );&lt;br /&gt;&lt;br /&gt; while( $row1 = mysql_fetch_row($result_fld) ) {&lt;br /&gt;    $output .= "&amp;lt;field name="$row1[0]" type="$row1[1]"";&lt;br /&gt;    $output .= ($row1[3] == "PRI") ? " primary_key="yes" /&amp;gt;" : " /&amp;gt;";&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; $output .= "&amp;lt;/table&amp;gt;";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;$output .= "&amp;lt;/schema&amp;gt;";&lt;br /&gt;&lt;br /&gt;// tell the browser what kind of file is come in&lt;br /&gt;header("Content-type: text/xml");&lt;br /&gt;// print out XML that describes the schema&lt;br /&gt;echo $output;&lt;br /&gt;&lt;br /&gt;// close the connection&lt;br /&gt;mysql_close($dbhandle);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;You should note that this code is specific to MySQL database. The commands such as SHOW TABLES and SHOW FIELDS are also available for other databases but are specified slightly differently.&lt;br /&gt;____________________________________________________________________&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Google Page Rank Script - PHP&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;The following script allows you to retrieve the google page position for your site for a given search phrase. The script performs the search, and automatically pages through the results until it finds your domain.&lt;br /&gt;&lt;br /&gt;A few things to note about this script:&lt;br /&gt;&lt;br /&gt;The URLs are extracted by searching for a specific font tag combination which Google currently uses to display the URL name on the search results page. This tag may change in future.&lt;br /&gt;&lt;br /&gt;The script current asks for the results in batches of 10 hits per page. You can easily modify it to ask for more - ie 100, which will speed the whole process up. However, you will get different rankings. The more hits you ask for per page, the more Google will "expand" internal domain results or display similar results within the same site, thus dropping your site down the virtual rankings.&lt;br /&gt;&lt;br /&gt;The script also counts two ranking types - the physical position of your site in the search results, plus the "site" position. The "site" position is how your site is ranked once the internal domain results / similar results are removed ( remember, a single site can postential occupy two result spaces ).&lt;br /&gt;&lt;div style="border: medium double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;php code:&lt;/span&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;// $searchquery is the value to search for.&lt;br /&gt;// The script replaces the spaces and ampersands and&lt;br /&gt;// converts them to values that google is expecting.&lt;br /&gt;&lt;br /&gt;// $searchurl is the url to find - ie www.web-max.ca&lt;br /&gt;// Do not pass http:// - you don't need it.&lt;br /&gt;&lt;br /&gt;// $searchquery = "ontario inns";&lt;br /&gt;// $searchurl = "www.selectontarioinns.com";&lt;br /&gt;&lt;br /&gt;if(!empty($searchquery) &amp;amp;&amp;amp; !empty($searchurl))&lt;br /&gt;{&lt;br /&gt;  $query = str_replace(" ","+",$searchquery); &lt;br /&gt;  $query = str_replace("%26","&amp;amp;",$query); &lt;br /&gt;&lt;br /&gt;// How many results to search through.&lt;br /&gt;  $total_to_search = 100;&lt;br /&gt;&lt;br /&gt;// The number of hits per page. &lt;br /&gt;  $hits_per_page   = 10;&lt;br /&gt;&lt;br /&gt;// Obviously, the total pages / queries we will be doing is&lt;br /&gt;// $total_to_search / $hits_per_page&lt;br /&gt;&lt;br /&gt;// This will be our rank&lt;br /&gt;   $position      = 0;&lt;br /&gt;&lt;br /&gt;// This is the rank minus the duplicates&lt;br /&gt;   $real_position = 0;&lt;br /&gt;  $found   = NULL;&lt;br /&gt;  $lastURL = NULL;&lt;br /&gt;&lt;br /&gt;  for($i=0;$i&amp;lt;$total_to_search &amp;amp;&amp;amp; empty($found);$i+=$hits_per_page)&lt;br /&gt;  {&lt;br /&gt;// Open the search page.&lt;br /&gt;// We are filling in certain variables -&lt;br /&gt;// $query,$hits_per_page and $start.&lt;br /&gt;&lt;br /&gt;      $filename = "http://www.google.com/search?as_q=$query".&lt;br /&gt;                "&amp;amp;num=$hits_per_page&amp;amp;hl=en&amp;amp;ie=UTF-8&amp;amp;btnG=Google+Search".&lt;br /&gt;                  "&amp;amp;as_epq=&amp;amp;as_oq=&amp;amp;as_eq=&amp;amp;lr=&amp;amp;as_ft=i&amp;amp;as_filetype=".&lt;br /&gt;                  "&amp;amp;as_qdr=all&amp;amp;as_nlo=&amp;amp;as_nhi=&amp;amp;as_occt=any&amp;amp;as_dt=i".&lt;br /&gt;                  "&amp;amp;as_sitesearch=&amp;amp;safe=images&amp;amp;start=$i";&lt;br /&gt;&lt;br /&gt;      $file = fopen($filename, "r");&lt;br /&gt;      if (!$file)&lt;br /&gt;      {&lt;br /&gt;          echo "&amp;lt;p&amp;gt;Unable to open remote file $filename.n";&lt;br /&gt;      }&lt;br /&gt;      else&lt;br /&gt;      {&lt;br /&gt;&lt;br /&gt;// Now load the file into a variable line at a time&lt;br /&gt;          while (!feof($file))&lt;br /&gt;          {&lt;br /&gt;              $var = fgets($file, 1024);&lt;br /&gt;// Try and find the font tag google uses to show the site URL&lt;br /&gt;              if(eregi("&amp;lt;font color=#008000&amp;gt;(.*)&amp;lt;/font&amp;gt;&amp;lt;nobr&amp;gt;",$var,$out))&lt;br /&gt;              {&lt;br /&gt;// If we find it take out any &amp;lt;B&amp;gt; &amp;lt;/B&amp;gt; tags - google does&lt;br /&gt;// highlight search terms within URLS&lt;br /&gt;                  $out[1] = strtolower(strip_tags($out[1]));&lt;br /&gt;// Get the domain name by looking for the first /&lt;br /&gt;                  $x = strpos($out[1],"/");&lt;br /&gt;// and get the URL&lt;br /&gt;                  $url = substr($out[1],0,$x);&lt;br /&gt;                  $position++;&lt;br /&gt;// If you want to see the hits, set $trace to something&lt;br /&gt;                  if($trace)print($url."&amp;lt;br&amp;gt;");&lt;br /&gt;// If the last result process is the same as this one, it&lt;br /&gt;// is a nest or internal domain result, so don't count it&lt;br /&gt;// on $real_position&lt;br /&gt;                  if(strcmp($lastURL,$url)&amp;lt;&amp;gt;0)$real_position++;&lt;br /&gt;                  $lastURL = $url;&lt;br /&gt;// Else if the sites match we have found it!!!&lt;br /&gt;                  if(strcmp($searchurl,$url)==0)&lt;br /&gt;                  {&lt;br /&gt;                      $found = $position;&lt;br /&gt;          &lt;br /&gt;// We quit out, we don't need to go any further.&lt;br /&gt;             &lt;br /&gt;                      break;&lt;br /&gt;                  } &lt;br /&gt;              }&lt;br /&gt;          }&lt;br /&gt;      }&lt;br /&gt;      fclose($file); &lt;br /&gt;  }&lt;br /&gt;  if($found)&lt;br /&gt;  {&lt;br /&gt;      print("The URL $searchurl is at position $found ".&lt;br /&gt;            "( $real_position ) for the term $searchquery");&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span class="a"&gt;Reference : &lt;a href="http://www.blogger.com/www.tizag.com/phpT/examples"&gt;www.tizag.com/&lt;b&gt;php&lt;/b&gt;T/&lt;b&gt;examples&lt;/b&gt;&lt;/a&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-7032173640394138330?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Qbt4pN2i1mClZCSJEzGv2bzOUAw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Qbt4pN2i1mClZCSJEzGv2bzOUAw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Qbt4pN2i1mClZCSJEzGv2bzOUAw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Qbt4pN2i1mClZCSJEzGv2bzOUAw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Y2pdZlUW"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=f1twBC5u"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=xPNc3NUA"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=xPNc3NUA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=VbuKCmSc"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=llssqdFh"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=llssqdFh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=FlM3IJlZ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=AKbu9n8z"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=AKbu9n8z" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=ddrU3AgF"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=tvBGo6pI"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=tvBGo6pI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=jB1nH1Ne"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/vYLf9SjQR3k" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/vYLf9SjQR3k/php-examples.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/07/php-examples.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-5295368090263610532</guid><pubDate>Tue, 01 Jul 2008 03:54:00 +0000</pubDate><atom:updated>2008-06-30T22:17:10.398-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Microsoft</category><title>Microsoft</title><description>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmrB8u9mII/AAAAAAAAAz0/cH2bHXT4r-g/s1600-h/bill-gates-classic.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmrB8u9mII/AAAAAAAAAz0/cH2bHXT4r-g/s320/bill-gates-classic.jpg" alt="" id="BLOGGER_PHOTO_ID_5217889693256751234" border="0" /&gt;&lt;/a&gt; Damn, Bill, you have come a LONG way. Look at you there back in '82, you handsome devil. As part of &lt;a href="http://www.engadget.com/tag/billgatesday/"&gt;our tribute&lt;/a&gt;, let's take a quick look back at the top ten greatest (and not so great) products created on Bill-time, shall we? Don't worry, it'll only sting a little.&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;HITS&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmrCLUuKvI/AAAAAAAAAz8/QGzRHQXlQ6U/s1600-h/msie-icon.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmrCLUuKvI/AAAAAAAAAz8/QGzRHQXlQ6U/s320/msie-icon.jpg" alt="" id="BLOGGER_PHOTO_ID_5217889697173220082" border="0" /&gt;&lt;/a&gt;                                                                                            &lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                                                                                                                                                                                               Internet Explorer (IE)&lt;/strong&gt;&lt;br /&gt;                                                                Introduced 1995&lt;br /&gt;&lt;br /&gt;It's really easy to simply remember "Internet Exploder" as the standards-breaking, web-forking, buggy, monopoly-causing app that helped shape Bill's old image as the evilest baron of all technology companies. But it's also the app that led to the creation Ajax-based web apps through the XMLHttpRequest spec, and the kludgey early popularization of CSS. Love it or hate it, IE's gotten more people on the web over the years than any browser, and that's definitely got to count for something.&lt;br /&gt;&lt;br /&gt;&lt;div style="text-align: center;"&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmrCEXAgvI/AAAAAAAAA0E/34kGtkJlkJM/s1600-h/vista-media-center.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmrCEXAgvI/AAAAAAAAA0E/34kGtkJlkJM/s320/vista-media-center.jpg" alt="" id="BLOGGER_PHOTO_ID_5217889695303762674" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;&lt;/strong&gt;&lt;br /&gt;&lt;/div&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;Media Center&lt;/strong&gt;&lt;br /&gt;        Introduced 2002&lt;br /&gt;Despite TiVo's DVR dominance and competitors that came and went over the years, Media Center has always been an underrated standout product. Even &lt;a href="http://feeds.engadget.com/%7Er/weblogsinc/engadget/%7E3/319910831/"&gt;Bill admits that the company's long struggled with usability&lt;/a&gt;, but Media Center is a beacon of hope not only for 10-foot UIs everywhere, but also for the company's ability to create powerful, advanced, user-friendy products. Between its online integration, extensible plugin architecture, ability to stream shows to nodes around the house, and now &lt;a href="http://www.engadget.com/2007/05/22/get-your-vista-cablecard-coverage/"&gt;CableCARD support&lt;/a&gt;, the only real downside to Media Center is the fact that you still need a full-blown PC to run it.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmrCS-TpRI/AAAAAAAAA0M/7__3j90oh-4/s1600-h/ms-dos-icon.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmrCS-TpRI/AAAAAAAAA0M/7__3j90oh-4/s320/ms-dos-icon.jpg" alt="" id="BLOGGER_PHOTO_ID_5217889699226690834" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                                                                                                                                                                                    MS-DOS&lt;/strong&gt;&lt;br /&gt;                                                     Introduced 1981, discontinued 2000&lt;br /&gt;It was arcane and nigh-unusable to mere mortals -- but the early cash-cow was one of Bill's most strategic moves, and helped Microsoft define the concept of software licensing. It also helped launched Mossberg's career as crusader of user-friendly technology. But most importantly, MS-DOS was still the OS an entire generation grew up learning, so &lt;em&gt;del crticsm.*&lt;/em&gt; for a second because our autoexec.bat and config.sys were so very well crafted, and extensively tweaking Memmaker for a few extra KB of usable RAM definitely ranks amongst our top most formative geek moments.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmrCWBFjpI/AAAAAAAAA0U/17AiSX4r7LE/s1600-h/microsoft-office-2007.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmrCWBFjpI/AAAAAAAAA0U/17AiSX4r7LE/s320/microsoft-office-2007.jpg" alt="" id="BLOGGER_PHOTO_ID_5217889700043656850" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                                                                                Office&lt;/strong&gt;&lt;br /&gt;                                   Introduced 1989 (on Mac), 1990 (on PC)&lt;br /&gt;Word, Excel and PowerPoint certainly did well enough on their own, but when Microsoft combined 'em into the tidy (and pricey) package that is Office -- first on the Mac in 1989, interestingly -- it had a selling point that would prove irresistible to many a productivity-obsessed middle manager even today. The addition of Outlook and its support for the (for some) nigh-indispensable Exchange only further solidified its foothold in the corporate computing world, and that's where Bill knew the real money was. That's certainly not to say that it hasn't been without its share of problems and annoyances, though -- we're looking at you, Clippy.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmveb5VxYI/AAAAAAAAA0c/IuFLxv-eknM/s1600-h/6-27-08-intellimouse.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmveb5VxYI/AAAAAAAAA0c/IuFLxv-eknM/s320/6-27-08-intellimouse.jpg" alt="" id="BLOGGER_PHOTO_ID_5217894580704626050" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;                                                                                                                                            Peripherals&lt;/span&gt;&lt;br /&gt;                                                                  Introduced 1982&lt;br /&gt;Microsoft has always been a software company first, but it's been cranking out high-quality peripherals for over 25 years -- long before the Xbox and Zune were even a twinkle in Bill's eye. Not only that, but it's been a reliable innovator in the field, with a string of devices that were first, early, or just simply popularized technologies like the wheel mouse, force-feedback joysticks and controllers, the modern optical mouse, and the ergo-keyboard. The division has gone through some bumpy times -- the &lt;a href="http://www.engadget.com/tag/SideWinder/"&gt;SideWinder&lt;/a&gt; line was killed off for a while there, and there've been some &lt;a href="http://www.engadget.com/2004/08/31/first-look-at-the-philippe-starck-designed-microsoft-optical/"&gt;questionable designs&lt;/a&gt; along the way -- but it's been riding high as of late, and it doesn't show any signs of slowing down soon.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmvfxm72mI/AAAAAAAAA0k/kXqPb7TfR0k/s1600-h/win-3-1-startup.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGmvfxm72mI/AAAAAAAAA0k/kXqPb7TfR0k/s320/win-3-1-startup.jpg" alt="" id="BLOGGER_PHOTO_ID_5217894603712879202" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                                                                        Windows 3.1 / NT 3.5&lt;/strong&gt;&lt;br /&gt;                                                         Introduced 1992 and 1994&lt;br /&gt;It took a few versions to come into its own, but by the time Windows hit 3.1, Microsoft finally had a product that was able to pull PC users away from the command line (for some of the time, at least) and give them a real taste of things to come. Windows NT may not have had quite the same appeal with the average consumer, but it did bring the operating system into the 32-bit world and pave the way for enterprise desktop computing as we know it today. (Plus, it had the NT file system (NTFS), which to this day continues to carry on the legacy in its own little way.) We really wish they'd made a sequel to the Pirates of Silicon Valley, because we'd love to have seen the dramatization of Bill overseeing the first popularized verions of Windows -- especially '95, which came out just a couple of years later.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGmvhPGRYmI/AAAAAAAAA0s/gzH1pEdub6g/s1600-h/6-26-08-windows-xp-pro-box.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGmvhPGRYmI/AAAAAAAAA0s/gzH1pEdub6g/s320/6-26-08-windows-xp-pro-box.jpg" alt="" id="BLOGGER_PHOTO_ID_5217894628808811106" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                                                                            Windows 2000 and XP&lt;/strong&gt;&lt;br /&gt;                                                               Introduced 2000&lt;br /&gt;When thinking of Microsoft and the new millennium, few people are able to keep the crinkles out of their nose. Thankfully, Windows ME wasn't the only thing that arrived in late Y2K, as Windows 2000 rushed in to rock the socks off of suits everywhere. The whole Win2K thing went over so well that Gates and company decided to base its &lt;a href="http://www.engadget.com/2007/02/22/the-quest-for-autumn-windows-xps-elusive-backdrop/"&gt;next consumer OS&lt;/a&gt;, XP, off of it. Some may &lt;a href="http://www.engadget.com/2007/09/21/microsoft-giving-vista-business-ultimate-users-downgrade-to/"&gt;argue&lt;/a&gt; that the &lt;a href="http://www.engadget.com/tag/windows+xp/"&gt;resulting product&lt;/a&gt; still stands as the last great OS to ship out of Redmond.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGm0ehndDpI/AAAAAAAAA08/UKYr_e_P-JA/s1600-h/winmob6homescreen.gif"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGm0ehndDpI/AAAAAAAAA08/UKYr_e_P-JA/s320/winmob6homescreen.gif" alt="" id="BLOGGER_PHOTO_ID_5217900079798357650" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;                                                                                                                    Windows CE / Mobile&lt;/span&gt;&lt;br /&gt;                                                                   Introduced 1996&lt;br /&gt;As two of the most ubiquitous projects to come out from under Bill's command, both Windows CE and Windows Mobile are almost impossible to avoid when it comes to handhelds or phones. What began as a mishmash of small components has grown into the adaptable -- though sometimes maddening -- mobile OS that resides on just about every kind of device you can think of. Really, we mean every kind of device, from &lt;a href="http://www.engadget.com/2007/08/09/newmans-janky-windows-ce-pmp-does-it-all/"&gt;PMPs&lt;/a&gt; to enterprise-level &lt;a href="http://www.engadget.com/2007/10/02/latest-motorola-mc70-blessed-with-gps/"&gt;stock-keeping systems&lt;/a&gt;. The slimmed down and restructured micro-Windows is at the very least one of the more flexible offerings the company has ever produced. Say what you will about its usability, there's no denying the massive impact it's had on portability and convergence.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm1VTrJslI/AAAAAAAAA1E/5DmXREpesIA/s1600-h/xbox-360-med.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm1VTrJslI/AAAAAAAAA1E/5DmXREpesIA/s320/xbox-360-med.jpg" alt="" id="BLOGGER_PHOTO_ID_5217901020948574802" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                            Xbox and Xbox 360&lt;/strong&gt;&lt;br /&gt;                                                   Introduced 2001 and 2005&lt;br /&gt;Back in 1999, Bill was all about multimedia convergence, and he said that a new gaming / multimedia device would be Microsoft's trojan horse into the world's living rooms with something coined the "DirectX-box." In 2001, the original Xbox entered gaming territory dominated by Sony's PlayStation with Nintendo's N64. But the clunky machine brought with it the first easy to use multiplayer console service, Xbox Live, as well as a developer-centric model that helped turn the tables. Of course, things look quite a bit different today: the Xbox 360 leads the former market leader's PlayStation 3 in spend and attach rate, and with the relative success of media and content sales on Xbox Live, it seems Bill's dream of dominating the living room wasn't just a pipe-dream after all.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGm1VXa2dLI/AAAAAAAAA1M/ZVILnfAyeWc/s1600-h/vb-dos-1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGm1VXa2dLI/AAAAAAAAA1M/ZVILnfAyeWc/s320/vb-dos-1.jpg" alt="" id="BLOGGER_PHOTO_ID_5217901021953946802" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                        Visual Basic&lt;/strong&gt;&lt;br /&gt;                                                   Introduced 1991, discontinued 1998&lt;br /&gt;It's hard to underestimate the impact of Visual Basic. While the average user might have never heard of the original VB that Microsoft released way back when, the simplicity of the language and its graphical toolset made just about any power user a potential app developer, powering the flood of third party application development Microsoft operating systems enjoyed throughout the 90's. Sadly, Visual Basic met its demise at the hands of more modern languages and toolsets, but with a legacy of making programming accessible to the masses, its place in the history books and in Bill's pocketbook is undoubtedly secure.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Runners-up:&lt;/strong&gt; DirectX, Flight Sim, Portable Media Center, Solitaire and Minesweeper&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;MISSIES&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm2aB6twDI/AAAAAAAAA1s/5s2gGdC3HsI/s1600-h/wincefig03.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm2aB6twDI/AAAAAAAAA1s/5s2gGdC3HsI/s320/wincefig03.jpg" alt="" id="BLOGGER_PHOTO_ID_5217902201592987698" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                        Auto PC&lt;/strong&gt;&lt;br /&gt;                                               Introduced 1998, discontinued 2001*&lt;br /&gt;Riding high on its previously-introduced sister products -- the Handheld PC and Palm PC platforms, now dead and transformed into Windows Mobile, respectively -- Microsoft's Auto PC initiative was promised to herald a revolution for in-car entertainment and productivity. There's no question it was well ahead of its time; in fact, many of the features debuted in Auto PC have gone on to become standard fare in today's cars. Problem was, when it launched your ride was already pimped with a mere CD player. In-car navigation, voice recognition, and MP3 support were still the stuff of science fiction in those dark days (particularly at the four-digit asking price), and the whole thing was doomed to a geeky, spendy niche. Though products were initially expected from several manufacturers, Clarion ended up being the only one to actually produce a head unit.&lt;br /&gt;&lt;br /&gt;*The Auto PC lived on in spirit as Clarion's Joyride, but Microsoft's heart was no longer in the project and Clarion had switched to a generic Windows CE-based core to build the product.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm2adyogYI/AAAAAAAAA10/NTzAWWslRug/s1600-h/ms_bob.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm2adyogYI/AAAAAAAAA10/NTzAWWslRug/s320/ms_bob.jpg" alt="" id="BLOGGER_PHOTO_ID_5217902209075282306" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                    Microsoft Bob&lt;/strong&gt;&lt;br /&gt;                                                   Introduced 1995, discontinued 1996&lt;br /&gt;Poor Bob. No one ever gave him a chance. Maybe it had to do with the fact that he was really annoying. And as it turns out, Bill was dating Melinda French, Bob's program manager. Which isn't to say there was any nepotism involved -- Bob suffered an early death in 1996 due to general hatred for the little bastard. Bill offered this to a column in January, 1997, "Unfortunately, [Bob] demanded more performance than typical computer hardware could deliver at the time and there wasn't an adequately large market. Bob died." Thankfully, Billinda's blossoming relationship lived on. Oh, did you hear? They're like the world's greatest philanthropists now.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm2afupLzI/AAAAAAAAA18/nyf1Vlt48hk/s1600-h/cairo.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm2afupLzI/AAAAAAAAA18/nyf1Vlt48hk/s320/cairo.jpg" alt="" id="BLOGGER_PHOTO_ID_5217902209595420466" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                                Cairo&lt;/strong&gt;&lt;br /&gt;                                                   Introduced 1991 (but never released)&lt;br /&gt;Ask folks to pick one word to describe Microsoft's technology roadmap in the 1990s and you'll commonly get "Cairo" in response. Announced before Windows NT 3.1 was even released, Cairo was occasionally an operating system, occasionally a collection of new technologies -- it depended entirely upon who and when you asked -- but at its core, it was intended to guide Microsoft on the path beyond the architecture introduced by NT. After throwing countless dollars and man-hours at the ambitious project, Cairo was ultimately canned (though mentions of the storied buzzword continued even into this decade). Although Windows 2000 eventually became NT's heir apparent, the fruits of Microsoft's labor weren't entirely for naught, as various Cairo features found themselves implanted into various versions of Windows throughout the years. Even the WinFS file system can trace its roots back to the project -- fitting, because it too has become such an albatross.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm2aipbDWI/AAAAAAAAA2E/MGqelr8sU4s/s1600-h/urge-logo.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm2aipbDWI/AAAAAAAAA2E/MGqelr8sU4s/s320/urge-logo.jpg" alt="" id="BLOGGER_PHOTO_ID_5217902210378829154" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                            MSN Music and URGE&lt;/strong&gt;&lt;br /&gt;                                   Introduced 2004 and 2006, both fully discontinued 2008&lt;br /&gt;When MSN Music -- Microsoft's effort to build its own PlaysForSure-based subscription music based store -- imploded, headstrong Bill did what he usually does: rebrand, and launch again. When he got up at CES 2006 and announced MSN Music would become &lt;a href="http://www.engadget.com/2006/05/15/mtv-and-microsoft-launch-urge/"&gt;URGE with MTV&lt;/a&gt;, we were all a little skeptical -- after all, the problem wasn't really the service, it was the overbearing DRM and the fact that consumers simply weren't ready for subscription music. Of course, eventually URGE died as well, and MTV shunted customers to &lt;a href="http://www.engadget.com/2007/08/21/mtv-and-real-flesh-out-a-few-rhapsody-america-details/"&gt;Rhapsody America&lt;/a&gt;; naturally, Microsoft had a third &lt;a href="http://www.engadget.com/tag/PlaysForSure/"&gt;PlaysForSure&lt;/a&gt;-based store waiting in the wings with &lt;a href="http://www.engadget.com/tag/Zune/"&gt;Zune&lt;/a&gt;, which doesn't appear to be going anywhere any time soon.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm2bewpOEI/AAAAAAAAA2M/IuQQo5iqUhY/s1600-h/11-14-07-samsung_q1.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm2bewpOEI/AAAAAAAAA2M/IuQQo5iqUhY/s320/11-14-07-samsung_q1.jpg" alt="" id="BLOGGER_PHOTO_ID_5217902226515245122" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                Origami / UMPC&lt;/strong&gt;&lt;br /&gt;                                                               Introduced 2006&lt;br /&gt;UMPCs... what can we say? Sure, &lt;a href="http://www.engadget.com/2006/03/06/scoble-i-have-seen-the-future-and-it-is-origami/"&gt;Scoble liked them&lt;/a&gt;, but even from day one we &lt;a href="http://www.engadget.com/2006/03/08/hands-on-with-the-samsung-q1-origami/"&gt;never saw the market potential&lt;/a&gt;. Fueled by an early and too-successful hype-generating viral campaign of Microsoft's own making, there was no way that these first generation &lt;a href="http://www.engadget.com/2006/02/24/microsofts-origami-project/"&gt;Origami&lt;/a&gt; devices would achieve their promise. Overpriced, underpowered, desk OS-laden (with Microsoft's Touch Pack add-on), and poor battery life would ensure that UMPCs would need quite some time to live up to the wave of "ultramobile lifestyle PC"-hysteria they rode to market. And as UMPCs begin to fade, the shrinking niche between smartphones and laptops now looks toward to the sweet release of MIDs -- though that's already been two years... and counting.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmvhEHc-_I/AAAAAAAAA00/vlkPo21aqdQ/s1600-h/6-27-08-windowsme.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmvhEHc-_I/AAAAAAAAA00/vlkPo21aqdQ/s320/6-27-08-windowsme.jpg" alt="" id="BLOGGER_PHOTO_ID_5217894625860975602" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;                                                                    Windows ME&lt;/span&gt;&lt;br /&gt;                                                       Introduced September 2000&lt;br /&gt;It's not exactly clear what the point of Windows Millennium Edition was -- our guess is that Microsoft needed to keep up with that year-based product naming scheme it had going at the time, and cranked out this half-baked update to '98 in order to capitalize on the turn-of-the-millenium frenzy. Unlike the NT-based Windows 2000 released at the same time, Windows ME retained its MS-DOS-based core, while managing to somehow get even more slow and unstable than its predecessors 95 and 98. And to add insult to injury, it restricted access to shell mode, rendering many MS-DOS apps incompatible. Thankfully, Windows ME was only inflicted upon consumers for little over a year; it was replaced by indomitable Windows XP in 2001&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm30umMJWI/AAAAAAAAA2k/n2BCyd8k9N4/s1600-h/os2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm30umMJWI/AAAAAAAAA2k/n2BCyd8k9N4/s320/os2.jpg" alt="" id="BLOGGER_PHOTO_ID_5217903759774721378" border="0" /&gt;&lt;/a&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;                                                                            OS/2&lt;/span&gt;&lt;br /&gt;                                               Dates: introduced 1987, discontinued 2006&lt;br /&gt;What began as a collaboration between Microsoft and then-partner IBM blossomed into what looked like -- for a time at least -- the logical successor to the DOS / Windows empire. The advanced OS showed early signs of greatness with it's incorporation of the HPFS file system, improved networking capabilities, and a sophisticated UI. But cracks in the relationship between the two powerhouse corporations would ultimately lead to its downfall. With Windows 3 a sudden success, IBM's reluctance to go hardware neutral, and Microsoft's increasing displeasure with code which it called "bloated" (ahem!), the project was eventually swept aside by Gates and the gang to make way for what would become the omnipresent operating system you know and love and/or hate today.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm30wtrM0I/AAAAAAAAA2s/Z2RErvKCCR4/s1600-h/new_spot.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SGm30wtrM0I/AAAAAAAAA2s/Z2RErvKCCR4/s320/new_spot.JPG" alt="" id="BLOGGER_PHOTO_ID_5217903760342987586" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                    SPOT watches and &lt;/strong&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;MSN Direct&lt;/strong&gt;&lt;br /&gt;                                               Introduced 2004, discontinued 2008&lt;br /&gt;When the concept of an information-enabled watch that automagically received content over unused FM radio subcarriers was first conjured up by Microsoft in the early part of the decade, it seemed like a fabulous idea. So much so, in fact, Bill personally took the project under his wing. But by the time it had launched, it was already doomed by a perfect storm of problems: the devices were uglier than sin and comically oversized, the bizarre ad campaign featured frighteningly hairy cartoon arms, and -- as the mobile web was just starting to pick up steam at that time -- virtually anyone who would've been interested in that kind of product had already discovered ways to get the same information from their phone. The underlying data network Microsoft built out to support the watches, MSN Direct, lives on to this day and sees plenty of use in Garmin's nüvi line, but will it ever be used to beam weather, news, and MSFT stock reports to wrists other than Bill's? Not bloody likely.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm3017iweI/AAAAAAAAA20/2cVA9-zh4JM/s1600-h/wga-down.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGm3017iweI/AAAAAAAAA20/2cVA9-zh4JM/s320/wga-down.jpg" alt="" id="BLOGGER_PHOTO_ID_5217903761743331810" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                Windows Activation&lt;/strong&gt;&lt;br /&gt;                                                               Introduced 2001&lt;br /&gt;Depending on who you talk to, Windows Product Activation is a serious privacy violation, a headache, minimal protection against piracy, or all of the above. Lucky for us, Microsoft is finally seeing (some of) the folly of its overbearing ways, and has gone with a more permissive &lt;a href="http://www.engadget.com/2007/12/04/vista-sp1-kills-the-wga-kill-switch/"&gt;nagware method&lt;/a&gt; with Vista SP1. This as opposed to the regular method of routinely locking users out of their systems, which, wouldn't you know it, tended to hurt legitimate users more than pirates. Perhaps the best example of Windows Activation's legacy was the great &lt;a href="http://www.engadget.com/2007/08/28/microsoft-says-wga-outage-affected-less-than-12-000-systems/"&gt;WGA outage of 2007&lt;/a&gt;, which left 12,000 systems out in the cold due to a few downed servers at Microsoft. It didn't take long for the servers to bounce back, but any shred of reputation the service had at that point went out the window with the uptime.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGm31DMDSzI/AAAAAAAAA28/HJMcnSn2KAc/s1600-h/windows-vista-sales.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGm31DMDSzI/AAAAAAAAA28/HJMcnSn2KAc/s320/windows-vista-sales.jpg" alt="" id="BLOGGER_PHOTO_ID_5217903765302233906" border="0" /&gt;&lt;/a&gt;&lt;strong style="color: rgb(153, 153, 0);"&gt;                                                                        Windows Vista&lt;/strong&gt;&lt;br /&gt;                                                                   Introduced 2007&lt;br /&gt;Vista doesn't suck. Let's just get that off our chests. In fact, it's a quite capable, secure and sexy OS when you get right down to it. Unfortunately, its problems just loomed too large for many folks to overlook. A multitude of delays and a rapidly diminishing feature list soured people right out of the gate, and once the dust settled people just weren't happy with the minor improvements they were getting in exchange for their hard-earned monies and fairly mandatory RAM upgrades. Mix that in with the standard driver incompatibilities of any Microsoft OS upgrade, and you've got a whole bunch of disgruntled downgraders on your hands -- and plenty of bad press to fill in any remaining gaps. Sadly, improvements to Media Center, aesthetics and even that quirky little sidebar got overlooked in the process. Microsoft's already scrambling to get Windows 7 together to capture the multitude of users that've decided to skip Vista altogether, let's just hope it's not too late.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Runners-up:&lt;/strong&gt; Actimates, Pocket IE, Games for Windows - Live, Xenix (yeah, Microsoft actually did a Unix at one time!)&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-5295368090263610532?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/l7M5vSlStOjuhpL-nMCAFSMvDqw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l7M5vSlStOjuhpL-nMCAFSMvDqw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/l7M5vSlStOjuhpL-nMCAFSMvDqw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/l7M5vSlStOjuhpL-nMCAFSMvDqw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=LDOYZnMN"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=IbMUSec6"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=i0nD1RAK"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=i0nD1RAK" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=kLUg1Yh0"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=nc2UBPku"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=nc2UBPku" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=bfShKR8M"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=8h0IVeBL"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=8h0IVeBL" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=0SM94OKr"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=BQBNnwqz"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=BQBNnwqz" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=rc0zo1Kl"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/ZYRQv4UDojg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/ZYRQv4UDojg/microsoft.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGmrB8u9mII/AAAAAAAAAz0/cH2bHXT4r-g/s72-c/bill-gates-classic.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/microsoft.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-6406292441544132307</guid><pubDate>Tue, 01 Jul 2008 03:10:00 +0000</pubDate><atom:updated>2008-06-30T20:31:20.089-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Ajax</category><title>Ajax</title><description>&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="color: rgb(153, 153, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;AJAX = Asynchronous JavaScript And XML&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;AJAX is an acronym for Asynchronous JavaScript And XML.&lt;br /&gt;&lt;br /&gt;AJAX is not a new programming language, but simply a new technique for creating better, faster, and more interactive web applications.&lt;br /&gt;&lt;br /&gt;AJAX uses JavaScript to send and receive data between a web browser and a web server.&lt;br /&gt;&lt;br /&gt;The AJAX technique makes web pages more responsive by exchanging data with the web server behind the scenes, instead of reloading an entire web page each time a user makes a change.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;AJAX Is Based On Open Standards&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;AJAX is based on the following open standards:&lt;br /&gt;&lt;br /&gt;    * JavaScript&lt;br /&gt;    * XML&lt;br /&gt;    * HTML&lt;br /&gt;    * CSS&lt;br /&gt;&lt;br /&gt;The open standards used in AJAX are well defined, and supported by all major browsers. AJAX applications are browser and platform independent. (Cross-Platform, Cross-Browser technology)&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);font-size:130%;" &gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;AJAX Is About Better Internet Applications&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Web applications have many benefits over desktop applications:&lt;br /&gt;&lt;br /&gt;    * they can reach a larger audience&lt;br /&gt;    * they are easier to install and support&lt;br /&gt;    * they are easier to develop&lt;br /&gt;&lt;br /&gt;However, Internet applications are not always as “rich” and user-friendly as traditional desktop applications.&lt;br /&gt;&lt;br /&gt;With AJAX, Internet applications can be made richer (smaller, faster, and easier to use).&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;You Can Start Using AJAX Today&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is nothing new to learn.&lt;br /&gt;&lt;br /&gt;AJAX is based on open standards. These standards have been used by most developers for several years.&lt;br /&gt;&lt;br /&gt;Most existing web applications can be rewritten to use AJAX technology instead of traditional HTML forms.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;AJAX Uses XML And HTTP Requests&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A traditional web application will submit input (using an HTML form) to a web server. After the web server has processed the data, it will return a completely new web page to the user.&lt;br /&gt;&lt;br /&gt;Because the server returns a new web page each time the user submits input, traditional web applications often run slowly and tend to be less user friendly.&lt;br /&gt;&lt;br /&gt;With AJAX, web applications can send and retrieve data without reloading the whole web page. This is done by sending HTTP requests to the server (behind the scenes), and by modifying only parts of the web page using JavaScript when the server returns data.&lt;br /&gt;&lt;br /&gt;XML is commonly used as the format for receiving server data, although any format, including plain text, can be used.&lt;br /&gt;&lt;br /&gt;You will learn more about how this is done in the next chapters of this tutorial.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;The XMLHttpRequest&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The XMLHttpRequest object is the key to AJAX.&lt;br /&gt;&lt;br /&gt;It has been available ever since Internet Explorer 5.5 was released in July 2000, but not fully discovered before people started to talk about AJAX and Web 2.0 in 2005.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);font-size:130%;" &gt;&lt;span style="font-weight: bold;"&gt;Creating An XMLHttpRequest Object&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Different browsers use different methods to create an XMLHttpRequest object.&lt;br /&gt;&lt;br /&gt;Internet Explorer uses an ActiveXObject.&lt;br /&gt;&lt;br /&gt;Other browsers uses a built in JavaScript object called XMLHttpRequest.&lt;br /&gt;&lt;br /&gt;Here is the simplest code you can use to overcome this problem:&lt;br /&gt;&lt;br /&gt;var XMLHttp=null&lt;br /&gt;if (window.XMLHttpRequest)&lt;br /&gt;  {&lt;br /&gt;  XMLHttp=new XMLHttpRequest()&lt;br /&gt;  }&lt;br /&gt;else if (window.ActiveXObject)&lt;br /&gt;  {&lt;br /&gt;  XMLHttp=new ActiveXObject(”Microsoft.XMLHTTP”)&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;Example above explained:&lt;br /&gt;&lt;br /&gt;   1. First create a variable XMLHttp to use as your XMLHttpRequest object. Set the value to null.&lt;br /&gt;   2. Then test if the object window.XMLHttpRequest is available. This object is available in newer versions of Firefox, Mozilla, Opera, and Safari.&lt;br /&gt;   3. If it’s available, use it to create a new object: XMLHttp=new XMLHttpRequest()&lt;br /&gt;   4. If it’s not available, test if an object window.ActiveXObject is available. This object is available in Internet Explorer version 5.5 and later.&lt;br /&gt;   5. If it is available, use it to create a new object: XMLHttp=new ActiveXObject()&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;A Better Example?&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Some programmers will prefer to use the newest and fastest version of the XMLHttpRequest object.&lt;br /&gt;&lt;br /&gt;The example below tries to load Microsoft’s latest version “Msxml2.XMLHTTP”, available in Internet Explorer 6, before it falls back to “Microsoft.XMLHTTP”, available in Internet Explorer 5.5 and later.&lt;br /&gt;&lt;br /&gt;function GetXmlHttpObject()&lt;br /&gt;{&lt;br /&gt;var xmlHttp=null;&lt;br /&gt;&lt;br /&gt;try&lt;br /&gt; {&lt;br /&gt; // Firefox, Opera 8.0+, Safari&lt;br /&gt; xmlHttp=new XMLHttpRequest();&lt;br /&gt; }&lt;br /&gt;catch (e)&lt;br /&gt; {&lt;br /&gt; // Internet Explorer&lt;br /&gt; try&lt;br /&gt;  {&lt;br /&gt;  xmlHttp=new ActiveXObject(”Msxml2.XMLHTTP”);&lt;br /&gt;  }&lt;br /&gt; catch (e)&lt;br /&gt;  {&lt;br /&gt;  xmlHttp=new ActiveXObject(”Microsoft.XMLHTTP”);&lt;br /&gt;  }&lt;br /&gt; }&lt;br /&gt;return xmlHttp;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;Example above explained:&lt;br /&gt;&lt;br /&gt;   1. First create a variable XMLHttp to use as your XMLHttpRequest object. Set the value to null.&lt;br /&gt;   2. Try to create the object the according to web standards (Mozilla, Opera and Safari):XMLHttp=new XMLHttpRequest()&lt;br /&gt;   3. Try to create the object the Microsoft way, available in Internet Explorer 6 and later:XMLHttp=new ActiveXObject(”Msxml2.XMLHTTP”)&lt;br /&gt;   4. If this catches an error, try the older (Internet Explorer 5.5) way: XMLHttp=new ActiveXObject(”Microsoft.XMLHTTP”)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;PHP and AJAX&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is no such thing as an AJAX server.&lt;br /&gt;&lt;br /&gt;AJAX is a technology that runs in your browser. It uses asynchronous data transfer (HTTP requests) between the browser and the web server, allowing web pages to request small bits of information from the server instead of whole pages.&lt;br /&gt;&lt;br /&gt;AJAX is a web browser technology independent of web server software.&lt;br /&gt;&lt;br /&gt;However, in this tutorial we will focus more on actual examples running on a PHP server, and less on how AJAX works.&lt;br /&gt;AJAX Suggest&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the AJAX example below we will demonstrate how a web page can communicate with a web server online as a user enters data into a web form.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;font-size:130%;" &gt;Type a Name in the Box Below&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;First Name: Suggestions:&lt;br /&gt;&lt;br /&gt;This example consists of three pages:&lt;br /&gt;&lt;br /&gt;    * a simple HTML form&lt;br /&gt;    * a JavaScript&lt;br /&gt;    * a PHP page&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span style="color: rgb(153, 153, 0);"&gt;The HTML Form&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This is the HTML page. It contains a simple HTML form and a link to a JavaScript:&lt;br /&gt;&lt;br /&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;script src=”clienthint.js”&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form&amp;gt;&lt;br /&gt;First Name:&lt;br /&gt;&amp;lt;input type=”text” id=”txt1&amp;amp;#8243;&lt;br /&gt;onkeyup=”showHint(this.value)”&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;Suggestions: &amp;lt;span id=”txtHint”&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;font-size:130%;" &gt;Example Explained - The HTML Form&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;As you can see, the HTML page above contains a simple HTML form with an input field called “txt1″.&lt;br /&gt;&lt;br /&gt;The form works like this:&lt;br /&gt;&lt;br /&gt;   1. An event is triggered when the user presses, and releases a key in the input field&lt;br /&gt;   2. When the event is triggered, a function called showHint() is executed.&lt;br /&gt;   3. Below the form is a called “txtHint”. This is used as a placeholder for the return data of the showHint() function&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span style="color: rgb(153, 153, 0);"&gt;The JavaScript&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The JavaScript code is stored in “clienthint.js” and linked to the HTML document:&lt;br /&gt;&lt;br /&gt;var xmlHttp&lt;br /&gt;&lt;br /&gt;function showHint(str)&lt;br /&gt;{&lt;br /&gt;if (str.length==0)&lt;br /&gt; {&lt;br /&gt; document.getElementById(”txtHint”).innerHTML=”"&lt;br /&gt; return&lt;br /&gt; }&lt;br /&gt;xmlHttp=GetXmlHttpObject()&lt;br /&gt;if (xmlHttp==null)&lt;br /&gt; {&lt;br /&gt; alert (”Browser does not support HTTP Request”)&lt;br /&gt; return&lt;br /&gt; }&lt;br /&gt;var url=”gethint.php”&lt;br /&gt;url=url+”?q=”+str&lt;br /&gt;url=url+”&amp;amp;sid=”+Math.random()&lt;br /&gt;xmlHttp.onreadystatechange=stateChanged&lt;br /&gt;xmlHttp.open(”GET”,url,true)&lt;br /&gt;xmlHttp.send(null)&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function stateChanged()&lt;br /&gt;{&lt;br /&gt;if (xmlHttp.readyState==4 || xmlHttp.readyState==”complete”)&lt;br /&gt;{&lt;br /&gt;document.getElementById(”txtHint”).innerHTML=xmlHttp.responseText&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;function GetXmlHttpObject()&lt;br /&gt;{&lt;br /&gt;var xmlHttp=null;&lt;br /&gt;try&lt;br /&gt;{&lt;br /&gt;// Firefox, Opera 8.0+, Safari&lt;br /&gt;xmlHttp=new XMLHttpRequest();&lt;br /&gt;}&lt;br /&gt;catch (e)&lt;br /&gt;{&lt;br /&gt;// Internet Explorer&lt;br /&gt;try&lt;br /&gt; {&lt;br /&gt; xmlHttp=new ActiveXObject(”Msxml2.XMLHTTP”);&lt;br /&gt; }&lt;br /&gt;catch (e)&lt;br /&gt; {&lt;br /&gt; xmlHttp=new ActiveXObject(”Microsoft.XMLHTTP”);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;return xmlHttp;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;Example Explained&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The &lt;span style="color: rgb(255, 204, 51);"&gt;showHint()&lt;/span&gt; Function&lt;br /&gt;&lt;br /&gt;This function executes every time a character is entered in the input field.&lt;br /&gt;&lt;br /&gt;If there is some input in the text field (str.length &gt; 0) the function executes the following:&lt;br /&gt;&lt;br /&gt;   1. Defines the url (filename) to send to the server&lt;br /&gt;   2. Adds a parameter (q) to the url with the content of the input field&lt;br /&gt;   3. Adds a random number to prevent the server from using a cached file&lt;br /&gt;   4. Calls on the GetXmlHttpObject function to create an XMLHTTP object, and tells the object to execute a function called stateChanged when a change is triggered&lt;br /&gt;   5. Opens the XMLHTTP object with the given url.&lt;br /&gt;   6. Sends an HTTP request to the server&lt;br /&gt;&lt;br /&gt;If the input field is empty, the function simply clears the content of the txtHint placeholder.&lt;br /&gt;&lt;br /&gt;The &lt;span style="color: rgb(255, 204, 51);"&gt;stateChanged()&lt;/span&gt; Function&lt;br /&gt;&lt;br /&gt;This function executes every time the state of the XMLHTTP object changes.&lt;br /&gt;&lt;br /&gt;When the state changes to 4 (or to “complete”), the content of the txtHint placeholder is filled with the response text.&lt;br /&gt;&lt;br /&gt;The &lt;span style="color: rgb(255, 204, 51);"&gt;GetXmlHttpObject() &lt;/span&gt;Function&lt;br /&gt;&lt;br /&gt;AJAX applications can only run in web browsers with complete XML support.&lt;br /&gt;&lt;br /&gt;The code above called a function called GetXmlHttpObject().&lt;br /&gt;&lt;br /&gt;The purpose of the function is to solve the problem of creating different XMLHTTP objects for different browsers.&lt;br /&gt;&lt;br /&gt;This is explained in the previous chapter.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;font-size:130%;" &gt;&lt;span style="color: rgb(153, 153, 0);"&gt;The PHP Page&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The server page called by the JavaScript code is a simple PHP file called “gethint.php”.&lt;br /&gt;&lt;br /&gt;The code in the “gethint.php” checks an array of names and returns the corresponding names to the client:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;?php&lt;br /&gt;// Fill up array with names&lt;br /&gt;$a[]=”Anna”;&lt;br /&gt;$a[]=”Brittany”;&lt;br /&gt;$a[]=”Cinderella”;&lt;br /&gt;$a[]=”Diana”;&lt;br /&gt;$a[]=”Eva”;&lt;br /&gt;$a[]=”Fiona”;&lt;br /&gt;$a[]=”Gunda”;&lt;br /&gt;$a[]=”Hege”;&lt;br /&gt;$a[]=”Inga”;&lt;br /&gt;$a[]=”Johanna”;&lt;br /&gt;$a[]=”Kitty”;&lt;br /&gt;$a[]=”Linda”;&lt;br /&gt;$a[]=”Nina”;&lt;br /&gt;$a[]=”Ophelia”;&lt;br /&gt;$a[]=”Petunia”;&lt;br /&gt;$a[]=”Amanda”;&lt;br /&gt;$a[]=”Raquel”;&lt;br /&gt;$a[]=”Cindy”;&lt;br /&gt;$a[]=”Doris”;&lt;br /&gt;$a[]=”Eve”;&lt;br /&gt;$a[]=”Evita”;&lt;br /&gt;$a[]=”Sunniva”;&lt;br /&gt;$a[]=”Tove”;&lt;br /&gt;$a[]=”Unni”;&lt;br /&gt;$a[]=”Violet”;&lt;br /&gt;$a[]=”Liza”;&lt;br /&gt;$a[]=”Elizabeth”;&lt;br /&gt;$a[]=”Ellen”;&lt;br /&gt;$a[]=”Wenche”;&lt;br /&gt;$a[]=”Vicky”;&lt;br /&gt;&lt;br /&gt;//get the q parameter from URL&lt;br /&gt;$q=$_GET["q"];&lt;br /&gt;&lt;br /&gt;//lookup all hints from array if length of q&amp;gt;0&lt;br /&gt;if (strlen($q) &amp;gt; 0)&lt;br /&gt;{&lt;br /&gt;$hint=”";&lt;br /&gt;for($i=0; $i&amp;lt;count($a); $i++)&lt;br /&gt;{&lt;br /&gt;if (strtolower($q)==strtolower(substr($a[$i],0,strlen($q))))&lt;br /&gt;{&lt;br /&gt;if ($hint==””)&lt;br /&gt;{&lt;br /&gt;$hint=$a[$i];&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;$hint=$hint.” , “.$a[$i];&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//Set output to “no suggestion” if no hint were found&lt;br /&gt;//or to the correct values&lt;br /&gt;if ($hint == “”)&lt;br /&gt;{&lt;br /&gt;$response=”no suggestion”;&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt;$response=$hint;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;//output the response&lt;br /&gt;echo $response;&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;If there is any text sent from the JavaScript (strlen($q) &gt; 0) the following happens:&lt;br /&gt;&lt;br /&gt;   1. Find a name matching the characters sent from the JavaScript&lt;br /&gt;   2. If more than one name is found, include all names in the response string&lt;br /&gt;   3. If no matching names were found, set response to “no suggestion”&lt;br /&gt;   4. If one or more matching names were found, set response to these names&lt;br /&gt;   5. The response is sent to the “txtHint” placeholder&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-6406292441544132307?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/YrXGR_kRM-VYJLxI6_8p83gM9I0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YrXGR_kRM-VYJLxI6_8p83gM9I0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/YrXGR_kRM-VYJLxI6_8p83gM9I0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/YrXGR_kRM-VYJLxI6_8p83gM9I0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=EvHJmksg"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=lWLmMsx2"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=YgwaGBU1"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=YgwaGBU1" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=xV1LiwWI"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=8i2cmxdm"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=8i2cmxdm" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=FMoNGtic"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=fztpWoHA"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=fztpWoHA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=yXVwMYYE"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=B5DcXkzm"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=B5DcXkzm" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=IPJU7y8s"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/RdVcVNxzJTU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/RdVcVNxzJTU/ajax.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/ajax.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-1981831740533171802</guid><pubDate>Thu, 26 Jun 2008 02:29:00 +0000</pubDate><atom:updated>2008-06-25T20:11:01.265-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">HTML 5</category><title>HTML 5</title><description>&lt;h1 style="color: rgb(102, 153, 204);" id="html5-diff"&gt;HTML 5 differences from HTML 4&lt;/h1&gt;&lt;h2  style="color: rgb(153, 153, 0); font-weight: normal;font-family:arial;" class="no-num no-toc" id="abstract"&gt;&lt;span style="font-size:130%;"&gt;Abstract&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;HTML 5 defines the fifth major revision of the core language of the    World Wide Web, HTML. "HTML 5 differences from HTML 4" describes    the differences between HTML 4 and HTML 5 and provides some of    the rationale for the changes. This document may not provide accurate    information as the HTML 5 specification is still actively in    development. When in doubt, always check the HTML 5 specification    itself. [&lt;cite&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#ref-html5"&gt;HTML5&lt;/a&gt;&lt;/cite&gt;]    &lt;/p&gt;&lt;h2 style="color: rgb(153, 153, 0);" class="no-num no-toc" id="sotd"&gt;&lt;span style="font-size:130%;"&gt;Status of this Document&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;&lt;em&gt;This section describes the status of this document at the time of    its publication. Other documents may supersede this document. A list of    current W3C publications and the latest revision of this technical report    can be found in the &lt;a href="http://www.w3.org/TR/"&gt;W3C technical reports    index&lt;/a&gt; at http://www.w3.org/TR/.&lt;/em&gt;    &lt;/p&gt;&lt;p&gt;This is a Working Draft produced by the &lt;a href="http://www.w3.org/html/wg/"&gt;HTML Working Group&lt;/a&gt;, part of the &lt;a href="http://www.w3.org/MarkUp/Activity"&gt;HTML Activity&lt;/a&gt;. The Working    Group intends to publish this document as a &lt;a href="http://www.w3.org/2005/10/Process-20051014/#WGNote"&gt;Working Group    Note&lt;/a&gt; to accompany the &lt;a href="http://www.w3.org/TR/html5/"&gt;HTML 5 specification&lt;/a&gt;. The    appropriate forum for comments is &lt;a href="mailto:public-html-comments@w3.org"&gt;public-html-comments@w3.org&lt;/a&gt;,    a mailing list with a &lt;a href="http://lists.w3.org/Archives/Public/public-html-comments/" title="Archive for HTML comments mailing-list"&gt;public archive&lt;/a&gt;.    &lt;/p&gt;&lt;p&gt;Publication as a Working Draft does not imply endorsement by the W3C    Membership. This is a draft document and may be updated, replaced or    obsoleted by other documents at any time. It is inappropriate to cite this    document as other than work in progress.    &lt;/p&gt;&lt;p&gt;This document was produced by a group operating under the &lt;a href="http://www.w3.org/Consortium/Patent-Policy-20040205/"&gt;5 February    2004 W3C Patent Policy&lt;/a&gt;. W3C maintains a &lt;a href="http://www.w3.org/2004/01/pp-impl/40318/status" rel="disclosure"&gt;public list of any patent disclosures&lt;/a&gt; made in    connection with the deliverables of the group; that page also includes    instructions for disclosing a patent. An individual who has actual    knowledge of a patent which the individual believes contains &lt;a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#def-essential"&gt;Essential    Claim(s)&lt;/a&gt; must disclose the information in accordance with &lt;a href="http://www.w3.org/Consortium/Patent-Policy-20040205/#sec-Disclosure"&gt;section    6 of the W3C Patent Policy&lt;/a&gt;.    &lt;/p&gt;&lt;h2 style="color: rgb(153, 153, 0);" class="no-num no-toc" id="toc"&gt;&lt;span style="font-size:130%;"&gt;Table of Contents&lt;/span&gt;&lt;/h2&gt;   &lt;!--begin-toc--&gt;    &lt;ul class="toc"&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#introduction"&gt;&lt;span class="secno"&gt;1. &lt;/span&gt;Introduction&lt;/a&gt;     &lt;ul class="toc"&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#open-issues"&gt;&lt;span class="secno"&gt;1.1 &lt;/span&gt;Open Issues&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#backwards-compatible"&gt;&lt;span class="secno"&gt;1.2       &lt;/span&gt;Backwards Compatible&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#development-model"&gt;&lt;span class="secno"&gt;1.3       &lt;/span&gt;Development Model&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#webarch"&gt;&lt;span class="secno"&gt;1.4 &lt;/span&gt;Impact on Web       Architecture&lt;/a&gt;     &lt;/li&gt;&lt;/ul&gt;     &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#syntax"&gt;&lt;span class="secno"&gt;2. &lt;/span&gt;Syntax&lt;/a&gt;     &lt;ul class="toc"&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#character-encoding"&gt;&lt;span class="secno"&gt;2.1 &lt;/span&gt;Character       Encoding&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#doctype"&gt;&lt;span class="secno"&gt;2.2 &lt;/span&gt;The &lt;code title=""&gt;DOCTYPE&lt;/code&gt;&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#syntax-misc"&gt;&lt;span class="secno"&gt;2.3       &lt;/span&gt;Miscellaneous&lt;/a&gt;     &lt;/li&gt;&lt;/ul&gt;     &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#language"&gt;&lt;span class="secno"&gt;3. &lt;/span&gt;Language&lt;/a&gt;     &lt;ul class="toc"&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#new-elements"&gt;&lt;span class="secno"&gt;3.1 &lt;/span&gt;New       Elements&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#new-attributes"&gt;&lt;span class="secno"&gt;3.2 &lt;/span&gt;New       Attributes&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#changed-elements"&gt;&lt;span class="secno"&gt;3.3 &lt;/span&gt;Changed       Elements&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#absent-elements"&gt;&lt;span class="secno"&gt;3.4 &lt;/span&gt;Absent       Elements&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#absent-attributes"&gt;&lt;span class="secno"&gt;3.5 &lt;/span&gt;Absent       Attributes&lt;/a&gt;     &lt;/li&gt;&lt;/ul&gt;     &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#apis"&gt;&lt;span class="secno"&gt;4. &lt;/span&gt;APIs&lt;/a&gt;     &lt;ul class="toc"&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#htmldocument-extensions"&gt;&lt;span class="secno"&gt;4.1       &lt;/span&gt;Extensions to &lt;code&gt;HTMLDocument&lt;/code&gt;&lt;/a&gt;       &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#htmlelement-extensions"&gt;&lt;span class="secno"&gt;4.2       &lt;/span&gt;Extensions to &lt;code&gt;HTMLElement&lt;/code&gt;&lt;/a&gt;     &lt;/li&gt;&lt;/ul&gt;     &lt;/li&gt;&lt;li&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#changelog"&gt;&lt;span class="secno"&gt;5. &lt;/span&gt;HTML 5     Changelog&lt;/a&gt;     &lt;/li&gt;&lt;li class="no-num"&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#acknowledgments"&gt;Acknowledgments&lt;/a&gt;     &lt;/li&gt;&lt;li class="no-num"&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#references"&gt;References&lt;/a&gt;   &lt;/li&gt;&lt;/ul&gt;   &lt;!--end-toc--&gt;    &lt;h2 style="color: rgb(153, 153, 0);" id="introduction"&gt;&lt;span class="secno"  style="font-size:130%;"&gt;1. &lt;/span&gt;&lt;span style="font-size:130%;"&gt;Introduction&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;HTML has been in continuous evolution since it was introduced to the    Internet in the early 1990's. Some features were introduced in    specifications; others were introduced in software releases. In some    respects, implementations and author practices have converged with each    other and with specifications and standards, but in other ways, they    continue to diverge.    &lt;/p&gt;&lt;p&gt;HTML 4 became a W3C Recommendation in 1997. While it continues to    serve as a rough guide to many of the core features of HTML, it does not    provide enough information to build implementations that interoperate with    each other and, more importantly, with a critical mass of deployed    content. The same goes for XHTML1, which defines an XML serialization for    HTML 4, and DOM Level 2 HTML, which defines JavaScript APIs for both    HTML and XHTML. [&lt;cite&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#ref-html4"&gt;HTML4&lt;/a&gt;&lt;/cite&gt;] [&lt;cite&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#ref-xhtml1"&gt;XHTML1&lt;/a&gt;&lt;/cite&gt;] [&lt;cite&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#ref-dom2html"&gt;DOM2HTML&lt;/a&gt;&lt;/cite&gt;]    &lt;/p&gt;&lt;p&gt;The HTML 5 draft reflects an effort, started in 2004, to study    contemporary HTML implementations and deployed content. The draft:    &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Defines a single language called HTML 5 which can be written in a     "custom" HTML syntax and in XML syntax.     &lt;/li&gt;&lt;li&gt;Defines detailed processing models to foster interoperable     implementations.     &lt;/li&gt;&lt;li&gt;Improves markup for documents.     &lt;/li&gt;&lt;li&gt;Introduces markup and APIs for emerging idioms, such as Web     applications.   &lt;/li&gt;&lt;li&gt;HTML 4 and HTML 5 structure   left T0 right
&lt;br /&gt;&lt;/li&gt;&lt;li&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGMIKwNCQYI/AAAAAAAAAzc/7oCCGExfFwk/s1600-h/structure-div.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGMIKwNCQYI/AAAAAAAAAzc/7oCCGExfFwk/s320/structure-div.gif" alt="" id="BLOGGER_PHOTO_ID_5216021774256456066" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGMIKyTPc3I/AAAAAAAAAzk/2p4b7tLiftM/s1600-h/structure-html5.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SGMIKyTPc3I/AAAAAAAAAzk/2p4b7tLiftM/s320/structure-html5.gif" alt="" id="BLOGGER_PHOTO_ID_5216021774819357554" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ol&gt;    &lt;h3 style="color: rgb(255, 204, 0);" id="open-issues"&gt;&lt;span class="secno"&gt;1.1 &lt;/span&gt;Open Issues&lt;/h3&gt;    &lt;p&gt;&lt;strong&gt;HTML 5 is still a draft.&lt;/strong&gt; The contents of    HTML 5, as well as the contents of this document which depend on    HTML 5, are still being discussed on the HTML Working Group and    WHATWG mailing lists. Some of the open issues include (this list is    &lt;em&gt;not&lt;/em&gt; exhaustive):    &lt;/p&gt;&lt;ul&gt;&lt;li&gt;De facto semantic definitions for some formerly presentational     elements.     &lt;/li&gt;&lt;li&gt;Details of accessibility and media-independence features, such as the     &lt;code&gt;longdesc&lt;/code&gt;, &lt;code&gt;alt&lt;/code&gt; and &lt;code&gt;summary&lt;/code&gt;     attributes.     &lt;/li&gt;&lt;li&gt;The repetition model.   &lt;/li&gt;&lt;/ul&gt;    &lt;h3 style="color: rgb(255, 204, 51);" id="backwards-compatible"&gt;&lt;span class="secno"&gt;1.2 &lt;/span&gt;Backwards    Compatible&lt;/h3&gt;    &lt;p&gt;HTML 5 is defined in a way that it is backwards compatible with the    way user agents handle deployed content. To keep the authoring language    relatively simple for authors several elements and attributes are not    included as outlined in the other sections of this document, such as    presentational elements that are better dealt with using CSS.    &lt;/p&gt;&lt;p&gt;User agents, however, will always have to support these older elements    and this is why the specification clearly separates requirements for    authors and user agents. This means that authors can not use the    &lt;code&gt;isindex&lt;/code&gt; or &lt;code&gt;plaintext&lt;/code&gt; element, but user agents    are required to support them in a way that is compatible with how these    elements behaved previously.    &lt;/p&gt;&lt;p&gt;Since HTML 5 has separate conformance requirements for authors and    user agents there is no longer a need for marking things "deprecated".    &lt;/p&gt;&lt;h3 style="color: rgb(255, 204, 51);" id="development-model"&gt;&lt;span class="secno"&gt;1.3 &lt;/span&gt;Development Model&lt;/h3&gt;    &lt;p&gt;The HTML 5 specification will not be considered finished before    there are at least two complete implementations of the specification. This    is a different approach than previous versions of HTML had. The goal is to    ensure that the specification is implementable and usable by designers and    developers once it is finished.&lt;/p&gt;   &lt;!-- The following &lt;div&gt; is here for Michael(tm) Smith who owes the     editor one beer in exchange. --&gt;    &lt;div&gt;    &lt;h3 style="color: rgb(255, 204, 51);" id="webarch"&gt;&lt;span class="secno"&gt;1.4 &lt;/span&gt;Impact on Web Architecture&lt;/h3&gt;    &lt;!-- http://lists.w3.org/Archives/Public/www-tag/2008May/0087.html --&gt;    &lt;p&gt;The following areas / features defined in HTML 5 are believed to     impact the Web architecture:&lt;/p&gt;     &lt;ul&gt;&lt;li&gt;The use of the DOM as a basis for defining the language.      &lt;/li&gt;&lt;li&gt;The concept of browsing contexts.      &lt;/li&gt;&lt;li&gt;The distinction between user agent requirements and authoring      requirements.      &lt;/li&gt;&lt;li&gt;The use of imperative definitions rather than abstract definitions      with the requirement of black-box equivalence in implementations.      &lt;/li&gt;&lt;li&gt;The new content model concepts (replacing HTML 4's block and      inline concepts).      &lt;/li&gt;&lt;li&gt;The focus on accessibility as a built-in concept for new features      (such as the &lt;code&gt;irrelevant&lt;/code&gt; attribute, the      &lt;code&gt;progress&lt;/code&gt; element, et cetera) instead of an add-on (like the      &lt;code&gt;alt&lt;/code&gt; attribute).      &lt;/li&gt;&lt;li&gt;The focus on defining the semantics in detail (e.g. the outline      algorithm, replacing the vague semantics in HTML 4).      &lt;/li&gt;&lt;li&gt;The server-sent events feature (the &lt;code&gt;event-source&lt;/code&gt;      element).      &lt;/li&gt;&lt;li&gt;The &lt;code&gt;datagrid&lt;/code&gt; element.      &lt;/li&gt;&lt;li&gt;The &lt;code&gt;menu&lt;/code&gt; and &lt;code&gt;command&lt;/code&gt; elements.      &lt;/li&gt;&lt;li&gt;The origin concept.      &lt;/li&gt;&lt;li&gt;Offline Web application caches.      &lt;/li&gt;&lt;li&gt;The definition of the browsing context "navigation" algorithm and the      related session history traversal algorithms.      &lt;/li&gt;&lt;li&gt;The content-type sniffing and character encoding sniffing.      &lt;/li&gt;&lt;li&gt;The very explicit definition of a parser.      &lt;/li&gt;&lt;li&gt;The two structured storage features.      &lt;/li&gt;&lt;li&gt;The &lt;code&gt;contentEditable&lt;/code&gt; feature and the      &lt;code&gt;UndoManager&lt;/code&gt; feature.      &lt;/li&gt;&lt;li&gt;The Drag and Drop and Copy and Paste architecture.      &lt;/li&gt;&lt;li&gt;The cross-document messaging feature (the &lt;code&gt;postMessage&lt;/code&gt;      API).      &lt;/li&gt;&lt;li&gt;The new sandboxing features for &lt;code&gt;iframe&lt;/code&gt;.    &lt;/li&gt;&lt;/ul&gt;   &lt;/div&gt;   &lt;!-- This closes the &lt;div&gt; added for Michael(tm) Smith. --&gt;    &lt;h2 style="color: rgb(153, 153, 0);" id="syntax"&gt;&lt;span class="secno"  style="font-size:130%;"&gt;2. &lt;/span&gt;&lt;span style="font-size:130%;"&gt;Syntax&lt;/span&gt;&lt;/h2&gt;    &lt;p&gt;The HTML 5 language has a "custom" HTML syntax that is compatible    with HTML 4 and XHTML1 documents published on the Web, but is not    compatible with the more esoteric SGML features of HTML 4, such as    &lt;code&gt;&lt;em content=""&gt;&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;. Documents using this "custom" syntax must be    served with the &lt;code&gt;text/html&lt;/code&gt; MIME type.    &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em content=""&gt;HTML 5 also defines detailed parsing rules (including "error    handling") for this syntax which are largely compatible with popular    implementations. User agents will follow these rules for resources that    have the &lt;code&gt;text/html&lt;/code&gt; MIME type. Here is an example document    that conforms to the HTML syntax:    &lt;/em&gt;&lt;/p&gt;&amp;lt;!doctype html&amp;gt;
&lt;br /&gt;&amp;lt;html&amp;gt;
&lt;br /&gt;&amp;lt;head&amp;gt;
&lt;br /&gt;&amp;lt;meta charset="UTF-8"&amp;gt;
&lt;br /&gt;&amp;lt;title&amp;gt;Example document&amp;lt;/title&amp;gt;
&lt;br /&gt;&amp;lt;/head&amp;gt;
&lt;br /&gt;&amp;lt;body&amp;gt;
&lt;br /&gt;&amp;lt;p&amp;gt;Example paragraph&amp;lt;/p&amp;gt;
&lt;br /&gt;&amp;lt;/body&amp;gt;
&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;em content=""&gt;&lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The other syntax that can be used for HTML 5 is XML. This syntax is    compatible with XHTML1 documents and implementations. Documents using this    syntax need to be served with an XML MIME type and elements need to be put    in the &lt;code&gt;http://www.w3.org/1999/xhtml&lt;/code&gt; namespace following the    rules set forth by the XML specifications. [&lt;cite&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#ref-xml"&gt;XML&lt;/a&gt;&lt;/cite&gt;]    &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em content=""&gt;Below is an example document that conforms to the XML syntax of    HTML 5. Note that XML documents must have an XML MIME type such as    &lt;code&gt;application/xhtml+xml&lt;/code&gt; or &lt;code&gt;application/xml&lt;/code&gt;.
&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&lt;br /&gt;&amp;lt;head&amp;gt;
&lt;br /&gt;&amp;lt;title&amp;gt;Example document&amp;lt;/title&amp;gt;
&lt;br /&gt;&amp;lt;/head&amp;gt;
&lt;br /&gt;&amp;lt;body&amp;gt;
&lt;br /&gt;&amp;lt;p&amp;gt;Example paragraph&amp;lt;/p&amp;gt;
&lt;br /&gt;&amp;lt;/body&amp;gt;
&lt;br /&gt;&amp;lt;/html&amp;gt;
&lt;br /&gt;&lt;em content=""&gt;&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em content=""&gt;
&lt;br /&gt;&lt;/em&gt;&lt;/p&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="character-encoding"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;2.1 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;Character Encoding&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;For the HTML syntax of HTML 5 authors have three means of setting    the character encoding:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;At the transport level. By using the HTTP &lt;code&gt;Content-Type&lt;/code&gt;     header for instance.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Using a Unicode Byte Order Mark (BOM) character at the start of the     file. This character provides a signature for the encoding used.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Using a &lt;code&gt;meta&lt;/code&gt; element with a &lt;code&gt;charset&lt;/code&gt;     attribute that specifies the encoding as the first element child of the     &lt;code&gt;head&lt;/code&gt; element.&amp;lt;meta charset="UTF-8"&amp;gt; &lt;code&gt;&lt;meta charset="UTF-8"&gt;&lt;/code&gt; could     be used to specify the UTF-8 encoding. This replaces the need for     &amp;lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&amp;gt;&lt;code&gt;&lt;meta equiv="Content-Type" content="text/html;     charset=UTF-8"&gt;&lt;/code&gt;   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;For the XML syntax authors have to use the rules as set forth in the XML    specifications to set the character encoding.    &lt;/em&gt;&lt;/p&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="doctype"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;2.2 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;The &lt;code title=""&gt;DOCTYPE&lt;/code&gt;&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The HTML syntax of HTML 5 requires a &lt;code title=""&gt;DOCTYPE&lt;/code&gt;    to be specified to ensure that the browser renders the page in standards    mode. The &lt;code title=""&gt;DOCTYPE&lt;/code&gt; has no other purpose and is    therefore optional for XML. Documents with an XML MIME type are always    handled in standards mode. [&lt;cite&gt;&lt;a href="http://www.w3.org/TR/html5-diff/#ref-doctype"&gt;DOCTYPE&lt;/a&gt;&lt;/cite&gt;]    &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code title=""&gt;DOCTYPE&lt;/code&gt; declaration is&amp;lt;!DOCTYPE html&amp;gt; &lt;code&gt;&lt;/code&gt; and is case-insensitive in the HTML syntax. &lt;code title=""&gt;DOCTYPE&lt;/code&gt;s from earlier versions of HTML were longer because    the HTML language was SGML based and therefore required a reference to a    DTD. With HTML 5 this is no longer the case and the &lt;code title=""&gt;DOCTYPE&lt;/code&gt; is only needed to enable standards mode for    documents written using the HTML syntax. Browsers already do this for    &lt;code&gt;&lt;/code&gt;&amp;lt;!DOCTYPE html&amp;gt;.    &lt;/em&gt;&lt;/p&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="syntax-misc"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;2.3 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;Miscellaneous&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;There are a few other syntax changes worthy of mentioning:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;HTML now has native support for IRIs. In HTML 4 this was only     handled as error handling.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;lang&lt;/code&gt; attribute takes the empty string in addition to     a valid language identifier, just like &lt;code&gt;xml:lang&lt;/code&gt; does in XML.   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;h2 style="color: rgb(153, 153, 0);" id="language"&gt;&lt;span class="secno"  style="font-size:130%;"&gt;&lt;em content=""&gt;3. &lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;em content=""&gt;Language&lt;/em&gt;&lt;/span&gt;&lt;/h2&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;This section is split up in several subsections to more clearly    illustrate the various differences there are between HTML 4 and    HTML 5.    &lt;/em&gt;&lt;/p&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="new-elements"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;3.1 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;New Elements&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The following elements have been introduced for better structure:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;section&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a generic document or application      section. It can be used together with &lt;code&gt;h1&lt;/code&gt;-&lt;code&gt;h6&lt;/code&gt; to      indicate the document structure.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;article&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents an independent piece of content of a      document, such as a blog entry or newspaper article.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;aside&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a piece of content that is only slightly      related to the rest of the page.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;header&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents the header of a section.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;footer&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a footer for a section and can contain      information about the author, copyright information, et cetera.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;nav&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a section of the document intended for      navigation.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;dialog&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; can be used to mark up a conversation like this:&lt;/em&gt;&lt;/p&gt;&lt;em content=""&gt;      &lt;/em&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;&amp;lt;dialog&amp;gt;
&lt;br /&gt;&amp;lt;dt&amp;gt; Costello
&lt;br /&gt;&amp;lt;dd&amp;gt; Look, you gotta first baseman?
&lt;br /&gt;&amp;lt;dt&amp;gt; Abbott
&lt;br /&gt;&amp;lt;dd&amp;gt; Certainly.
&lt;br /&gt;&amp;lt;dt&amp;gt; Costello
&lt;br /&gt;&amp;lt;dd&amp;gt; Who's playing first?
&lt;br /&gt;&amp;lt;dt&amp;gt; Abbott
&lt;br /&gt;&amp;lt;dd&amp;gt; That's right.
&lt;br /&gt;&amp;lt;dt&amp;gt; Costello
&lt;br /&gt;&amp;lt;dd&amp;gt; When you pay off the first baseman every month, who gets the money?
&lt;br /&gt;&amp;lt;dt&amp;gt; Abbott
&lt;br /&gt;&amp;lt;dd&amp;gt; Every dollar of it.
&lt;br /&gt;&amp;lt;/dialog&amp;gt;figure&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; can be used to associate a caption together with      some embedded content, such as a graphic or video:&lt;/em&gt;&lt;/p&gt;&lt;em content=""&gt;      &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;pre&gt;&lt;code&gt;figure&lt;/code&gt; can be used to associate a caption together with
&lt;br /&gt;some embedded content, such as a graphic or video:
&lt;br /&gt;&lt;code&gt;&lt;figure&gt;&lt;em content=""&gt;&lt;video src="ogg"&gt;&amp;lt;figure&amp;gt;
&lt;br /&gt;&amp;lt;video src=ogg&amp;gt;…&amp;lt;/video&amp;gt;
&lt;br /&gt;&amp;lt;legend&amp;gt;Example&amp;lt;/legend&amp;gt;
&lt;br /&gt;&amp;lt;/figure&amp;gt;&lt;/video&gt;
&lt;br /&gt;&lt;/em&gt;&lt;/figure&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;Then there are several other new elements:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;audio&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;video&lt;/code&gt; for multimedia content. Both      provide an API so application authors can script their own user      interface, but there is also a way to trigger a user interface provided      by the user agent. &lt;code&gt;source&lt;/code&gt; elements are used together with      these elements if there are multiple streams available of different      types.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;embed&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; is used for plugin content.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;mark&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a run of marked text.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;meter&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a measurement, such as disk usage.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;time&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a date and/or time.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;canvas&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; is used for rendering dynamic bitmap graphics on      the fly, such as graphs, games, et cetera.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;command&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a command the user can invoke.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;datagrid&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents an interactive representation of a      tree list or tabular data.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;details&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents additional information or controls      which the user can obtain on demand.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;datalist&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; together with the a new &lt;code&gt;list&lt;/code&gt;      attribute for &lt;code&gt;input&lt;/code&gt; is used to make comboboxes:&lt;/em&gt;&lt;/p&gt;&lt;em content=""&gt;&lt;/em&gt;&amp;lt;input list=browsers&amp;gt;
&lt;br /&gt;&amp;lt;datalist id=browsers&amp;gt;
&lt;br /&gt; &amp;lt;option value="Safari"&amp;gt;
&lt;br /&gt; &amp;lt;option value="Internet Explorer"&amp;gt;
&lt;br /&gt; &amp;lt;option value="Opera"&amp;gt;
&lt;br /&gt; &amp;lt;option value="Firefox"&amp;gt;
&lt;br /&gt;&amp;lt;/datalist&amp;gt;
&lt;br /&gt;&lt;em content=""&gt;&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;datatemplate&lt;/code&gt;, &lt;code&gt;rule&lt;/code&gt; and &lt;code&gt;nest&lt;/code&gt;      elements provide a templating mechanism for HTML.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;event-source&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; is used to "catch" server sent events.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;output&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents some type of output, such as from a      calculation done through scripting.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;progress&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; represents a completion of a task, such as      downloading or when performing a series of expensive operations.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;ruby&lt;/code&gt;, &lt;code&gt;rt&lt;/code&gt; and &lt;code&gt;rb&lt;/code&gt; elements      allow for marking up ruby annotations.   &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;input&lt;/code&gt; element's &lt;code&gt;type&lt;/code&gt; attribute now has the    following new values:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;datetime&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;datetime-local&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;date&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;month&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;week&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;time&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;number&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;range&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;email&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;url&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The idea of these new types is that the user agent can provide the user    interface, such as a calendar date picker or integration with the user's    address book and submit a defined format to the server. It gives the user    a better experience as his input is checked before sending it to the    server meaning there is less time to wait for feedback.    &lt;/em&gt;&lt;/p&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="new-attributes"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;3.2 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;New Attributes&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;HTML 5 has introduced several new attributes to various elements    that were already part of HTML 4:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;area&lt;/code&gt; elements now have a      &lt;code&gt;media&lt;/code&gt; attribute for consistency with the &lt;code&gt;link&lt;/code&gt;      element. It is purely advisory.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;area&lt;/code&gt; elements have a new attribute      called &lt;code&gt;ping&lt;/code&gt; that specifies a space separated list of URIs      which have to be pinged when the hyperlink is followed. Currently user      tracking is mostly done through redirects. This attribute allows the      user agent to inform users which URIs are going to be pinged as well as      giving privacy-conscious users a way to turn it off.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;area&lt;/code&gt; element, for consistency, now has the      &lt;code&gt;hreflang&lt;/code&gt; and &lt;code&gt;rel&lt;/code&gt; attributes.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;base&lt;/code&gt; element can now have a &lt;code&gt;target&lt;/code&gt;      attribute as well mainly for consistency with the &lt;code&gt;a&lt;/code&gt; element      and because it was already widely supported. Also, the      &lt;code&gt;target&lt;/code&gt; attribute for the &lt;code&gt;a&lt;/code&gt; and      &lt;code&gt;area&lt;/code&gt; elements is no longer deprecated, as it is useful in      Web applications, for example in conjunction with &lt;code&gt;iframe&lt;/code&gt;.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;value&lt;/code&gt; attribute for the &lt;code&gt;li&lt;/code&gt; element is no      longer deprecated as it is not presentational. The same goes for the      &lt;code&gt;start&lt;/code&gt; attribute of the &lt;code&gt;ol&lt;/code&gt; element.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;meta&lt;/code&gt; element has a &lt;code&gt;charset&lt;/code&gt; attribute now      as this was already supported and provides a nicer way to specify the &lt;a href="http://www.w3.org/TR/html5-diff/#character-encoding"&gt;character encoding&lt;/a&gt; for the document.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;A new &lt;code&gt;autofocus&lt;/code&gt; attribute can be specified on the      &lt;code&gt;input&lt;/code&gt; (except when the &lt;code&gt;type&lt;/code&gt; attribute is      &lt;code&gt;hidden&lt;/code&gt;), &lt;code&gt;select&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt; and      &lt;code&gt;button&lt;/code&gt; elements. It provides a declarative way to focus a      form control during page load. Using this feature should enhance the      user experience as the user can turn it off if he does not like it, for      instance.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The new &lt;code&gt;form&lt;/code&gt; attribute for &lt;code&gt;input&lt;/code&gt;,      &lt;code&gt;output&lt;/code&gt;, &lt;code&gt;select&lt;/code&gt;, &lt;code&gt;textarea&lt;/code&gt;,      &lt;code&gt;button&lt;/code&gt; and &lt;code&gt;fieldset&lt;/code&gt; elements allows for      controls to be associated with more than a single form.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;button&lt;/code&gt; and &lt;code&gt;form&lt;/code&gt;      elements have a new &lt;code&gt;replace&lt;/code&gt; attribute which affects what      will be done with the document after a form has been submitted.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;form&lt;/code&gt; and &lt;code&gt;select&lt;/code&gt; elements (as well as the      &lt;code&gt;datalist&lt;/code&gt; element) have a &lt;code&gt;data&lt;/code&gt; attribute that      allows for automatically prefilling of form controls, in case of      &lt;code&gt;form&lt;/code&gt;, or the form control, in case of &lt;code&gt;select&lt;/code&gt;      and &lt;code&gt;datalist&lt;/code&gt;, with data from the server.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The new &lt;code&gt;required&lt;/code&gt; attribute applies to &lt;code&gt;input&lt;/code&gt;      (except when the &lt;code&gt;type&lt;/code&gt; attribute is &lt;code&gt;hidden&lt;/code&gt;,      &lt;code&gt;image&lt;/code&gt; or some button type such as &lt;code&gt;submit&lt;/code&gt;) and      &lt;code&gt;textarea&lt;/code&gt;. It indicates that the user has to fill in a value      in order to submit the form.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;input&lt;/code&gt; and &lt;code&gt;textarea&lt;/code&gt; elements have a new      attribute called &lt;code&gt;inputmode&lt;/code&gt; which gives a hint to the user      interface as to what kind of input is expected.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;You can now disable an entire &lt;code&gt;fieldset&lt;/code&gt; by using the      &lt;code&gt;disabled&lt;/code&gt; attribute on it. This was not possible before.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;input&lt;/code&gt; element has several new attributes to specify      constraints: &lt;code&gt;autocomplete&lt;/code&gt;, &lt;code&gt;min&lt;/code&gt;,      &lt;code&gt;max&lt;/code&gt;, &lt;code&gt;pattern&lt;/code&gt; and &lt;code&gt;step&lt;/code&gt;. As      mentioned before it also has a new &lt;code&gt;list&lt;/code&gt; attribute which can      be used together with the &lt;code&gt;datalist&lt;/code&gt; and &lt;code&gt;select&lt;/code&gt;      element.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;input&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;button&lt;/code&gt; also have a new      &lt;code&gt;template&lt;/code&gt; attribute which can be used for repetition      templates.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;menu&lt;/code&gt; element has three new attributes:      &lt;code&gt;type&lt;/code&gt;, &lt;code&gt;label&lt;/code&gt; and &lt;code&gt;autosubmit&lt;/code&gt;. They      allow the element to transform into a menu as found in typical user      interfaces as well as providing for context menus in conjunction with      the global &lt;code&gt;contextmenu&lt;/code&gt; attribute.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;style&lt;/code&gt; element has a new &lt;code&gt;scoped&lt;/code&gt; attribute      which can be used to enable scoped style sheets. Style rules within such      a &lt;code&gt;style&lt;/code&gt; element only apply to the local tree.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;script&lt;/code&gt; element has a new attribute called      &lt;code&gt;async&lt;/code&gt; that influences script loading and execution.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;html&lt;/code&gt; element has a new attribute called      &lt;code&gt;manifest&lt;/code&gt; that points to an application cache manifest used      in conjunction with the API for offline Web applications.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;link&lt;/code&gt; element has a new attribute called      &lt;code&gt;sizes&lt;/code&gt;. It can be used in conjunction with the      &lt;code&gt;icon&lt;/code&gt; relationship (set through the &lt;code&gt;rel&lt;/code&gt;      attribute) to indicate the size of the referenced icon.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;ol&lt;/code&gt; element has a new attribute called      &lt;code&gt;reversed&lt;/code&gt; to indicate that the list order is descending when      present.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;iframe&lt;/code&gt; element has two new attributes called      &lt;code&gt;seamless&lt;/code&gt; and &lt;code&gt;sandbox&lt;/code&gt; which allow for      sandboxing content, e.g. blog comments.   &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;Several attributes from HTML 4 now apply to all elements. These are    called global attributes: &lt;code&gt;class&lt;/code&gt;, &lt;code&gt;dir&lt;/code&gt;,    &lt;code&gt;id&lt;/code&gt;, &lt;code&gt;lang&lt;/code&gt;, &lt;code&gt;style&lt;/code&gt;,    &lt;code&gt;tabindex&lt;/code&gt; and &lt;code&gt;title&lt;/code&gt;.    &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em content=""&gt;There are also several new global attributes:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;contenteditable&lt;/code&gt; attribute indicates that the element     is an editable area. The user can change the contents of the element and     manipulate the markup.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;contextmenu&lt;/code&gt; attribute can be used to point to a     context menu provided by the author.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;draggable&lt;/code&gt; attribute can be used together with the new     drag &amp;amp; drop API.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;irrelevant&lt;/code&gt; attribute indicates that an element is not     yet, or is no longer, relevant.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;ref&lt;/code&gt;, &lt;code&gt;registrationmark&lt;/code&gt; and     &lt;code&gt;template&lt;/code&gt; global attributes complement the data template     feature.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;data-&lt;var&gt;*&lt;/var&gt;&lt;/code&gt; collection of author defined     attributes. Authors can define any attribute they want as long as they     prefix it with &lt;code&gt;data-&lt;/code&gt; to avoid clashes with future versions     of HTML. The only requirement on these attributes is that they are not     used for user agent extensions.   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The following are the attributes for the repetition model. These are    global attributes and as such may be used on all HTML elements, or on any    element in any other namespace, with the attributes being in the    &lt;code&gt;http://www.w3.org/1999/xhtml&lt;/code&gt; namespace.:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;repeat&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;repeat-start&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;repeat-min&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;repeat-max&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;HTML 5 also makes all event handler attributes from HTML 4    that take the form &lt;code&gt;on&lt;var&gt;event-name&lt;/var&gt;&lt;/code&gt; global attributes    and adds several new event handler attributes for new events it defines,    such as the &lt;code&gt;onmessage&lt;/code&gt; attribute which can be used together    with the new &lt;code&gt;event-source&lt;/code&gt; element and the cross-document    messaging API.    &lt;/em&gt;&lt;/p&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="changed-elements"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;3.3 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;Changed Elements&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;These elements have slightly modified meanings in HTML 5 to better    reflect how they are used on the Web or to make them more useful:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;a&lt;/code&gt; element without an &lt;code&gt;href&lt;/code&gt; attribute now      represents a "placeholder link".     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;address&lt;/code&gt; element is now scoped by the new concept of      sectioning.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;b&lt;/code&gt; element now represents a span of text to be      stylistically offset from the normal prose without conveying any extra      importance, such as key words in a document abstract, product names in a      review, or other spans of text whose typical typographic presentation is      emboldened.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;hr&lt;/code&gt; element now represents a paragraph-level thematic      break.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;i&lt;/code&gt; element now represents a span of text in an      alternate voice or mood, or otherwise offset from the normal prose, such      as a taxonomic designation, a technical term, an idiomatic phrase from      another language, a thought, a ship name, or some other prose whose      typical typographic presentation is italicized. Usage varies widely by      language.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;For the &lt;code&gt;label&lt;/code&gt; element the browser should no longer move      focus from the label to the control unless such behaviour is standard      for the underlying platform user interface.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;menu&lt;/code&gt; element is redefined to be useful for actual      menus.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;small&lt;/code&gt; element now represents small print (for side      comments and legal print).     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;strong&lt;/code&gt; element now represents importance rather than      strong emphasis.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;Quotation marks for the &lt;code&gt;q&lt;/code&gt; element are now to be provided      by the author rather than the user agent.   &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="absent-elements"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;3.4 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;Absent Elements&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The elements in this section are not to be used by authors. User agents    will still have to support them and HTML 5 will get a rendering    section in due course that says exactly how. (The &lt;code&gt;isindex&lt;/code&gt;    element for instance is already supported by the parser.)    &lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em content=""&gt;The following elements are not in HTML 5 because their effect is    purely presentational and therefore better handled by CSS:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;basefont&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;big&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;center&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;font&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;s&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;strike&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;tt&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;u&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The following elements are not in HTML 5 because their usage    affected usability and accessibility for the end user in a negative way:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;frame&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;frameset&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;noframes&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The following elements are not included because they have not been used    often, created confusion or can be handled by other elements:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;acronym&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; is not included because it has created lots of     confusion. Authors are to use &lt;code&gt;abbr&lt;/code&gt; for abbreviations.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;applet&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; has been obsoleted in favor of     &lt;code&gt;object&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;isindex&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; usage can be replaced by usage of form controls.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;dir&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; has been obsoleted in favor of &lt;code&gt;ul&lt;/code&gt;.   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;Finally the &lt;code&gt;noscript&lt;/code&gt; is only conforming in the HTML syntax.    It is not included in the XML syntax as its usage relies on an HTML    parser.    &lt;/em&gt;&lt;/p&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="absent-attributes"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;3.5 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;Absent Attributes&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;Some attributes from HTML 4 are no longer allowed in HTML 5.    If they need to have any impact on user agents for compatibility reasons    it is defined how they should work in those scenarios.    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;accesskey&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;area&lt;/code&gt;,     &lt;code&gt;button&lt;/code&gt;, &lt;code&gt;input&lt;/code&gt;, &lt;code&gt;label&lt;/code&gt;,     &lt;code&gt;legend&lt;/code&gt; and &lt;code&gt;textarea&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;rev&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;charset&lt;/code&gt; attributes on     &lt;code&gt;link&lt;/code&gt; and &lt;code&gt;a&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;shape&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;coords&lt;/code&gt; attributes on     &lt;code&gt;a&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;longdesc&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;img&lt;/code&gt; and     &lt;code&gt;iframe&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;target&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;link&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;nohref&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;area&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;profile&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;head&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;version&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;html&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;name&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;img&lt;/code&gt;, &lt;code&gt;form&lt;/code&gt; and     &lt;code&gt;a&lt;/code&gt; (use &lt;code&gt;id&lt;/code&gt; instead).     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;scheme&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;meta&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;archive&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;, &lt;code&gt;classid&lt;/code&gt;, &lt;code&gt;codebase&lt;/code&gt;,     &lt;code&gt;codetype&lt;/code&gt;, &lt;code&gt;declare&lt;/code&gt; and &lt;code&gt;standby&lt;/code&gt;     attributes on &lt;code&gt;object&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;valuetype&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;type&lt;/code&gt; attributes on     &lt;code&gt;param&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;language&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;script&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;summary&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;table&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;axis&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;abbr&lt;/code&gt; attributes on &lt;code&gt;td&lt;/code&gt;     and &lt;code&gt;th&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;scope&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;td&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;headers&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;th&lt;/code&gt;.   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;In addition, HTML 5 has none of the presentational attributes that    were in HTML 4 as they are better handled by CSS:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;align&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;caption&lt;/code&gt;,     &lt;code&gt;iframe&lt;/code&gt;, &lt;code&gt;img&lt;/code&gt;, &lt;code&gt;input&lt;/code&gt;,     &lt;code&gt;object&lt;/code&gt;, &lt;code&gt;legend&lt;/code&gt;, &lt;code&gt;table&lt;/code&gt;,     &lt;code&gt;hr&lt;/code&gt;, &lt;code&gt;div&lt;/code&gt;, &lt;code&gt;h1&lt;/code&gt;, &lt;code&gt;h2&lt;/code&gt;,     &lt;code&gt;h3&lt;/code&gt;, &lt;code&gt;h4&lt;/code&gt;, &lt;code&gt;h5&lt;/code&gt;, &lt;code&gt;h6&lt;/code&gt;,     &lt;code&gt;p&lt;/code&gt;, &lt;code&gt;col&lt;/code&gt;, &lt;code&gt;colgroup&lt;/code&gt;,     &lt;code&gt;tbody&lt;/code&gt;, &lt;code&gt;td&lt;/code&gt;, &lt;code&gt;tfoot&lt;/code&gt;, &lt;code&gt;th&lt;/code&gt;,     &lt;code&gt;thead&lt;/code&gt; and &lt;code&gt;tr&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;alink&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;, &lt;code&gt;link&lt;/code&gt;, &lt;code&gt;text&lt;/code&gt; and     &lt;code&gt;vlink&lt;/code&gt; attributes on &lt;code&gt;body&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;background&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;body&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;bgcolor&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;table&lt;/code&gt;, &lt;code&gt;tr&lt;/code&gt;,     &lt;code&gt;td&lt;/code&gt;, &lt;code&gt;th&lt;/code&gt; and &lt;code&gt;body&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;border&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;table&lt;/code&gt;, &lt;code&gt;img&lt;/code&gt;     and &lt;code&gt;object&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;cellpadding&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;cellspacing&lt;/code&gt; attributes on     &lt;code&gt;table&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;char&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;charoff&lt;/code&gt; attributes on     &lt;code&gt;col&lt;/code&gt;, &lt;code&gt;colgroup&lt;/code&gt;, &lt;code&gt;tbody&lt;/code&gt;,     &lt;code&gt;td&lt;/code&gt;, &lt;code&gt;tfoot&lt;/code&gt;, &lt;code&gt;th&lt;/code&gt;, &lt;code&gt;thead&lt;/code&gt;     and &lt;code&gt;tr&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;clear&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;br&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;compact&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;dl&lt;/code&gt;, &lt;code&gt;menu&lt;/code&gt;,     &lt;code&gt;ol&lt;/code&gt; and &lt;code&gt;ul&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;frame&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;table&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;frameborder&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;iframe&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;height&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;td&lt;/code&gt; and &lt;code&gt;th&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;hspace&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;vspace&lt;/code&gt; attributes on     &lt;code&gt;img&lt;/code&gt; and &lt;code&gt;object&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;marginheight&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;marginwidth&lt;/code&gt; attributes on     &lt;code&gt;iframe&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;noshade&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;hr&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;nowrap&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;td&lt;/code&gt; and &lt;code&gt;th&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;rules&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;table&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;scrolling&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;iframe&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;size&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;hr&lt;/code&gt;, &lt;code&gt;input&lt;/code&gt; and     &lt;code&gt;select&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;type&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;li&lt;/code&gt;, &lt;code&gt;ol&lt;/code&gt; and     &lt;code&gt;ul&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;valign&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;col&lt;/code&gt;,     &lt;code&gt;colgroup&lt;/code&gt;, &lt;code&gt;tbody&lt;/code&gt;, &lt;code&gt;td&lt;/code&gt;,     &lt;code&gt;tfoot&lt;/code&gt;, &lt;code&gt;th&lt;/code&gt;, &lt;code&gt;thead&lt;/code&gt; and     &lt;code&gt;tr&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;width&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute on &lt;code&gt;hr&lt;/code&gt;, &lt;code&gt;table&lt;/code&gt;,     &lt;code&gt;td&lt;/code&gt;, &lt;code&gt;th&lt;/code&gt;, &lt;code&gt;col&lt;/code&gt;, &lt;code&gt;colgroup&lt;/code&gt;     and &lt;code&gt;pre&lt;/code&gt;.   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;h2 style="color: rgb(153, 153, 0);" id="apis"&gt;&lt;span class="secno"  style="font-size:130%;"&gt;&lt;em content=""&gt;4. &lt;/em&gt;&lt;/span&gt;&lt;span style="font-size:130%;"&gt;&lt;em content=""&gt;APIs&lt;/em&gt;&lt;/span&gt;&lt;/h2&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;HTML 5 introduces a number of APIs that help in creating Web    applications. These can be used together with the new elements introduced    for applications:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;2D drawing API which can be used with the new &lt;code&gt;canvas&lt;/code&gt;     element.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;API for playing of video and audio which can be used with the new     &lt;code&gt;video&lt;/code&gt; and &lt;code&gt;audio&lt;/code&gt; elements.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Persistent storage. Both key / value and a SQL database are supported.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;An API that enables offline Web applications.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;An API that allows a Web application to register itself for certain     protocols or MIME types.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Editing API in combination with a new global     &lt;code&gt;contenteditable&lt;/code&gt; attribute.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Drag &amp;amp; drop API in combination with a &lt;code&gt;draggable&lt;/code&gt;     attribute.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Network API.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;API that exposes the history and allows pages to add to it to prevent     breaking the back button. (This API has the necessary security     restrictions in place.)     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Cross-document messaging.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Server-sent events in combination with the new     &lt;code&gt;event-source&lt;/code&gt; element.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Notification API to alert the user to new information, such as new     e-mail messages in an e-mail application.   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="htmldocument-extensions"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;4.1 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;Extensions to    &lt;code&gt;HTMLDocument&lt;/code&gt;&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;HTML 5 has extended the &lt;code&gt;HTMLDocument&lt;/code&gt; interface from    DOM Level 2 HTML in a number of ways. The interface is now implemented on    &lt;em&gt;all&lt;/em&gt; objects implementing the &lt;code&gt;Document&lt;/code&gt; interface so    it stays meaningful in a compound document context. It also has several    noteworthy new members:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;getElementsByClassName()&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; to select elements by their      class name. The way this method is defined it will allow it to work for      any content with &lt;code&gt;class&lt;/code&gt; attributes and a      &lt;code&gt;Document&lt;/code&gt; object such as SVG and MathML.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;innerHTML&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; as an easy way to parse and serialize an HTML      or XML document. This attribute was previously only available on      &lt;code&gt;HTMLElement&lt;/code&gt; in Web browsers and not part of any standard.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;activeElement&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;hasFocus&lt;/code&gt; to determine      which element is currently focused and whether the &lt;code&gt;Document&lt;/code&gt;      has focus respectively.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;getSelection()&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; which returns an object that represents      the current selection(s).     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;designMode&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; and &lt;code&gt;execCommand()&lt;/code&gt; which are      mostly used for editing of documents.   &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;h3 style="color: rgb(255, 204, 102);" id="htmlelement-extensions"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;4.2 &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;Extensions to    &lt;code&gt;HTMLElement&lt;/code&gt;&lt;/em&gt;&lt;/h3&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;The &lt;code&gt;HTMLElement&lt;/code&gt; interface has also gained several    extensions in HTML 5:    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;getElementsByClassName()&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; which is basically a scoped      version of the one found on &lt;code&gt;HTMLDocument&lt;/code&gt;.     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;innerHTML&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; as found in Web browsers today. It is also      defined to work in XML context (when it is used in an XML document).     &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;     &lt;/em&gt;&lt;p&gt;&lt;code&gt;&lt;em content=""&gt;classList&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; is a convenient accessor for      &lt;code&gt;className&lt;/code&gt;. The object it returns exposes methods, such as      &lt;code&gt;has()&lt;/code&gt;, &lt;code&gt;add()&lt;/code&gt;, &lt;code&gt;remove()&lt;/code&gt; and      &lt;code&gt;toggle()&lt;/code&gt; for manipulating the element's classes. The      &lt;code&gt;a&lt;/code&gt;, &lt;code&gt;area&lt;/code&gt; and &lt;code&gt;link&lt;/code&gt; elements have a      similar attribute called &lt;code&gt;relList&lt;/code&gt; that provides the same      functionality for the &lt;code&gt;rel&lt;/code&gt; attribute.   &lt;/em&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;h2 style="color: rgb(153, 153, 0);" id="changelog"&gt;&lt;span class="secno"&gt;&lt;em content=""&gt;5. &lt;/em&gt;&lt;/span&gt;&lt;em content=""&gt;HTML 5 Changelog&lt;/em&gt;&lt;/h2&gt;&lt;em content=""&gt;    &lt;/em&gt;&lt;p&gt;&lt;em content=""&gt;Below is a rough list of changes that have been made to the HTML 5    specification since the initial publication of the HTML 5 Working    Draft. This changelog only indicates what has been changed. For more    detailed discussion please use the &lt;a href="http://lists.w3.org/Archives/Public/public-html/"&gt;&lt;code&gt;public-html@w3.org&lt;/code&gt;&lt;/a&gt;    and &lt;a href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/"&gt;&lt;code&gt;whatwg@whatwg.org&lt;/code&gt;&lt;/a&gt;    mailing list archives. Changes that affect this document have been    incorperated throughout.    &lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em content=""&gt;Implementation and authoring details around the &lt;code&gt;ping&lt;/code&gt;     attribute have changed.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;meta equiv="content-type"&gt;&lt;/code&gt;&lt;em content=""&gt; is now a conforming way     to set the character encoding.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;API for the &lt;code&gt;canvas&lt;/code&gt; element has been cleaned up. Text     support has been added.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;globalStorage&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; is now restricted to the same-origin policy     and renamed to &lt;code&gt;localStorage&lt;/code&gt;. Related event dispatching has     been clarified.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;postMessage()&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; API changed. Only the origin of the message     is exposed, no longer the URI. It also requires a second argument that     indicates the origin of the target document.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Drag and drop API has got clarification. The &lt;code&gt;dataTransfer&lt;/code&gt;     object now has a &lt;code&gt;types&lt;/code&gt; attribute indicating the type of data     being transferred.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;m&lt;/code&gt; element is now called &lt;code&gt;mark&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Server-sent events has changed and gotten clarification. It uses a new     format so that older implementations are not broken.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;figure&lt;/code&gt; element no longer requires a caption.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;ol&lt;/code&gt; element has a new &lt;code&gt;reversed&lt;/code&gt; attribute.          &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Character encoding detection has changed in response to feedback.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Various changes have been made to the HTML parser section in response     to implementation feedback.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Various changes to the editing section have been made, including     adding &lt;code&gt;queryCommandEnabled()&lt;/code&gt; and related methods.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;headers&lt;/code&gt; attribute has been added for &lt;code&gt;td&lt;/code&gt;     elements.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;table&lt;/code&gt; element has a new &lt;code&gt;createTBody()&lt;/code&gt;     method.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;MathML support has been added to the HTML parser section. (SVG support     is still awaiting input from the SVG WG.)     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Author defined attributes have been added. Authors can add attributes     to elements in the form of &lt;code&gt;data-&lt;var&gt;name&lt;/var&gt;&lt;/code&gt; and can     access these through the DOM using &lt;code&gt;dataset[&lt;var&gt;name&lt;/var&gt;]&lt;/code&gt;     on the element in question.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;q&lt;/code&gt; element has changed to require punctation inside     rather than having the browser render it.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;target&lt;/code&gt; attribute can now have the value     &lt;code&gt;_blank&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;showModalDialog&lt;/code&gt; API has been added.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;document.domain&lt;/code&gt; API has been defined.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;source&lt;/code&gt; element now has a new &lt;code&gt;pixelratio&lt;/code&gt;     attribute useful for videos that have some kind encoding error.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;bufferedBytes&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt;, &lt;code&gt;totalBytes&lt;/code&gt; and     &lt;code&gt;bufferingThrottled&lt;/code&gt; DOM attributes have been added to the     &lt;code&gt;video&lt;/code&gt; element.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Media &lt;code&gt;begin&lt;/code&gt; event has been renamed to     &lt;code&gt;loadstart&lt;/code&gt; for consistency with the Progress Events     specification.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;&lt;em content=""&gt;charset&lt;/em&gt;&lt;/code&gt;&lt;em content=""&gt; attribute has been added to &lt;code&gt;script&lt;/code&gt;.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;iframe&lt;/code&gt; element has gained the &lt;code&gt;sandbox&lt;/code&gt;     and &lt;code&gt;seamless&lt;/code&gt; attributes which provide sandboxing     functionality.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;The &lt;code&gt;ruby&lt;/code&gt;, &lt;code&gt;rt&lt;/code&gt; and &lt;code&gt;rp&lt;/code&gt; elements     have been added to support ruby annotation.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;A &lt;code&gt;showNotification()&lt;/code&gt; method has been added to show     notification messages to the user.     &lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em content=""&gt;Support for &lt;code&gt;beforeprint&lt;/code&gt; and &lt;code&gt;afterprint&lt;/code&gt;     events has been added.   &lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-1981831740533171802?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/XHmtR0zzxkIxplP0SySRHhWeCLU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XHmtR0zzxkIxplP0SySRHhWeCLU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/XHmtR0zzxkIxplP0SySRHhWeCLU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/XHmtR0zzxkIxplP0SySRHhWeCLU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=oOX2Go45"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=56xFkXqI"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=LclSWqU5"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=LclSWqU5" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=hyVm0EJp"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=F0ikxNlo"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=F0ikxNlo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=zWGVQpVT"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=n1tjUoPn"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=n1tjUoPn" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=XwMW9pht"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Hfl5fTtT"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=Hfl5fTtT" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=XObM1nDA"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/RwfjWIV2Fso" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/RwfjWIV2Fso/html-5.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGMIKwNCQYI/AAAAAAAAAzc/7oCCGExfFwk/s72-c/structure-div.gif" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/html-5.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-3419647388572573278</guid><pubDate>Wed, 25 Jun 2008 06:19:00 +0000</pubDate><atom:updated>2008-06-24T23:25:58.747-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Firefox 4</category><title>Firefox 4</title><description>&lt;span style="font-weight: bold; color: #6699CC;font-size:130%;" &gt;Firefox 4 will push out the edges of the browser&lt;/span&gt;&lt;br /&gt;By Rafe Needleman – March 27, 2008 3:45 PM PDT 25 comments&lt;br /&gt;&lt;br /&gt;Chris Beard, VP Labs, Mozilla&lt;br /&gt;(Credit: Rafe Needleman / CNET)&lt;br /&gt;&lt;br /&gt;This post has been corrected from the original: Mozilla has no plan to ship Firefox 4 this year; references to that effect have been removed.&lt;br /&gt;&lt;br /&gt;After the product road map roundtable I live-blogged Wednesday, I had a talk with Chris Beard, VP of Labs for Mozilla. Beard is working on the things you won\'t see in Firefox 3, but will, if he has his way, surface in Firefox 4.&lt;br /&gt;&lt;br /&gt;Beard\'s philosophy is this: The browser needs to evolve. Beard believes the browser concept hasn\'t fundamentally changed in 10 years. It\'s still an isolated piece of software, he says. Mozilla Lab\'s push is to blur the edges of the browser, to make it both more tightly integrated with the computer it\'s running on, and also more hooked into Web services. So extended, the browser becomes an even more powerful and pervasive platform for all kinds of applications.&lt;br /&gt;&lt;br /&gt;At the moment, these are two separate projects Mozilla is running to push out the edges of the browser: Prism and Weave.&lt;br /&gt;&lt;br /&gt;Prism&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGHjw9TK7vI/AAAAAAAAAzI/58wGUr8PtTI/s1600-h/moz-prismlogo_90x53.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGHjw9TK7vI/AAAAAAAAAzI/58wGUr8PtTI/s320/moz-prismlogo_90x53.jpg" alt="" id="BLOGGER_PHOTO_ID_5215700273699942130" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Prism is Mozilla\'s shot at busting apps out of the browser. Part of the Prism project is making the browsing core available to apps developers so they can build products like Zimbra Desktop (review) that are essentially Web apps, but that don\'t look like it.&lt;br /&gt;&lt;br /&gt;The dream is to be able to take any Web site or app and turn it into an app that can run directly from the desktop. A very big part of this initiative is to make sites/apps work when they are not connected to the Internet. HTML 5 (the next version of the basic standard for the encoding of Web sites) includes explicit support for local, offline resources.&lt;br /&gt;&lt;br /&gt;HTML 5 and Prism will, Mozilla execs say, render Google Gears obsolete. Not to mention other important, and proprietary, Web app platforms that are already in production, like Adobe AIR and Microsoft Silverlight (What is Silverlight?).&lt;br /&gt;&lt;br /&gt;Weave&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGHjxMGrSUI/AAAAAAAAAzQ/7bmqqak_tK0/s1600-h/moz-weavelogo_90x29.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SGHjxMGrSUI/AAAAAAAAAzQ/7bmqqak_tK0/s320/moz-weavelogo_90x29.jpg" alt="" id="BLOGGER_PHOTO_ID_5215700277674068290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Weave extends the browser in the other direction: Not toward the desktop, but instead into the Internet. Mozilla wants an individual\'s browsing experience to stay with them no matter what machine they are on. That means synchronizing bookmarks, home pages, favorites, and passwords to an online service that the user can attach to when he or she fires up the browser. As more people move between browsing machines (their laptop and their mobile phone, for example, or between different PCs), this will become more important.&lt;br /&gt;&lt;br /&gt;Firefox 3 is laying the groundwork for this. It has a new transactional database that stores user preferences and favorites. However, it won\'t be used for cross-browser syncing in version3; Beard hopes this extension to the database is rolled out in Firefox 4.&lt;br /&gt;&lt;br /&gt;Firefox 3 users will, though, experience some online services being fed into their browser. For example, Mozilla will update all running browsers every 30 minutes with malware signatures, to stave off drive-by downloads and phishing scams.&lt;br /&gt;&lt;br /&gt;Beard wants the new online/offline, browser/service to be more intelligent on behalf of its users. Early examples of this intelligence include the \"awesome bar,\" which is what Mozilla calls the new smart address bar in Firefox 3. It offers users smart URL suggestions as they type based on Web searches and their prior Web browsing history. He\'s looking to extend on this with a \"linguistic user interface\" that lets users type plain English commands into the browser bar. Beard pointed me towards Quicksilver and Enso as products he\'s cribbing from.&lt;br /&gt;&lt;br /&gt;Beard said the Labs are playing with other \"crazy ideas,\" but that Prism and Weave technologies are are being targeted at the next version of Firefox.&lt;br /&gt;&lt;br /&gt;Further reading: See &lt;a href="http://labs.mozilla.com/"&gt;Labs.mozilla.com&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-3419647388572573278?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QR3J0uOkbalW-VgzEM7zYIwwMEM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QR3J0uOkbalW-VgzEM7zYIwwMEM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QR3J0uOkbalW-VgzEM7zYIwwMEM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QR3J0uOkbalW-VgzEM7zYIwwMEM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=nUAO9bSn"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=PGt64Fm0"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=7t0b9QMg"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=7t0b9QMg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=iCcLZXTb"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=IAK1UXLX"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=IAK1UXLX" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=QxKPdmSI"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=51S1dXkp"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=51S1dXkp" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=4XhfwuBZ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=fAQgknWQ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=fAQgknWQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=G5OGbf6T"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/bFGRL1VGjGI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/bFGRL1VGjGI/firefox-4.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://1.bp.blogspot.com/_vJc4QlgRE6c/SGHjw9TK7vI/AAAAAAAAAzI/58wGUr8PtTI/s72-c/moz-prismlogo_90x53.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/firefox-4.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-3233956693983351967</guid><pubDate>Mon, 23 Jun 2008 04:35:00 +0000</pubDate><atom:updated>2008-06-22T21:59:32.666-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Windows Vienna</category><title>Windows Vienna</title><description>&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:180%;" &gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SF8pSd1ZUSI/AAAAAAAAAxM/Tyyk3IOM-Zw/s1600-h/edlyxrrepptxso68dntl.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SF8pSd1ZUSI/AAAAAAAAAxM/Tyyk3IOM-Zw/s320/edlyxrrepptxso68dntl.jpg" alt="" id="BLOGGER_PHOTO_ID_5214932290741293346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Windows 7 (formerly known as Blackcomb and Vienna) is the working name for the next major version of Microsoft Windows as the successor of Windows Vista. Microsoft has announced that it is "scoping Windows 7 development to a three-year timeframe", and that "the specific release date will ultimately be determined by meeting the quality bar." Windows 7 is expected to be released sometime in 2010. The client versions of Windows 7 will ship in both 32-bit and 64-bit versions. A server variant, codenamed Windows Server 7, is also under development.&lt;br /&gt;&lt;br /&gt;Microsoft is maintaining a policy of silence concerning discussion of plans and aspirations for Windows 7 as they focus on the release and marketing of Windows Vista, though some early details of various core operating system features have emerged. As a result, little is known about the feature set, though public presentations from company officials have disseminated information about some features. Leaked information from people to whom Milestone 1 (M1) of Windows 7 was shipped also provides some insight into the feature set.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;- Wallpapers -&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8sCsVGeEI/AAAAAAAAAyc/IDzvQ2SQVcs/s1600-h/window11.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8sCsVGeEI/AAAAAAAAAyc/IDzvQ2SQVcs/s320/window11.jpg" alt="" id="BLOGGER_PHOTO_ID_5214935318289348674" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SF8sCreQFII/AAAAAAAAAyk/JIM1qo6x3gs/s1600-h/window12.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SF8sCreQFII/AAAAAAAAAyk/JIM1qo6x3gs/s320/window12.jpg" alt="" id="BLOGGER_PHOTO_ID_5214935318059291778" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SF8sC-Q34tI/AAAAAAAAAys/oBozpin0SI8/s1600-h/window13.png"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SF8sC-Q34tI/AAAAAAAAAys/oBozpin0SI8/s320/window13.png" alt="" id="BLOGGER_PHOTO_ID_5214935323103453906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SF8sC1DSLkI/AAAAAAAAAy0/07LLlb4fr5U/s1600-h/window14.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SF8sC1DSLkI/AAAAAAAAAy0/07LLlb4fr5U/s320/window14.jpg" alt="" id="BLOGGER_PHOTO_ID_5214935320630537794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8sDP6oYJI/AAAAAAAAAy8/aM0nJzZRMUA/s1600-h/window+1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8sDP6oYJI/AAAAAAAAAy8/aM0nJzZRMUA/s320/window+1.jpg" alt="" id="BLOGGER_PHOTO_ID_5214935327842001042" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8rqeSG7YI/AAAAAAAAAx0/Qgqhiuom9Xw/s1600-h/window5.png"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8rqeSG7YI/AAAAAAAAAx0/Qgqhiuom9Xw/s320/window5.png" alt="" id="BLOGGER_PHOTO_ID_5214934902201838978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8rqaKWNPI/AAAAAAAAAx8/HjPPtSfh3So/s1600-h/window6.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8rqaKWNPI/AAAAAAAAAx8/HjPPtSfh3So/s320/window6.jpg" alt="" id="BLOGGER_PHOTO_ID_5214934901095544050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8rqsk5hII/AAAAAAAAAyE/X6CKe2Xi2K4/s1600-h/window8.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8rqsk5hII/AAAAAAAAAyE/X6CKe2Xi2K4/s320/window8.jpg" alt="" id="BLOGGER_PHOTO_ID_5214934906038748290" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SF8rqouXNqI/AAAAAAAAAyM/GmlUusgp7d8/s1600-h/window9.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SF8rqouXNqI/AAAAAAAAAyM/GmlUusgp7d8/s320/window9.jpg" alt="" id="BLOGGER_PHOTO_ID_5214934905004701346" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8rqhgG-SI/AAAAAAAAAyU/e1ExB-C1-KQ/s1600-h/window10.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8rqhgG-SI/AAAAAAAAAyU/e1ExB-C1-KQ/s320/window10.jpg" alt="" id="BLOGGER_PHOTO_ID_5214934903065868578" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8pSQQWEtI/AAAAAAAAAxU/zBXTA08Dkvk/s1600-h/window2.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SF8pSQQWEtI/AAAAAAAAAxU/zBXTA08Dkvk/s320/window2.jpg" alt="" id="BLOGGER_PHOTO_ID_5214932287096230610" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8pStRyBAI/AAAAAAAAAxc/ll1QTVUIv8g/s1600-h/window3.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8pStRyBAI/AAAAAAAAAxc/ll1QTVUIv8g/s320/window3.jpg" alt="" id="BLOGGER_PHOTO_ID_5214932294886884354" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8pSxTtVnI/AAAAAAAAAxk/Ov7aup99GS8/s1600-h/window3.png"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SF8pSxTtVnI/AAAAAAAAAxk/Ov7aup99GS8/s320/window3.png" alt="" id="BLOGGER_PHOTO_ID_5214932295968708210" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SF8pTBxFOlI/AAAAAAAAAxs/saGr8l4fxFA/s1600-h/window4.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SF8pTBxFOlI/AAAAAAAAAxs/saGr8l4fxFA/s320/window4.jpg" alt="" id="BLOGGER_PHOTO_ID_5214932300386875986" border="0" /&gt;&lt;/a&gt;&lt;span style="font-size:180%;"&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Video&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;br /&gt;&lt;div id='vu_ytplayer_vjVQa1PpcFOHXlflG7yRwuGsLPJdagB40zi9rGSAewQ='&gt;&lt;a href='http://www.youtube.com/browse'&gt;Watch the latest videos on YouTube.com&lt;/a&gt;&lt;/div&gt;&lt;script type='text/javascript' src='http://www.youtube.com/cp/vjVQa1PpcFOHXlflG7yRwuGsLPJdagB40zi9rGSAewQ='&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-3233956693983351967?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/oat-F4XgTFc4x5jQeJViXUFFF4k/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oat-F4XgTFc4x5jQeJViXUFFF4k/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/oat-F4XgTFc4x5jQeJViXUFFF4k/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/oat-F4XgTFc4x5jQeJViXUFFF4k/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=1zNbBgLe"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=N0YfWfx8"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=AmQ9pS2b"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=AmQ9pS2b" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=EgXM7r5R"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=kFKG86jI"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=kFKG86jI" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=u3nWs8bA"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=tC6jgOcv"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=tC6jgOcv" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=YYBVB4d2"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=RLMBMLWa"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=RLMBMLWa" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=7mZ2wV1X"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/4UngneTAxC8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/4UngneTAxC8/windows-vienna.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://4.bp.blogspot.com/_vJc4QlgRE6c/SF8pSd1ZUSI/AAAAAAAAAxM/Tyyk3IOM-Zw/s72-c/edlyxrrepptxso68dntl.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/windows-vienna.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-5302103786311377281</guid><pubDate>Sun, 22 Jun 2008 04:12:00 +0000</pubDate><atom:updated>2008-06-24T23:27:07.984-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JPA</category><title>Java Persistence API</title><description>&lt;span style="color: #6699CC;font-size:180%;" &gt;Java Persistence API Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Entity classes&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;hi everyone, i have started learning JPA 2 months ago.although i know hibernate very well but its bit difficult to work&lt;br /&gt;with JPA in starting Phase.i have never work with j2EE full aspects application before so its quite new thing for me.&lt;br /&gt;There are many thing is new for me in JPA example -Annotation.&lt;br /&gt;&lt;br /&gt;There is some few example classes that i want to show you as i have make during my assignment.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;Example CustEntity.java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt;*&lt;br /&gt;* @author sky&lt;br /&gt;*/&lt;br /&gt;@Entity&lt;br /&gt;@NamedQueries({&lt;br /&gt;@NamedQuery(name = "findAllCustomers", query = "SELECT c FROM CustEntity c"),&lt;br /&gt;@NamedQuery(name = "findByCustomerid", query = "SELECT c FROM CustEntity c WHERE c.id = :id"),&lt;br /&gt;@NamedQuery(name = "findByUsername", query = "SELECT c FROM CustEntity c WHERE c.username = :username"),&lt;br /&gt;@NamedQuery(name = "findByName", query = "SELECT c FROM CustEntity c WHERE c.firstname = :firstname AND c.surname = :surname")&lt;br /&gt;})&lt;br /&gt;@Table(name = "CUSTOMER")&lt;br /&gt;public class CustEntity implements Serializable {&lt;br /&gt;&lt;br /&gt;private static final long serialVersionUID = 1L;&lt;br /&gt;@Id&lt;br /&gt;@GeneratedValue(strategy = GenerationType.AUTO)&lt;br /&gt;@Column(name = "ID", nullable = false)&lt;br /&gt;private Long id;&lt;br /&gt;@Column(name = "FIRSTNAME", nullable = false)&lt;br /&gt;private String firstname;&lt;br /&gt;@Column(name = "SURNAME", nullable = false)&lt;br /&gt;private String surname;&lt;br /&gt;@Column(name = "PASSWORD", nullable = false)&lt;br /&gt;private String password;&lt;br /&gt;@Column(name = "USERNAME", nullable = false)&lt;br /&gt;private String username;&lt;br /&gt; @Column(name = "BIRTHDATE")&lt;br /&gt;private Integer birthdate;&lt;br /&gt;@Column(name = "PHONE")&lt;br /&gt;private Integer phone;&lt;br /&gt;@Column(name = "EMAIL")&lt;br /&gt;private String email;&lt;br /&gt;@Column(name = "Gender")&lt;br /&gt;private String gender;&lt;br /&gt;@Column(name = "PHONENO")&lt;br /&gt;private Long phoneno;&lt;br /&gt;@Column(name = "DOB")&lt;br /&gt;@Temporal(value = TemporalType.DATE)&lt;br /&gt;private Date dob;&lt;br /&gt;@OneToOne(optional = false, cascade = CascadeType.PERSIST)&lt;br /&gt;@JoinColumn(name = "ADDRESSID", referencedColumnName = "ADDRESSID")&lt;br /&gt;private Address address;&lt;br /&gt;&lt;br /&gt;public String getGender() {&lt;br /&gt;    return gender;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setGender(String gender) {&lt;br /&gt;    this.gender = gender;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public CustEntity() {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Date getDob() {&lt;br /&gt;    return dob;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setDob(Date dob) {&lt;br /&gt;    this.dob = dob;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Long getPhoneno() {&lt;br /&gt;    return phoneno;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setPhoneno(Long phoneno) {&lt;br /&gt;    this.phoneno = phoneno;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public CustEntity(String username, String password) {&lt;br /&gt;    setUsername(username);&lt;br /&gt;    setPassword(password);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public CustEntity(String username, String password, String firstname, String surname, String email, Long phoneno, Date dob, String gender) {&lt;br /&gt;    this();&lt;br /&gt;    setUsername(username);&lt;br /&gt;    setPassword(password);&lt;br /&gt;    setFirstname(firstname);&lt;br /&gt;    setSurname(surname);&lt;br /&gt;    setPhoneno(phoneno);&lt;br /&gt;    setEmail(email);&lt;br /&gt;    setDob(dob);&lt;br /&gt;    this.setGender(gender);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Long getId() {&lt;br /&gt;    return id;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setId(Long id) {&lt;br /&gt;    this.id = id;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public int hashCode() {&lt;br /&gt;    int hash = 0;&lt;br /&gt;    hash += (id != null ? id.hashCode() : 0);&lt;br /&gt;    return hash;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public boolean equals(Object object) {&lt;br /&gt;    // TODO: Warning - this method won't work in the case the id fields are not set&lt;br /&gt;    if (!(object instanceof CustEntity)) {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    CustEntity other = (CustEntity) object;&lt;br /&gt;    if ((this.id == null &amp;amp;&amp;amp; other.id != null) || (this.id != null &amp;amp;&amp;amp; !this.id.equals(other.id))) {&lt;br /&gt;        return false;&lt;br /&gt;    }&lt;br /&gt;    return true;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;@Override&lt;br /&gt;public String toString() {&lt;br /&gt;    return "au.edu.swin.app.CustomerEntity[id=" + id + "]";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getFirstname() {&lt;br /&gt;    return firstname;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setFirstname(String firstname) {&lt;br /&gt;    this.firstname = firstname;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getSurname() {&lt;br /&gt;    return this.surname;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setSurname(String surname) {&lt;br /&gt;    this.surname = surname;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getPassword() {&lt;br /&gt;    return this.password;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setPassword(String password) {&lt;br /&gt;    this.password = password;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getUsername() {&lt;br /&gt;    return this.username;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setUsername(String username) {&lt;br /&gt;    this.username = username;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;  public Integer getBirthdate() {&lt;br /&gt;return birthdate;&lt;br /&gt;}&lt;br /&gt;public void setBirthdate(Integer birthdate) {&lt;br /&gt;this.birthdate = birthdate;&lt;br /&gt;}&lt;br /&gt;public Integer getPhone() {&lt;br /&gt;return phone;&lt;br /&gt;}&lt;br /&gt;public void setPhone(Integer phone) {&lt;br /&gt;this.phone = phone;&lt;br /&gt;}&lt;br /&gt;public String getEmail() {&lt;br /&gt;    return email;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setEmail(String email) {&lt;br /&gt;    this.email = email;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Address getAddress() {&lt;br /&gt;    return address;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setAddress(Address address) {&lt;br /&gt;    this.address = address;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Transfer Object Methods&lt;br /&gt;public CustTo getData() {&lt;br /&gt;    CustTo to = new CustTo(id, firstname, surname);&lt;br /&gt;    return to;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public CustDetailedTo getDetailedData() {&lt;br /&gt;    CustDetailedTo to = new CustDetailedTo(id, firstname, surname, username, password, email, phoneno, dob, gender);&lt;br /&gt;    return to;&lt;br /&gt;}&lt;br /&gt;// note that only the LoginCustDetailedTo can be&lt;br /&gt;// used to update the state of the vehicle entity&lt;br /&gt;public void setData(CustDetailedTo to) {&lt;br /&gt;    setId(to.getId());&lt;br /&gt;    setFirstname(to.getFirstname());&lt;br /&gt;    setSurname(to.getSurname());&lt;br /&gt;    setUsername(to.getUsername());&lt;br /&gt;    setPassword(to.getPassword());&lt;br /&gt;    setEmail(to.getEmail());&lt;br /&gt;    setDob(to.getDob());&lt;br /&gt;    setPhoneno(to.getPhoneno());&lt;br /&gt;    this.setGender(to.getGender());&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 153, 0);"&gt;Example : Address.java&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;@Entity&lt;br /&gt;@Table(name = "ADDRESS")&lt;br /&gt;@NamedQueries({@NamedQuery(name = "Address.findByAddressid", query = "SELECT a FROM Address a WHERE a.addressid = :addressid"), @NamedQuery(name = "Address.findByStreetnumber", query = "SELECT a FROM Address a WHERE a.streetnumber = :streetnumber"), @NamedQuery(name = "Address.findByStreet", query = "SELECT a FROM Address a WHERE a.street = :street"), @NamedQuery(name = "Address.findByCity", query = "SELECT a FROM Address a WHERE a.city = :city"), @NamedQuery(name = "Address.findByState", query = "SELECT a FROM Address a WHERE a.state = :state"), @NamedQuery(name = "Address.findByPostcode", query = "SELECT a FROM Address a WHERE a.postcode = :postcode"), @NamedQuery(name = "Address.findAllAddress", query = "SELECT a FROM Address a")})&lt;br /&gt;public class Address implements Serializable {&lt;br /&gt;&lt;br /&gt;private static final long serialVersionUID = 1L;&lt;br /&gt;@Id&lt;br /&gt;@GeneratedValue(strategy = GenerationType.AUTO)&lt;br /&gt;@Column(name = "ADDRESSID", nullable = false)&lt;br /&gt;private Long addressid;&lt;br /&gt;@Column(name = "STREETNUMBER", nullable = false)&lt;br /&gt;private int streetnumber;&lt;br /&gt;@Column(name = "STREET", nullable = false)&lt;br /&gt;private String street;&lt;br /&gt;@Column(name = "CITY", nullable = false)&lt;br /&gt;private String city;&lt;br /&gt;@Column(name = "STATE", nullable = false)&lt;br /&gt;private String state;&lt;br /&gt;@Column(name = "POSTCODE", nullable = false)&lt;br /&gt;private int postcode;&lt;br /&gt;&lt;br /&gt;public Address() {&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Address(int streetnumber, String street, String city, String state, int postcode) {&lt;br /&gt;    this();&lt;br /&gt;    this.setCity(city);&lt;br /&gt;    this.setStreetnumber(streetnumber);&lt;br /&gt;    this.setStreet(street);&lt;br /&gt;    this.setState(state);&lt;br /&gt;    this.setPostcode(postcode);&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public Long getAddressid() {&lt;br /&gt;    return addressid;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setAddressid(Long addressid) {&lt;br /&gt;    this.addressid = addressid;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public int getStreetnumber() {&lt;br /&gt;    return streetnumber;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setStreetnumber(int streetnumber) {&lt;br /&gt;    this.streetnumber = streetnumber;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getStreet() {&lt;br /&gt;    return street;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setStreet(String street) {&lt;br /&gt;    this.street = street;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getCity() {&lt;br /&gt;    return city;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setCity(String city) {&lt;br /&gt;    this.city = city;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public String getState() {&lt;br /&gt;    return state;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setState(String state) {&lt;br /&gt;    this.state = state;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public int getPostcode() {&lt;br /&gt;    return postcode;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setPostcode(int postcode) {&lt;br /&gt;    this.postcode = postcode;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// Transfer Object Methods&lt;br /&gt;public AddressTO getData() {&lt;br /&gt;    AddressTO to = new AddressTO(addressid,streetnumber, street, city, state, postcode);&lt;br /&gt;    return to;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public void setData(AddressTO to) {&lt;br /&gt;    setAddressid(to.getAddressid());&lt;br /&gt;    setStreet(to.getStreet());&lt;br /&gt;    setCity(to.getCity());&lt;br /&gt;    setPostcode(to.getPostcode());&lt;br /&gt;    setState(to.getState());&lt;br /&gt;    setStreetnumber(to.getStreetnumber());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;/* @Override&lt;br /&gt;/* public int hashCode() {&lt;br /&gt;int hash = 0;&lt;br /&gt;hash += (addressid != null ? addressid.hashCode() : 0);&lt;br /&gt;return hash;&lt;br /&gt;}&lt;br /&gt;@Override&lt;br /&gt;public boolean equals(Object object) {&lt;br /&gt;// TODO: Warning - this method won't work in the case the id fields are not set&lt;br /&gt;if (!(object instanceof Address)) {&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;Address other = (Address) object;&lt;br /&gt;if ((this.addressid == null &amp;amp;&amp;amp; other.addressid != null) || (this.addressid != null &amp;amp;&amp;amp; !this.addressid.equals(other.addressid))) {&lt;br /&gt;return false;&lt;br /&gt;}&lt;br /&gt;return true;&lt;br /&gt;}&lt;br /&gt;@Override&lt;br /&gt;public String toString() {&lt;br /&gt;return "au.swin.Entity.Address[addressid=" + addressid + "]";&lt;br /&gt;}*/&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:70;"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;&lt;span style="font-size:100%;"&gt;This is two example of my entity classes. i like to inroduce some Anonotation i used&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;@Entity - Use this annotation to designate a plain old Java object (POJO) class as an entity so that you can use it with JPA services.&lt;br /&gt;&lt;br /&gt;@NamedQuerys - set of Named Querys&lt;br /&gt;&lt;br /&gt;@NamedQuery - Use these annotations to pre-define queries and manage their result sets.&lt;br /&gt;&lt;br /&gt;@Table(name = "CUSTOMER")  - Use these annotations to override this default behavior and fine-tune the relationship between your object model and data model - will create table CUSTOMER in database.&lt;br /&gt;&lt;br /&gt;@Id  - Specify this is primary column in database.&lt;br /&gt;&lt;br /&gt;@@GeneratedValue(strategy = GenerationType.AUTO) - primary key generation policy&lt;br /&gt;&lt;br /&gt;@Column(name = "ID", nullable = false) - Specify in database column name woould be.&lt;br /&gt;&lt;br /&gt;@OneToOne - Use these annotations to specify the type and characteristics of entity relationships to fine-tune how your database implements these relationships.&lt;br /&gt;&lt;br /&gt;@JoinColumn  - To specify the join columns that are being mapped to the persistent attribute&lt;br /&gt;&lt;br /&gt;more reference : &lt;a href="http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html"&gt;http://www.oracle.com/technology/products/ias/toplink/jpa/resources/toplink-jpa-annotations.html&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-5302103786311377281?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/qVHxKIaXkAXALRTzTE4_w9v6w0U/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qVHxKIaXkAXALRTzTE4_w9v6w0U/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/qVHxKIaXkAXALRTzTE4_w9v6w0U/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/qVHxKIaXkAXALRTzTE4_w9v6w0U/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=sFizK9Oh"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=6VLqcV2T"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=M7cPuoyk"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=M7cPuoyk" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=6bW15UUv"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=cZQJ1mB9"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=cZQJ1mB9" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=qIcLmOS7"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=7CBEmOVb"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=7CBEmOVb" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Of1JtbsI"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=30l304C5"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=30l304C5" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=JkEp0wzT"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/0JG9B2ttGSg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/0JG9B2ttGSg/java-persistance-api.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/java-persistance-api.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-8028449003418606967</guid><pubDate>Thu, 19 Jun 2008 03:13:00 +0000</pubDate><atom:updated>2008-07-02T19:23:29.776-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP- MySQL</category><title>PHP - MYSQL EXAMPLES</title><description>&lt;span style="color: rgb(102, 153, 204);font-size:100%;" &gt;&lt;span style="color: rgb(0, 0, 0);font-size:100%;" &gt;&lt;span style="color: rgb(153, 153, 0);font-size:180%;" &gt;Connect to MySQL Database&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There is a very easy steps to follow to connect MySQL database from PHP.&lt;br /&gt;just see the example below.&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbhost = 'localhost';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbuser = 'root';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbpass = 'password';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbname = 'petstore';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    mysql_select_db($dbname);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="phpcode"&gt;$dbhost&lt;/span&gt; is the name of MySQL server. When your    webserver is on the same machine with the MySQL server you can use localhost    or 127.0.0.1 as the value of &lt;span class="phpcode"&gt;$dbhost&lt;/span&gt;. The &lt;span class="phpcode"&gt;$dbuser&lt;/span&gt;    and &lt;span class="phpcode"&gt;$dbpass&lt;/span&gt; are valid MySQL user name and password&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Don't forget to select a database using &lt;span class="phpcode"&gt;mysql_select_db()&lt;/span&gt;      after connecting to mysql. If no database selected your query to select or      update a table will not work.&lt;/p&gt;   Sometimes a web host will require you to specify the MySQL server name and    port number. For example if the MySQL server name is &lt;span class="courier"&gt;db.database.com&lt;/span&gt;    and the port number is &lt;span class="courier"&gt;3306&lt;/span&gt; (the default port number    for MySQL) then you you can modify the above code to :&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbhost = 'db.database.com:3306';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbuser = 'root';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbpass = 'password';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $dbname = 'petstore';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    mysql_select_db($dbname);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;It's a common practice to place the routine of opening a database connection    in a separate file. Then everytime you want to open a connection just &lt;span class="phpcode"&gt;include&lt;/span&gt;    the file. Usually the host, user, password and database name are also separated    in a configuration file.&lt;br /&gt;&lt;br /&gt;t's a common practice to place the routine of opening a database connection    in a separate file. Then everytime you want to open a connection just &lt;span class="phpcode"&gt;include&lt;/span&gt;    the file. Usually the host, user, password and database name are also separated    in a configuration file.   &lt;p&gt;An example of &lt;span class="courier"&gt;config.php&lt;/span&gt; that stores the connection    configuration and opendb.php that opens the connection are :&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;br /&gt;// This is an example of config.php&lt;br /&gt;$dbhost = 'localhost';&lt;br /&gt;$dbuser = 'root';&lt;br /&gt;$dbpass = 'password';&lt;br /&gt;$dbname = 'phpcake';&lt;br /&gt;?&amp;gt;&lt;/p&gt;&lt;p style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;br /&gt;// This is an example opendb.php&lt;br /&gt;$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');&lt;br /&gt;mysql_select_db($dbname);&lt;br /&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;So now you can open a connection to mysql like this:&lt;/p&gt;&lt;p style="color: rgb(0, 0, 0);"&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    // ... do something like insert or select, etc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style="color: rgb(153, 153, 0);"&gt;Closing the Connection&lt;/h2&gt;  &lt;p&gt;The connection opened in a script will be closed as soon as the execution    of the script ends. But it's better if you close it explicitly by calling &lt;span class="phpcode"&gt;mysql_close()&lt;/span&gt;    function. You could also put this function call in a file named &lt;span class="courier"&gt;closedb.php&lt;/span&gt;.&lt;/p&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    // an example of closedb.php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    // it does nothing but closing&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    // a mysql database connection&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    mysql_close($conn);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&lt;/span&gt;Now that you have put the database configuration, opening and closing routines    in separate files your PHP script that uses mysql would look something like    this :&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    // ... do something like insert or select, etc&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;font-size:180%;" &gt;Insert Data To MySQL Database&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:100%;"&gt;inserting data to MySQL is done by using &lt;span class="phpcode"&gt;mysql_query()&lt;/span&gt;    to execute INSERT query. Note that the query string &lt;strong&gt;should not&lt;/strong&gt;    end with a semicolon. Below is an example of adding a new MySQL user by inserting    a new row into table &lt;span class="courier"&gt;user&lt;/span&gt; in database &lt;span class="courier"&gt;mysql&lt;/span&gt;    :&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Example : insert.php&lt;/p&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'library/config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'library/opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    mysql_select_db($mysql);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    $query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_ priv)     VALUES ('localhost', 'phpcake', PASSWORD('mypass'), 'Y', 'Y', 'Y')";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    mysql_query($query) or die('Error, insert query failed');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;$query = "FLUSH PRIVILEGES";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;mysql_query($query) or die('Error, insert query failed');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;include 'library/closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;In the above example &lt;span class="phpcode"&gt;mysql_query()&lt;/span&gt; was followed    by&lt;span class="phpcode"&gt; die()&lt;/span&gt;. If the query fail the error message will    be printed and the script's execution is terminated. Actually you can use &lt;span class="phpcode"&gt;die()&lt;/span&gt;    with any function that might not execute properly. That way you can be sure    that the script won't continue to run when an error occured.&lt;/p&gt;   &lt;!--/td--&gt;    &lt;table align="center" border="0" cellspacing="0" width="650"&gt;  &lt;tbody&gt;&lt;tr&gt;    &lt;td class="maincell" background="images/1/bg2.gif"&gt;  &lt;p&gt;In a real application the values of an &lt;span class="courier"&gt;INSERT&lt;/span&gt;    statement will be form values. As a safe precaution always escape the values    using &lt;span class="phpcode"&gt;addslashes()&lt;/span&gt; if &lt;span class="phpcode"&gt;get_magic_quotes_gpc()    &lt;/span&gt;returns false. Below is an example of using form values with &lt;span class="courier"&gt;INSERT.&lt;/span&gt;    It's the same as above except that the new username and password are taken from    &lt;span class="phpcode"&gt;$_POST &lt;/span&gt;:&lt;/p&gt;  Example : adduser.php&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   &amp;lt;head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     &amp;lt;title&amp;gt;Add New MySQL User&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     &amp;lt;meta http-equiv="Content-Type" content="text/html;             charset=iso-8859-1"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   &amp;lt;/head&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   if(isset($_POST['add']))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;         {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;              include 'library/config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;       include 'library/opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      $username = $_POST['username'];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      $password = $_POST['password'];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      $query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_  priv) VALUES ('localhost', '$username', PASSWORD('$password'), 'Y', 'Y', 'Y')";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     mysql_query($query) or die('Error, insert query failed');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     $query = "FLUSH PRIVILEGES";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    mysql_query($query) or die('Error, insert query failed');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'library/closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    echo "New MySQL user added";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   else&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;        ?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   &amp;lt;form method="post"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     &amp;lt;table width="400" border="0" cellspacing="1"     cellpadding="2"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;         &amp;lt;td width="100"&amp;gt;Username&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;         &amp;lt;td&amp;gt;&amp;lt;input name="username" type="text"     id="username"&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;        &amp;lt;td width="100"&amp;gt;Password&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;        &amp;lt;td&amp;gt;&amp;lt;input name="password" type="text" id="password"&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;       &amp;lt;td width="100"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      &amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   &amp;lt;tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      &amp;lt;td width="100"&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      &amp;lt;td&amp;gt;&amp;lt;input name="add" type="submit" id="add" value="Add New User"&amp;gt;&amp;lt;/td&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   &amp;lt;/tr&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   &amp;lt;/table&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(153, 153, 0);font-size:180%;" &gt;Get Data From MySQL Database&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Using PHP you can run a MySQL SELECT query to fetch the data out of the database.    You have several options in fetching information from MySQL. PHP provide several    functions for this. The first one is &lt;span class="phpcode"&gt;mysql_fetch_array()&lt;/span&gt;which    fetch a result row as an associative array, a numeric array, or both. &lt;/p&gt;     &lt;p&gt;Below is an example of fetching data from MySQL, the table contact have three    columns, name, subject and message.&lt;br /&gt;&lt;/p&gt;  Example : select.php&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $query  = "SELECT name, subject, message FROM contact";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $result = mysql_query($query);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   while($row = mysql_fetch_array($result, MYSQL_ASSOC))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     echo "Name :{$row['name']} &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    "Subject : {$row['subject']} &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    "Message : {$row['message']} &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;The &lt;span class="phpcode"&gt;while()&lt;/span&gt; loop will keep fetching new rows    until &lt;span class="phpcode"&gt;mysql_fetch_array() &lt;/span&gt;returns FALSE, which    means there are no more rows to fetch. The content of the rows are assigned    to the variable &lt;span class="phpcode"&gt;$row&lt;/span&gt; and the values in row are    then printed. Always remember to put curly brackets when you want to insert    an array value directly into a string.&lt;/p&gt;                &lt;p&gt;In above example I use the constant &lt;span class="phpcode"&gt;MYSQL_ASSOC&lt;/span&gt;&lt;span class="courier"&gt;    &lt;/span&gt;as the second argument to &lt;span class="phpcode"&gt;mysql_fetch_array(),&lt;/span&gt;    so that it returns the row as an associative array. With an associative array    you can access the field by using their name instead of using the index . Personally    I think it's more informative to use &lt;span class="phpcode"&gt;$row['subject']&lt;/span&gt;    instead of &lt;span class="phpcode"&gt;$row[1].&lt;/span&gt;&lt;/p&gt;      &lt;p&gt;PHP also provide a function called &lt;span class="phpcode"&gt;mysql_fetch_assoc()&lt;/span&gt;    which also return the row as an associative array.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $query  = "SELECT name, subject, message FROM contact";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $result = mysql_query($query);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   while($row = mysql_fetch_assoc($result))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     echo "Name :{$row['name']} &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;         "Subject : {$row['subject']} &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;         "Message : {$row['message']} &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  include 'closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;You can also use the constant&lt;span class="courier"&gt; &lt;/span&gt;&lt;span class="phpcode"&gt;MYSQL_NUM&lt;/span&gt;,    as the second argument to &lt;span class="phpcode"&gt;mysql_fetch_array()&lt;/span&gt;.    This will cause the function to return an array with numeric index.&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $query  = "SELECT name, subject, message FROM contact";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $result = mysql_query($query);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   while($row = mysql_fetch_array($result, MYSQL_NUM))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     echo "Name :{$row[0]} &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     "Subject : {$row[0]} &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     "Message : {$row[0]} &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;include 'closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Using the constant &lt;span class="phpcode"&gt;MYSQL_NUM&lt;/span&gt; with &lt;span class="phpcode"&gt;mysql_fetch_array()&lt;/span&gt;    gives the same result as the function &lt;span class="phpcode"&gt;mysql_fetch_row()&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;               There is another method for you to get the values from a row. You can use &lt;span class="phpcode"&gt;list()&lt;/span&gt;,    to assign a list of variables in one operation.&lt;br /&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $query  = "SELECT name, subject, message FROM contact";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $result = mysql_query($query);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   while(list($name,$subject,$message)= mysql_fetch_row($result))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     echo "Name :$name &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    "Subject : $subject &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    "Message : $row &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;include 'closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;In above example, &lt;span class="phpcode"&gt;list()&lt;/span&gt; assign the values in    the array returned by &lt;span class="phpcode"&gt;mysql_fetch_row()&lt;/span&gt; into the    variable &lt;span class="phpcode"&gt;$name&lt;/span&gt;, &lt;span class="phpcode"&gt;$subject    &lt;/span&gt;and &lt;span class="phpcode"&gt;$message&lt;/span&gt;.&lt;/p&gt;  &lt;p&gt;Of course you can also do it like this&lt;/p&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $query  = "SELECT name, subject, message FROM contact";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $result = mysql_query($query);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   while($row = mysql_fetch_row($result))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      $name    = $row[0];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      $subject = $row[1];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;      $message = $row[2];&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     echo "Name :$name &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;       "Subject : $subject &amp;lt;br&amp;gt;" .&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;       "Message : $row &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  include 'closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;So you see you have lots of choices in fetching information from a database.    Just choose the one appropriate for your program&lt;/p&gt;  &lt;p&gt; &lt;/p&gt;     &lt;h3 style="color: rgb(153, 153, 0);"&gt;Freeing the memory ?&lt;/h3&gt;  &lt;p&gt;In some cases a query can return large result sets. As this results are stored    in memory there's a concern about memory usage. However you do not need to worry    that you will have to call this function in all your script to prevent memory    congestion. In PHP all results memory is automatically freed at the end of the    script's execution. &lt;/p&gt;  &lt;p&gt;But you are really concerned about how much memory is being used for queries    that return large result sets you can use&lt;span class="phpcode"&gt; mysql_free_result().    &lt;/span&gt;Calling this function will free all memory associated with the result    identifier ( &lt;span class="phpcode"&gt;$result&lt;/span&gt; ). &lt;/p&gt;  &lt;p&gt;Using the above example you can call &lt;span class="phpcode"&gt;mysql_free_result()&lt;/span&gt;    like this :&lt;/p&gt;&lt;p&gt;In some cases a query can return large result sets. As this results are stored    in memory there's a concern about memory usage. However you do not need to worry    that you will have to call this function in all your script to prevent memory    congestion. In PHP all results memory is automatically freed at the end of the    script's execution. &lt;/p&gt;  &lt;p&gt;But you are really concerned about how much memory is being used for queries    that return large result sets you can use&lt;span class="phpcode"&gt; mysql_free_result().    &lt;/span&gt;Calling this function will free all memory associated with the result    identifier ( &lt;span class="phpcode"&gt;$result&lt;/span&gt; ). &lt;/p&gt;  &lt;p&gt;Using the above example you can call &lt;span class="phpcode"&gt;mysql_free_result()&lt;/span&gt;    like this :&lt;/p&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $query  = "SELECT name, subject, message FROM contact";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $result = mysql_query($query);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  while($row = mysql_fetch_row($result))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;     ...&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  mysql_free_result($result);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;include 'closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style="color: rgb(153, 153, 0);"&gt;Convert MySQL Query Result To Excel&lt;/h2&gt;  &lt;p&gt;Using PHP to convert MySQL query result to Excel format is also common especially    in web based finance applications. The finance data stored in database are downloaded    as Excel file for easy viewing. There is no special functions in PHP to do the    job. But you can do it easily by formatting the query result as tab separated    values or put the value in an HTML table. After that set the content type to    &lt;span class="courier"&gt; application/vnd.ms-excel&lt;/span&gt;&lt;/p&gt;  Example : convert.php&lt;br /&gt;&lt;div style="border: thin double rgb(50,0,255);"&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'library/config.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;    include 'library/opendb.php';&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $query  = "SELECT fname, lname FROM students";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $result = mysql_query($query) or die('Error, query failed');&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $tsv  = array();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $html = array();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   while($row = mysql_fetch_array($result, MYSQL_NUM))&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;       $tsv[]  = implode("t", $row);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;       $html[] = "&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;" .implode("&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;", $row) .                "&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $tsv = implode("rn", $tsv);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $html = "&amp;lt;table&amp;gt;" . implode("rn", $html) . "&amp;lt;/table&amp;gt;";&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   $fileName = 'mysql-to-excel.xls';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   header("Content-type: application/vnd.ms-excel");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   header("Content-Disposition: attachment; filename=$fileName");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;   echo $tsv;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;  //echo $html;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt; include 'library/closedb.php';&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 153, 51);"&gt;?&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;In the above example &lt;span class="phpcode"&gt;$tsv&lt;/span&gt; is a string containing    tab separated values and &lt;span class="phpcode"&gt;$html &lt;/span&gt;contain an HTML    table. I use &lt;span class="phpcode"&gt;implode() &lt;/span&gt;to join the values of &lt;span class="phpcode"&gt;$row&lt;/span&gt;    with tab to create a tab separated string. &lt;/p&gt;  &lt;p&gt; After the while loop&lt;span class="phpcode"&gt; implode()&lt;/span&gt; is used once    again to join the rows using newline characters. The headers are set and the    value of &lt;span class="phpcode"&gt;$tsv &lt;/span&gt;is then printed. This will force    the browser to save the file as &lt;span class="courier"&gt;mysql-to-excel.xsl&lt;/span&gt;&lt;/p&gt;  &lt;p&gt;Try running the script in your own computer then try commenting &lt;span class="phpcode"&gt;echo    $tsv&lt;/span&gt; and uncomment &lt;span class="phpcode"&gt;echo $html&lt;/span&gt; to see the    difference.&lt;/p&gt;&lt;a href="http://www.phpwebcommerce.com/php-mysql-shopping-cart-tutorial.php"&gt;Shopping Cart Tutorial&lt;/a&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-8028449003418606967?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/cgyBaZ5BL0IHwpf9QRN5pTLXFpY/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cgyBaZ5BL0IHwpf9QRN5pTLXFpY/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/cgyBaZ5BL0IHwpf9QRN5pTLXFpY/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/cgyBaZ5BL0IHwpf9QRN5pTLXFpY/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=7hoNuUoO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=WVawwh33"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=6NOl4Uew"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=6NOl4Uew" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=EEiH3rjU"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=CODNJdfh"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=CODNJdfh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=F9IabCHQ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=PtPo3jDZ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=PtPo3jDZ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=1QJUFCS6"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=NonJDWNO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=NonJDWNO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=oyLOQoK9"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/fZZAb0bY2vA" height="1" width="1"/&gt;</description><enclosure type="" url="http://www.php-mysql-tutorial.com/" length="0" /><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/fZZAb0bY2vA/php-mysql-examples.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><itunes:explicit>no</itunes:explicit><itunes:subtitle>Connect to MySQL Database There is a very easy steps to follow to connect MySQL database from PHP. just see the example below. &amp;lt;?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die </itunes:subtitle><itunes:author>sky.dodiya@gmail.com (SKY)</itunes:author><itunes:summary>Connect to MySQL Database There is a very easy steps to follow to connect MySQL database from PHP. just see the example below. &amp;lt;?php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'petstore'; mysql_select_db($dbname); ?&amp;gt; $dbhost is the name of MySQL server. When your webserver is on the same machine with the MySQL server you can use localhost or 127.0.0.1 as the value of $dbhost. The $dbuser and $dbpass are valid MySQL user name and password Don't forget to select a database using mysql_select_db() after connecting to mysql. If no database selected your query to select or update a table will not work. Sometimes a web host will require you to specify the MySQL server name and port number. For example if the MySQL server name is db.database.com and the port number is 3306 (the default port number for MySQL) then you you can modify the above code to : &amp;lt;?php $dbhost = 'db.database.com:3306'; $dbuser = 'root'; $dbpass = 'password'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); $dbname = 'petstore'; mysql_select_db($dbname); ?&amp;gt; It's a common practice to place the routine of opening a database connection in a separate file. Then everytime you want to open a connection just include the file. Usually the host, user, password and database name are also separated in a configuration file. t's a common practice to place the routine of opening a database connection in a separate file. Then everytime you want to open a connection just include the file. Usually the host, user, password and database name are also separated in a configuration file. An example of config.php that stores the connection configuration and opendb.php that opens the connection are : &amp;lt;?php // This is an example of config.php $dbhost = 'localhost'; $dbuser = 'root'; $dbpass = 'password'; $dbname = 'phpcake'; ?&amp;gt;&amp;lt;?php // This is an example opendb.php $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'); mysql_select_db($dbname); ?&amp;gt; So now you can open a connection to mysql like this:&amp;lt;?php include 'config.php'; include 'opendb.php'; // ... do something like insert or select, etc ?&amp;gt;Closing the Connection The connection opened in a script will be closed as soon as the execution of the script ends. But it's better if you close it explicitly by calling mysql_close() function. You could also put this function call in a file named closedb.php. &amp;lt;?php // an example of closedb.php // it does nothing but closing // a mysql database connection mysql_close($conn); ?&amp;gt; Now that you have put the database configuration, opening and closing routines in separate files your PHP script that uses mysql would look something like this : &amp;lt;?php include 'config.php'; include 'opendb.php'; // ... do something like insert or select, etc include 'closedb.php'; ?&amp;gt; Insert Data To MySQL Database inserting data to MySQL is done by using mysql_query() to execute INSERT query. Note that the query string should not end with a semicolon. Below is an example of adding a new MySQL user by inserting a new row into table user in database mysql : Example : insert.php &amp;lt;?php include 'library/config.php'; include 'library/opendb.php'; mysql_select_db($mysql); $query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_ priv) VALUES ('localhost', 'phpcake', PASSWORD('mypass'), 'Y', 'Y', 'Y')"; mysql_query($query) or die('Error, insert query failed'); $query = "FLUSH PRIVILEGES"; mysql_query($query) or die('Error, insert query failed'); include 'library/closedb.php'; ?&amp;gt; In the above example mysql_query() was followed by die(). If the query fail the error message will be printed and the script's execution is terminated. Actually you can use die() with any function that might not execute properly. That way you can be sure that the script won't continue to run when an </itunes:summary><itunes:keywords>iPhone,Sony,Ericssion,Nokia</itunes:keywords><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/php-mysql-examples.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-8674316691846670700</guid><pubDate>Wed, 18 Jun 2008 06:11:00 +0000</pubDate><atom:updated>2008-06-24T23:28:12.896-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Sony Ericssion Concepts</category><title>Sony Ericssion</title><description>&lt;span style="font-weight: bold; color: #6699CC;font-size:180%;" &gt;Sony Ericsson PSP Phone Concept&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Mobile phones with camera, mp3 player, mobile TV station, and GPS receiver can be found nowadays, all features mentioned also available in Sony Ericsson cell phone. What about mobile gaming ? Sony Ericsson is recently filling patent about Sony Ericsson PSP Phone concept. After all, who’s better positioned to create a perfect mobile gaming platform than Sony ?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFip0z1QaXI/AAAAAAAAAvM/ehpMexox4zo/s1600-h/sony-ericsson-psp-phone-concept2.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFip0z1QaXI/AAAAAAAAAvM/ehpMexox4zo/s320/sony-ericsson-psp-phone-concept2.jpg" alt="" id="BLOGGER_PHOTO_ID_5213103293413222770" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFipzTRA8iI/AAAAAAAAAvE/i1kqpZq3sY8/s1600-h/sony-ericsson-psp-phone-concept1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFipzTRA8iI/AAAAAAAAAvE/i1kqpZq3sY8/s320/sony-ericsson-psp-phone-concept1.jpg" alt="" id="BLOGGER_PHOTO_ID_5213103267491410466" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0); font-weight: bold;"&gt;Sony Ericsson Phone : Wearable Around The Neck&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;Compact mobile phone designed for Sony Ericsson. This mobile phone is a personal, friendly object which is wearable around the neck. The user can use the three buttons (Busy, Accept, Reject) to handle the calls. The ‘Accept’ and ‘Reject’ buttons work in the regular fashion while the ‘Busy’ button allows the user to record a message such as ‘I am in a meeting right now’. When the button pressed during an incoming call, the phone plays the message for the caller. The concept of “call priority” is also introduced here. This is a feature which allows callers to set a priority for the call, such as emergency, normal, fun, etc. In return, the peeking display of the device glows with a certain color for certain priority levels when ringing. Will we see it in the future ? Let’s wait for Sony Ericsson answer …&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFirFHqMDPI/AAAAAAAAAvU/ETxACHHmCpo/s1600-h/bilgi-smallphone1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFirFHqMDPI/AAAAAAAAAvU/ETxACHHmCpo/s320/bilgi-smallphone1.jpg" alt="" id="BLOGGER_PHOTO_ID_5213104673125043442" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFirFS8kcNI/AAAAAAAAAvc/elpTgiMe5NA/s1600-h/bilgi-smallphone2.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFirFS8kcNI/AAAAAAAAAvc/elpTgiMe5NA/s320/bilgi-smallphone2.jpg" alt="" id="BLOGGER_PHOTO_ID_5213104676154929362" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFirFfzXubI/AAAAAAAAAvk/eqD3XQMghio/s1600-h/bilgi-smallphone3.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFirFfzXubI/AAAAAAAAAvk/eqD3XQMghio/s320/bilgi-smallphone3.jpg" alt="" id="BLOGGER_PHOTO_ID_5213104679606008242" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="text-decoration: underline;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Sony Rolly Egg-Shaped Sound Entertainment Gadget&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;With innovative size and shape being designed for music players, Sony Rolly is one refreshing design. Design wise it is of the shape of a cylinder, which comes with 1 GB internal flash memory. It also has Bluetooth connectivity for receiving and streaming music. It also has a USB connection for transferring music and charging the batteries. The audio format supported being MP3, ATRAC and AAC up to 330 kbps.&lt;/p&gt; &lt;p&gt;The battery used is the rechargeable 3.7V, which has a battery life of 5 hours for music playback, while the same gives 4.5 hours on Bluetooth connection. It has dimensions 104 x 65 x 65 and weighs about 300 grams. With a price tag of $360, it sure leaves one hole in the pocket.&lt;/p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFiwsiYkD2I/AAAAAAAAAvs/oOJwPOkmHo4/s1600-h/sony-rolly1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFiwsiYkD2I/AAAAAAAAAvs/oOJwPOkmHo4/s320/sony-rolly1.jpg" alt="" id="BLOGGER_PHOTO_ID_5213110847871913826" border="0" /&gt;&lt;/a&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFiwsnNEtYI/AAAAAAAAAv0/SWz3GAU3nXY/s1600-h/sony-rolly2.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFiwsnNEtYI/AAAAAAAAAv0/SWz3GAU3nXY/s320/sony-rolly2.jpg" alt="" id="BLOGGER_PHOTO_ID_5213110849165899138" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFiwsnNEtYI/AAAAAAAAAv0/SWz3GAU3nXY/s1600-h/sony-rolly2.jpg"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFiws_Eq8CI/AAAAAAAAAv8/WMq3rukARQM/s1600-h/sony-rolly3.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFiws_Eq8CI/AAAAAAAAAv8/WMq3rukARQM/s320/sony-rolly3.jpg" alt="" id="BLOGGER_PHOTO_ID_5213110855573106722" border="0" /&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFiws_Eq8CI/AAAAAAAAAv8/WMq3rukARQM/s1600-h/sony-rolly3.jpg"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;XPERIA X1 Slider-Phone from Sony Ericsson&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;XPERIA X1 marks the launch of a new brand for &lt;a href="http://www.sonyericsson.com/"&gt;Sony Ericsson&lt;/a&gt; company, this product is hoped can gain attention from slider phone lovers. Featuring 3 inch wide VGA display, 3.2 mega-pixel camera, slider-design body, touch screen, and full wide-pitch QWERTY keyboard. This probably the next iphone rival. No one mention about any price just yet, we can hope to see XPERIA X1 in the market around second half of 2008. Let’s hope so !&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFixc5IWgAI/AAAAAAAAAwE/OnIoBgTG958/s1600-h/sony-ericsson-xperia-x1-slider-phone1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFixc5IWgAI/AAAAAAAAAwE/OnIoBgTG958/s320/sony-ericsson-xperia-x1-slider-phone1.jpg" alt="" id="BLOGGER_PHOTO_ID_5213111678611652610" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFixdrUqJ9I/AAAAAAAAAwc/KpQ8HjQc8yM/s1600-h/sony-ericsson-xperia-x1-slider-phone4.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFixdrUqJ9I/AAAAAAAAAwc/KpQ8HjQc8yM/s320/sony-ericsson-xperia-x1-slider-phone4.jpg" alt="" id="BLOGGER_PHOTO_ID_5213111692085045202" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFixdM9yBWI/AAAAAAAAAwM/mBuQRasJL4M/s1600-h/sony-ericsson-xperia-x1-slider-phone2.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFixdM9yBWI/AAAAAAAAAwM/mBuQRasJL4M/s320/sony-ericsson-xperia-x1-slider-phone2.jpg" alt="" id="BLOGGER_PHOTO_ID_5213111683936028002" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFixdZ9E0ZI/AAAAAAAAAwU/oxHXqqre15M/s1600-h/sony-ericsson-xperia-x1-slider-phone3.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFixdZ9E0ZI/AAAAAAAAAwU/oxHXqqre15M/s320/sony-ericsson-xperia-x1-slider-phone3.jpg" alt="" id="BLOGGER_PHOTO_ID_5213111687422726546" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-8674316691846670700?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/QF_wXzDBYPHCL2KkA7APRNp98Y0/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QF_wXzDBYPHCL2KkA7APRNp98Y0/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/QF_wXzDBYPHCL2KkA7APRNp98Y0/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/QF_wXzDBYPHCL2KkA7APRNp98Y0/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=24tLwFuW"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=FXrLYf8P"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=ZsjhrJjS"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=ZsjhrJjS" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=9WEqWiyL"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=nbezTNgS"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=nbezTNgS" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=BylKDRte"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=VbDvTCJO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=VbDvTCJO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=GwuySN6F"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=kcSBVdMY"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=kcSBVdMY" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=6yQgTJAN"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/hC92eCnw6O0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/hC92eCnw6O0/sony-ericssion.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFip0z1QaXI/AAAAAAAAAvM/ehpMexox4zo/s72-c/sony-ericsson-psp-phone-concept2.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/sony-ericssion.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-6064379590188733236</guid><pubDate>Mon, 16 Jun 2008 14:02:00 +0000</pubDate><atom:updated>2008-07-24T20:45:19.189-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Nokia Concept</category><title>Nokia</title><description>&lt;span style="font-weight: bold; color: rgb(102, 153, 204);font-size:180%;" &gt;The Morph concept&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFZy7NvFtRI/AAAAAAAAAuE/V9fHX3hTiS8/s1600-h/morph_wrist_mode.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFZy7NvFtRI/AAAAAAAAAuE/V9fHX3hTiS8/s320/morph_wrist_mode.jpg" alt="" id="BLOGGER_PHOTO_ID_5212479980352943378" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Launched alongside The Museum of Modern Art “Design and The Elastic Mind” exhibition, the Morph concept device is a bridge between highly advanced technologies and their potential benefits to end-users. This device concept showcases some revolutionary leaps being explored by Nokia Research Center (NRC) in collaboration with the Cambridge Nanoscience Centre (United Kingdom) – nanoscale technologies that will potentially create a world of radically different devices that open up an entirely new spectrum of possibilities.&lt;/p&gt; &lt;p&gt; Morph concept technologies might create fantastic opportunities for mobile devices: &lt;/p&gt;&lt;ul class="standard_list"&gt;&lt;li&gt;Newly-enabled flexible and transparent materials blend more seamlessly with the way we live &lt;/li&gt;&lt;li&gt;Devices become self-cleaning and self-preserving&lt;/li&gt;&lt;li&gt;Transparent electronics offering an entirely new aesthetic dimension &lt;/li&gt;&lt;li&gt;Built-in solar absorption might charge a device, whilst batteries become smaller, longer lasting and faster to charge &lt;/li&gt;&lt;li&gt;Integrated sensors might allow us to learn more about the environment around us, empowering us to make better choices&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;In addition to the advances above, the integrated electronics shown in the Morph concept could cost less and include more functionality in a much smaller space, even as interfaces are simplified and usability is enhanced. All of these new capabilities will unleash new applications and services that will allow us to communicate and interact in unprecedented ways.&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFZyraQPuKI/AAAAAAAAAt8/9e_bDpUshp8/s1600-h/morph_phone_operating.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFZyraQPuKI/AAAAAAAAAt8/9e_bDpUshp8/s320/morph_phone_operating.jpg" alt="" id="BLOGGER_PHOTO_ID_5212479708835330210" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFi0KipuhlI/AAAAAAAAAw0/biVkxtg80gc/s1600-h/nokia-morph4.jpg"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFi0KipuhlI/AAAAAAAAAw0/biVkxtg80gc/s320/nokia-morph4.jpg" alt="" id="BLOGGER_PHOTO_ID_5213114661874861650" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFZ1TuRezdI/AAAAAAAAAuM/kQd0HvrYl1s/s1600-h/nokiamorph-.jpg"&gt;&lt;img style="cursor: pointer;" src="http://1.bp.blogspot.com/_vJc4QlgRE6c/SFZ1TuRezdI/AAAAAAAAAuM/kQd0HvrYl1s/s320/nokiamorph-.jpg" alt="" id="BLOGGER_PHOTO_ID_5212482600427245010" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b style="color: rgb(255, 204, 51);" class="largebodybold"&gt;Flexible &amp;amp; Changing Design&lt;/b&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Nanotechnology enables materials and components that are flexible, stretchable, transparent and remarkably strong. Fibril proteins are woven into a three dimensional mesh that reinforces thin elastic structures. Using the same principle behind spider silk, this elasticity enables the device to literally change shapes and configure itself to adapt to the task at hand.&lt;/p&gt;&lt;p&gt; A folded design would fit easily in a pocket and could lend itself ergonomically to being used as a traditional handset. An unfolded larger design could display more detailed information, and incorporate input devices such as keyboards and touch pads. &lt;/p&gt;&lt;p&gt; Even integrated electronics, from interconnects to sensors, could share these flexible properties. Further, utilization of biodegradable materials might make production and recycling of devices easier and ecologically friendly.&lt;/p&gt;&lt;b style="color: rgb(255, 204, 51);" class="largebodybold"&gt;Self-Cleaning&lt;/b&gt;&lt;br /&gt;Nanotechnology also can be leveraged to create self-cleaning surfaces on mobile devices, ultimately reducing corrosion, wear and improving longevity. Nanostructured surfaces, such as “Nanoflowers” naturally repel water, dirt, and even fingerprints utilizing effects also seen in natural systems.&lt;br /&gt;&lt;br /&gt;&lt;b style="color: rgb(255, 204, 51);" class="largebodybold"&gt;Advanced Power Sources&lt;/b&gt;&lt;p&gt;Nanotechnology holds out the possibility that the surface of a device will become a natural source of energy via a covering of “Nanograss” structures that harvest solar power. At the same time new high energy density storage materials allow batteries to become smaller and thinner, while also quicker to recharge and able to endure more charging cycles.&lt;/p&gt;&lt;b style="color: rgb(255, 204, 51);" class="largebodybold"&gt;Sensing The Environment &lt;/b&gt;&lt;p&gt;Nanosensors would empower users to examine the environment around them in completely new ways, from analyzing air pollution, to gaining insight into bio-chemical traces and processes. New capabilities might be as complex as helping us monitor evolving conditions in the quality of our surroundings, or as simple as knowing if the fruit we are about to enjoy should be washed before we eat it. Our ability to tune into our environment in these ways can help us make key decisions that guide our daily actions and ultimately can enhance our health.&lt;/p&gt;&lt;b style="color: rgb(255, 204, 51);" class="largebodybold"&gt;Press Material&lt;/b&gt;&lt;ul class="standard_list"&gt;&lt;li&gt;&lt;a href="http://www.nokia.com/A4136001?newsid=1194251"&gt;View press release&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.nokia.com/A4630650?category=rd"&gt;View and download photos&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://nds3.nokia.com/NOKIA_COM_1/About_Nokia/Research/Demos/Morph/video/morph_concept_small.mov"&gt;View Morph video (.mov, 46mb) &lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;b style="color: rgb(255, 204, 51);" class="largebodybold"&gt;Other resources&lt;/b&gt;&lt;p&gt;To learn more about the “Design and The Elastic Mind” exhibition at The Museum of Modern Art visit &lt;a href="http://www.moma.org/exhibitions/exhibitions.php?id=5632" target="_blank"&gt;MoMA webpage&lt;/a&gt;&lt;/p&gt; &lt;p&gt; To learn more about the Cambridge Nanoscience Centre visit &lt;a href="http://www.nanoscience.cam.ac.uk/" target="_blank"&gt;http://www.nanoscience.cam.ac.uk/&lt;/a&gt;&lt;/p&gt;&lt;span style="color: rgb(255, 204, 51); font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;&lt;br /&gt;&lt;br /&gt;Provoke 2012 Phone Concept&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;a href="http://www.provoke.fi/"&gt;Provoke Design&lt;/a&gt; is Nokia’s main Design contractor and they have come up with future headset design of Nokia. They have created three concepts, Express, Share and Feel. The look of the Express design can be changes as per your preferences and tastes. The Feel handset is basically designed for couples as this pair helps in deep communication with touch replication. The share concept enables the cults to interact in a personalized code formed within their sub-groups. Like other products this one is also facing new challenges, but it will surely achieve its goal.&lt;br /&gt;&lt;/span&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFi0KbogcOI/AAAAAAAAAwk/a60kgcULMRo/s1600-h/provoke-2012-concept-phone1.jpg"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFi0KbogcOI/AAAAAAAAAwk/a60kgcULMRo/s320/provoke-2012-concept-phone1.jpg" alt="" id="BLOGGER_PHOTO_ID_5213114659990696162" border="0" /&gt;&lt;/a&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFi0KsBd0LI/AAAAAAAAAws/-7Rx16AhygY/s1600-h/provoke-2012-concept-phone2.jpg"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFi0KsBd0LI/AAAAAAAAAws/-7Rx16AhygY/s320/provoke-2012-concept-phone2.jpg" alt="" id="BLOGGER_PHOTO_ID_5213114664390348978" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:130%;" &gt;How To Get Your Symbian Applications Signed For Free [ Mobile]&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Its been a long time I wrote about Mobiles. So here is a useful post for you all.&lt;br /&gt;&lt;br /&gt;Sometimes when you try to install any Symbian application you get an error like this " ...............cannot be installed ".&lt;br /&gt;&lt;br /&gt;This is because your application is not signed. To get it signed, here is the solution.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Visit &lt;a href="http://www.mastiarea.com/f426/"&gt;this link&lt;/a&gt; to get your Symbian Applications Signed.&lt;br /&gt;&lt;br /&gt;Here the tutorial on &lt;a href="http://www.mastiarea.com/f426/how-sign-unsigned-applictions-19456.html"&gt;How to sign an unsigned Application&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Note : You can get all Symbian application signed. So visit and enjoy :)&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(255, 204, 51); font-weight: bold;"&gt;&lt;span style="font-size:180%;"&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Video&lt;/span&gt;&lt;br /&gt;&lt;div id="vu_ytplayer_vjVQa1PpcFOHXlflG7yRwqMX4Yxb-intMopqviGzR-c="&gt;&lt;a href="http://www.youtube.com/browse"&gt;Watch the latest videos on YouTube.com&lt;/a&gt;&lt;/div&gt;&lt;script type="text/javascript" src="http://www.youtube.com/cp/vjVQa1PpcFOHXlflG7yRwqMX4Yxb-intMopqviGzR-c="&gt;&lt;/script&gt;&lt;br /&gt;Reference : NOKIA&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-6064379590188733236?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RBCG_aRPoP9QJ3vnXueQ2aA2sDI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RBCG_aRPoP9QJ3vnXueQ2aA2sDI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RBCG_aRPoP9QJ3vnXueQ2aA2sDI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RBCG_aRPoP9QJ3vnXueQ2aA2sDI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=lkB0mfth"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=VnAXPhXs"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=fLIr33Ij"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=fLIr33Ij" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=rTk7C2s3"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=CIMtnjjn"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=CIMtnjjn" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=xENQc0m7"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=7iHQQ0JS"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=7iHQQ0JS" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=AFZa1Rio"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=GXc5my8l"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=GXc5my8l" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=yzbBsYD9"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/u0Jxs0PyyCw" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/u0Jxs0PyyCw/nokia.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFZy7NvFtRI/AAAAAAAAAuE/V9fHX3hTiS8/s72-c/morph_wrist_mode.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><enclosure url="http://nds3.nokia.com/NOKIA_COM_1/About_Nokia/Research/Demos/Morph/video/morph_concept_small.mov" length="48357044" type="video/quicktime" /><media:content url="http://nds3.nokia.com/NOKIA_COM_1/About_Nokia/Research/Demos/Morph/video/morph_concept_small.mov" fileSize="48357044" type="video/quicktime" /><itunes:explicit>no</itunes:explicit><itunes:subtitle>The Morph concept Launched alongside The Museum of Modern Art “Design and The Elastic Mind” exhibition, the Morph concept device is a bridge between highly advanced technologies and their potential benefits to end-users. This device concept showcases some</itunes:subtitle><itunes:author>sky.dodiya@gmail.com (SKY)</itunes:author><itunes:summary>The Morph concept Launched alongside The Museum of Modern Art “Design and The Elastic Mind” exhibition, the Morph concept device is a bridge between highly advanced technologies and their potential benefits to end-users. This device concept showcases some revolutionary leaps being explored by Nokia Research Center (NRC) in collaboration with the Cambridge Nanoscience Centre (United Kingdom) – nanoscale technologies that will potentially create a world of radically different devices that open up an entirely new spectrum of possibilities. Morph concept technologies might create fantastic opportunities for mobile devices: Newly-enabled flexible and transparent materials blend more seamlessly with the way we live Devices become self-cleaning and self-preservingTransparent electronics offering an entirely new aesthetic dimension Built-in solar absorption might charge a device, whilst batteries become smaller, longer lasting and faster to charge Integrated sensors might allow us to learn more about the environment around us, empowering us to make better choices In addition to the advances above, the integrated electronics shown in the Morph concept could cost less and include more functionality in a much smaller space, even as interfaces are simplified and usability is enhanced. All of these new capabilities will unleash new applications and services that will allow us to communicate and interact in unprecedented ways. Flexible &amp;amp; Changing Design Nanotechnology enables materials and components that are flexible, stretchable, transparent and remarkably strong. Fibril proteins are woven into a three dimensional mesh that reinforces thin elastic structures. Using the same principle behind spider silk, this elasticity enables the device to literally change shapes and configure itself to adapt to the task at hand. A folded design would fit easily in a pocket and could lend itself ergonomically to being used as a traditional handset. An unfolded larger design could display more detailed information, and incorporate input devices such as keyboards and touch pads. Even integrated electronics, from interconnects to sensors, could share these flexible properties. Further, utilization of biodegradable materials might make production and recycling of devices easier and ecologically friendly.Self-Cleaning Nanotechnology also can be leveraged to create self-cleaning surfaces on mobile devices, ultimately reducing corrosion, wear and improving longevity. Nanostructured surfaces, such as “Nanoflowers” naturally repel water, dirt, and even fingerprints utilizing effects also seen in natural systems. Advanced Power Sources Nanotechnology holds out the possibility that the surface of a device will become a natural source of energy via a covering of “Nanograss” structures that harvest solar power. At the same time new high energy density storage materials allow batteries to become smaller and thinner, while also quicker to recharge and able to endure more charging cycles.Sensing The Environment Nanosensors would empower users to examine the environment around them in completely new ways, from analyzing air pollution, to gaining insight into bio-chemical traces and processes. New capabilities might be as complex as helping us monitor evolving conditions in the quality of our surroundings, or as simple as knowing if the fruit we are about to enjoy should be washed before we eat it. Our ability to tune into our environment in these ways can help us make key decisions that guide our daily actions and ultimately can enhance our health.Press MaterialView press releaseView and download photosView Morph video (.mov, 46mb) Other resources To learn more about the “Design and The Elastic Mind” exhibition at The Museum of Modern Art visit MoMA webpage To learn more about the Cambridge Nanoscience Centre visit http://www.nanoscience.cam.ac.uk/ Provoke 2012 Phone Concept Provoke Design is Nokia’s main Design contractor and they have come up with future headset de</itunes:summary><itunes:keywords>iPhone,Sony,Ericssion,Nokia</itunes:keywords><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/nokia.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-691001093851379835</guid><pubDate>Sun, 15 Jun 2008 08:26:00 +0000</pubDate><atom:updated>2008-06-15T02:15:38.160-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">JSF</category><title>Java Server Faces</title><description>JavaServer Faces (JSF) is a standardized specification for building User Interfaces (UI) for server-side applications. Before JavaServer Faces, developers who built web applications often relied on building HTML user interface components with servlets or JavaServer Pages (JSP pages). This is mainly because HTML user interface components are the lowest common denominator that web browsers support. The implication, of course, is that such web applications do not have rich user interfaces, compared with standalone fat clients, and therefore less functionality and/or poor usability. While applets can be used to develop rich user interfaces, web application developers don't always know what clients will be accessing the application and/or they may have no access to the client device. &lt;p&gt; In addition, if you have taken part in developing a large-scale web system, you may have come across technical challenges, such as how to implement custom components like a query builder or a table viewer for building database queries. Building such custom components requires expertise and a significant amount of time to build and test the new libraries. In an ideal environment, developers would be able to use pre-built, tested, and highly configurable components to integrate into their application development environment.&lt;/p&gt; &lt;p&gt; &lt;a href="http://java.sun.com/j2ee/javaserverfaces/"&gt;JavaServer Faces&lt;/a&gt; (JSF) is a server-side technology for developing web applications with rich user interfaces. With JSF, you can resolve such technical challenges as creating custom user interface components. This is because JSF technology is a user interface framework for building Java-based web applications that run on the server side, and render the user interface back to the client. That's right! The user interface code runs on the server, responding to events generated on the client. &lt;/p&gt; &lt;p&gt; Rich user interfaces consist of a set of rich components. There are a number of options out there today for building rich server-side user interfaces, such as Flash, Swinglets, and Jade. However, these solutions are proprietary; the tools and runtimes that support their development are usually only available through a single vendor. JSF is, above all, a standard, which means that the developer does not get locked into a single vendor. The specification expert group is actually made up of representatives from all the major tool vendors in the Java community. Thus, developers will have no shortage of choices for tools, and probably will be able to use an updated version of a tool they are using today. While the tool vendors are cooperating on the specification, they will compete with each other in their implementations. This will benefit the developer community in terms of features and in the choice of custom components each vendor makes available. Tool Vendors provide an Integrated Development Environment (IDE) to help you build and deploy your JSF applications. The following vendors offer tools to support JSF development. &lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://developers.sun.com/prodtech/javatools/jscreator/index.jsp"&gt;Sun Java Studio Creator&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.borland.com/jbuilder/"&gt;Borland JBuilder&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www-306.ibm.com/software/info1/websphere/index.jsp"&gt;IBM Websphere&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://otn.oracle.com/products/jdev/index.html"&gt;Oracle JDeveloper&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; Component Vendors provide reusable building blocks for application development and integration into JSF-based tools. Components cover a wide range of uses including reporting, charts and graphs, fields, and navigational components. Here are some of the vendors who offer components that support the JavaServer Faces specification.&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;a href="http://www.otrix.com/products"&gt;Otrix WebMenu&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.ilog.com/products/jviews"&gt;ILOG JViews&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.quest.com/jclass"&gt;Quest Software JClass&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.chartfx.com/SfxJavaProducts/"&gt;Software FX Chart FX&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; JavaServer Faces technology is based on the Model View Controller (MVC) architecture for separating logic from presentation, so if you have been practicing this, you'll feel at home with JSF.&lt;/p&gt; &lt;p&gt; This article provides a fast-track, code-intensive tutorial to get you started with JSF. The article also:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;Provides an introduction to JSF&lt;/li&gt;&lt;li&gt;Describes the benefits of JSF&lt;/li&gt;&lt;li&gt;Describes the internals of JSF&lt;/li&gt;&lt;li&gt;Describes the genesis of JSF applications&lt;/li&gt;&lt;li&gt;Gives you a taste of the effort involved in developing JSF applications&lt;/li&gt;&lt;li&gt;Provides sample code that you can adapt for your own applications&lt;/li&gt;&lt;li&gt;Discuss the JSF support in the Sun Java Studio Creator IDE&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; If you are looking for more advanced topics, please see &lt;a href="http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html"&gt;Chapters 17 - 21 of the J2EE 1.4 Tutorial&lt;/a&gt;.&lt;/p&gt; &lt;div class="contentdivider"&gt;&lt;b&gt;Overview of JavaServer Faces&lt;/b&gt;&lt;table class="grey4" border="0" cellpadding="0" cellspacing="0" width="100%"&gt; &lt;tbody&gt; &lt;tr&gt;  &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;&lt;/div&gt; &lt;p&gt; JavaServer Faces (JSF) is a technology that is being led by Sun Microsystems as &lt;a href="http://www.jcp.org/en/jsr/detail?id=127"&gt;JSR 127&lt;/a&gt; under the &lt;a href="http://jcp.org/en/home/index"&gt;Java Community Process (JCP)&lt;/a&gt;. The objective is to create a standard framework for user interface components for web applications. As mentioned earlier, JSF lets you build web applications that run on a Java server and render the user interface back to the client. This technology provides web application lifecycle management through a controller servlet, and a rich component model with event handling and component rendering.&lt;/p&gt; &lt;p&gt;To get started using JavaServer Faces, the first thing you should do is download a JavaServer Faces compatible implementation. All of the tool vendors listed above provide a JavaServer Faces compatible development and runtime environment. You can get a FREE JavaServer Faces Compatible runtime environment by downloading the &lt;a href="http://java.sun.com/j2ee/1.4/download.html#sdk"&gt;J2EE 1.4 SDK&lt;/a&gt;, which includes support for JavaServer Faces. you can also get a copy of &lt;a href="http://developers.sun.com/prodtech/javatools/jscreator/index.jsp"&gt;Java Studio Creator&lt;/a&gt; from Sun as part of your &lt;a href="http://developers.sun.com/aboutsdn/aboutsdnstandard.html"&gt;subscription&lt;/a&gt; to the Sun Developer Network. &lt;/p&gt; &lt;p&gt; Note that as a minimum requirement, JSF runs on Servlet 2.3 and JSP 1.2. Figure 1 depicts the high-level architecture of JSF.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFTSxtEdvgI/AAAAAAAAAsc/rII40caGZU0/s1600-h/fig1.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFTSxtEdvgI/AAAAAAAAAsc/rII40caGZU0/s320/fig1.gif" alt="" id="BLOGGER_PHOTO_ID_5212022420128251394" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; The JSF technology consists of two main components:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Java APIs to represent UI components, manage state, handle events, and validate input. The API has support for internationalization and accessibility.&lt;/li&gt;&lt;li&gt;Two JSP custom tag libraries for expressing user interface (UI) components within a JSP page, and for wiring components to server-side objects. Page authors can easily add UI components to their pages.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt; Figure 2 shows the relationship between the client, the server, and JSF.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFTTNbjf_nI/AAAAAAAAAsk/HnnYeMZZoUI/s1600-h/fig2.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFTTNbjf_nI/AAAAAAAAAsk/HnnYeMZZoUI/s320/fig2.gif" alt="" id="BLOGGER_PHOTO_ID_5212022896462921330" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt; Here, the JSP page represents the user interface components using the JSF custom tag library, rather than hard coding them with a markup language. The UI for the application manages the objects rendered by the JSP page.&lt;/p&gt; &lt;p&gt; Several types of users can benefit from this technology, including:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;i&gt;Page authors&lt;/i&gt; who use markup languages, such as HTML, will use the JSP tag library for expressing JavaServer Faces rich user interface components.&lt;/li&gt;&lt;li&gt;&lt;i&gt;Application developers&lt;/i&gt; who write the model objects and event handlers.&lt;/li&gt;&lt;li&gt;&lt;i&gt;Component developers&lt;/i&gt; who will create custom components based on the JSF components.&lt;/li&gt;&lt;li&gt;&lt;i&gt;Tools vendors&lt;/i&gt; who will provide tools that incorporate JSF technology into a new generation of tools that simplify the development of multi tier, web-based applications.&lt;/li&gt;&lt;li&gt;&lt;i&gt;Application Server vendors&lt;/i&gt; who provide a runtime environment that incorporates JSF technology into a new generation of Application Servers that can deploy multi tier, web-based applications that use JSF technology.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; This technology also opens up the market for reusable web user interface components. Developers and vendors can use JSF as the building blocks for developing custom faces.&lt;/p&gt; &lt;p&gt; One of the advantages of JSF is that it is based on the Model View Controller (MVC) architecture, to offer a clean separation between presentation and logic. This may ring a bell for those who are using existing web frameworks such as &lt;a href="http://jakarta.apache.org/struts/"&gt;Struts&lt;/a&gt;. However, note that JSF and Struts are not competing technologies, and in fact, they interoperate together. JSF, however, does have some advantages over Struts. For example, in Struts there is only one way to render an element, while JSF provides several mechanisms for rendering an individual element. It is up to the page designer to pick the desired representation, and the application developer doesn't need to know which mechanism was used to render a component. (Here's a link for more information on the &lt;a href="http://jakarta.apache.org/struts/proposals/struts-faces.html"&gt;integration of JSF and Struts&lt;/a&gt;.) Readers may notice that the author of Struts, Craig McClanahan, is also the co-specification lead for JSF, as well as an employee of Sun Microsystems.&lt;br /&gt;&lt;/p&gt;&lt;div&gt; &lt;b class="dkgrey"&gt;Genesis of a JSF Application&lt;/b&gt;&lt;br /&gt;&lt;/div&gt; &lt;p&gt; A JSF application is just like any other Java technology-based web application; it runs in a Java servlet container, and contains:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;JavaBeans components (or model objects) containing application-specific functionality and data&lt;/li&gt;&lt;li&gt;Event listeners&lt;/li&gt;&lt;li&gt;JSP pages&lt;/li&gt;&lt;li&gt;Server-side helper classes&lt;/li&gt;&lt;li&gt;A custom tag library for rendering UI components&lt;/li&gt;&lt;li&gt;A custom tag library for representing event handlers and validators&lt;/li&gt;&lt;li&gt;UI components represented as stateful objects on the server&lt;/li&gt;&lt;li&gt;Validators, event handlers, and navigation handlers. (Validators are used to validate data on individual components before the server-side data is updated.)&lt;/li&gt;&lt;li&gt;Application configuration resource file for configuring application resources&lt;/li&gt;&lt;/ol&gt; &lt;p&gt; Here is a simple example using the tag libraries. For a list of component tags support and other information on JSF, please refer to the &lt;a href="http://www.jcp.org/en/jsr/detail?id=127"&gt;JavaServer Faces specification&lt;/a&gt; and &lt;a href="http://java.sun.com/j2ee/1.4/docs/tutorial/doc/index.html"&gt;Chapter 17 - 21 of the J2EE 1.4 Tutorial&lt;/a&gt;&lt;/p&gt; &lt;!-- BEGIN VCD7 CODE SAMPLE COMPONENT  --&gt; &lt;table class="grey4" border="0" cellpadding="10" cellspacing="0" width="100%"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre&gt;&amp;lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %&amp;gt;&lt;br /&gt;&amp;lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %&amp;gt;&lt;br /&gt;&amp;lt;body bgcolor="white"&amp;gt;&lt;br /&gt;&amp;lt;f:view&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;h:form id="helloform"&amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt;What is your name?&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;h:inputText id="username" value="#{UserNameBean.userName}"&lt;br /&gt;    validator="#{UserNameBean.validate}"/&amp;gt;&lt;br /&gt;&amp;lt;h:commandButton id="submit" action="success" value="Submit"/&amp;gt;&lt;br /&gt;&amp;lt;/h:form&amp;gt;&lt;br /&gt;&amp;lt;/f:view&amp;gt;&lt;br /&gt;&lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;span class="sp20"&gt; &lt;/span&gt;&lt;br /&gt;&lt;!-- END VCD7 CODE SAMPLE COMPONENT  --&gt; &lt;p&gt;The JSF component architecture is designed in such a way that the component classes maintain a component's state. A renderkit defines how component classes map to component tags appropriate for a particular client. The JSF reference implementation, which is discussed later, includes a standard RenderKit for rendering to an HTML client. Each JSP component in the HTML RenderKit is composed of the component functionality defined by the &lt;code&gt;UIComponent&lt;/code&gt; class, and the rendering attributes defined by the &lt;code&gt;Renderer&lt;/code&gt;. For example, the tags &lt;code&gt;commandButton&lt;/code&gt; and &lt;code&gt;commandHyperlink&lt;/code&gt; both represent a &lt;code&gt;UIComponent&lt;/code&gt;, but they are rendered in two different ways. The button component is rendered as a button and the hyperlink is rendered as a hyperlink.&lt;/p&gt; &lt;p&gt; When a JSP page is created using JSF components, a component tree or a &lt;code&gt;view&lt;/code&gt; is built into memory on the server with each component tag corresponding to a &lt;code&gt;UIComponent&lt;/code&gt; instance in the tree. The component tree is used by the JSF framework to handle your application request and create a rendered response. When an event is generated (for example, user clicks on a button), the JSF lifecycle handles the event and generates an appropriate response. Note that the entry point into the JSF framework is the &lt;code&gt;FacesServlet&lt;/code&gt;. It acts as the front controller and handles request processing lifecycle.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;b&gt;The JSF reference implementation 1.1&lt;/b&gt; comes with the following: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;code&gt;html_basic.tld&lt;/code&gt;: A JSP custom tag library for building JSF applications that render to an HTML client&lt;/li&gt;&lt;li&gt;&lt;code&gt;jsf_core.tld&lt;/code&gt;: A JSP custom tag library for representing core actions independent of a particular render kit&lt;/li&gt;&lt;li&gt;APIs that provide user interface components, model object management, pluggable rendering, server-side validation, data conversion, event processing, page flow management, and custom extensibility for all of these features&lt;/li&gt;&lt;li&gt;A set of demos located in the &lt;code&gt;samples&lt;/code&gt; directory of the installation&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; The JSF Reference Implementation 1.1 can be downloaded &lt;a href="http://java.sun.com/j2ee/javaserverfaces/download.html"&gt;here&lt;/a&gt;. When you unzip the archive, you'll get a directory structure like this (under Windows):&lt;/p&gt; &lt;!-- BEGIN VCD7 CODE SAMPLE COMPONENT  --&gt; &lt;table class="grey4" border="0" cellpadding="10" cellspacing="0" width="100%"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre&gt;c:\jsf-1_1&gt;&lt;br /&gt;\docs&lt;br /&gt;\javadocs&lt;br /&gt;\lib&lt;br /&gt;\metadata&lt;br /&gt;\renderkitdocs&lt;br /&gt;\samples&lt;br /&gt;\tlddocs&lt;br /&gt;some-other-files&lt;br /&gt;&lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;span class="sp20"&gt; &lt;/span&gt;&lt;br /&gt;&lt;!-- END VCD7 CODE SAMPLE COMPONENT  --&gt; &lt;p&gt;The &lt;code&gt;example&lt;/code&gt; directory contains WAR and source files for sample applications. The &lt;code&gt;lib&lt;/code&gt; directory contains the JAR files that JSF depends on. The JAR files are:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;&lt;code&gt;commons-beanutils.jar&lt;/code&gt;: Utilities for defining and accessing JavaBeans component properties&lt;/li&gt;&lt;li&gt;&lt;code&gt;commons-collections.jar&lt;/code&gt;: Extensions of the J2SE Collections Framework&lt;/li&gt;&lt;li&gt;&lt;code&gt;commons-digester.jar&lt;/code&gt;: For processing XML documents&lt;/li&gt;&lt;li&gt;&lt;code&gt;commons-logging.jar&lt;/code&gt;: A general purpose, flexible logging facility to allow developers to instrument their code with logging statements&lt;/li&gt;&lt;li&gt;&lt;code&gt;jsf-api.jar&lt;/code&gt;: Contains the &lt;code&gt;javax.faces.*&lt;/code&gt; API classes&lt;/li&gt;&lt;li&gt;&lt;code&gt;jsf-impl.jar&lt;/code&gt;: Contains the implementation classes of the JSF Reference Implementation&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; Note that the JSF framework uses the JavaServer Pages Standard Tag Library (JSTL), and therefore it is assumed that the web container you use provides the necessary JAR files for JSTL.&lt;/p&gt; &lt;p&gt; The JSF RI can be easily set up to be used with virtually any web container. The RI comes with installations instructions on how to use it with Apache Tomcat, Java WSDP 1.3, and Sun Java System Application Server Platform Edition 8. The installation process is usually a matter of copying some JAR files, such as &lt;code&gt;jsf-api.jar&lt;/code&gt; and &lt;code&gt;jsf-impl.jar&lt;/code&gt; from the &lt;code&gt;lib&lt;/code&gt; directory of the JSF RI to your web container's &lt;code&gt;lib&lt;/code&gt; directory. For this article, however, the Sun Java Application Server Platform Edition 8 that comes with the Sun Java Studio Creator was used. The Sun Java Application Server Edition 8 can be downloaded from &lt;a href="http://java.sun.com/j2ee/1.4/download.html/"&gt;here&lt;/a&gt; and this already includes support for JSF.&lt;/p&gt; &lt;p&gt; If you are using the Sun Java Application Server Edition 8, you can easily get started by deploying the sample applications that come with the JSF RI by following these two simple steps:&lt;/p&gt; &lt;ol&gt;&lt;li&gt;Start the application server&lt;/li&gt;&lt;li&gt;Deploy the &lt;code&gt;.war&lt;/code&gt; files from the &lt;code&gt;samples&lt;/code&gt; directory of your JSF RI onto the application server. This can be done using the &lt;code&gt;deploytool&lt;/code&gt; or by running &lt;code&gt;asant deploy&lt;/code&gt;, but the easiest way is to copy the &lt;code&gt;.war&lt;/code&gt; files to the &lt;code&gt;autodeploy&lt;/code&gt; directory (on my machine, this directory is &lt;code&gt;C:\Sun-Studio-Creator\SunAppServer8\domains\creator\autodeploy&lt;/code&gt;.&lt;/li&gt;&lt;/ol&gt; &lt;p&gt; Now, you can start your favorite web browser and enter a URL to run a sample JSF application: &lt;code&gt;http://localhost:18080/&lt;/code&gt;&lt;b&gt;&lt;code&gt;jsf-guessNumber&lt;/code&gt;&lt;/b&gt; or any other sample application that starts with &lt;code&gt;jsf-&lt;/code&gt;. Here is a sample output:&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFTUum77bEI/AAAAAAAAAss/413HUNKdZc4/s1600-h/fig3.gif"&gt;&lt;img style="cursor: pointer;" src="http://4.bp.blogspot.com/_vJc4QlgRE6c/SFTUum77bEI/AAAAAAAAAss/413HUNKdZc4/s320/fig3.gif" alt="" id="BLOGGER_PHOTO_ID_5212024565965483074" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;br /&gt;Understanding JavaServer Faces&lt;/b&gt;&lt;/div&gt; &lt;div class="contentdivider"&gt; &lt;table class="grey4" border="0" cellpadding="0" cellspacing="0" width="100%"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt;&lt;img src="http://java.sun.com/im/a.gif" alt=" " border="0" height="4" width="1" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;&lt;br /&gt;&lt;/div&gt; &lt;p&gt; This section describes a sample application, a guessing number game, that comes with the JSF RI. The application, as shown in Figure 3 above, asks you to guess a number between 0 and 10, inclusive. If you enter the wrong number, you'll see something similar to Figure 4, and when you finally enter the right number, you'll see something similar to Figure 5. This application will give you a taste of the effort involved in developing web applications using the JSF technology.&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFTVELbvQWI/AAAAAAAAAs0/SfKHt_puQv4/s1600-h/fig4.gif"&gt;&lt;img style="cursor: pointer;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFTVELbvQWI/AAAAAAAAAs0/SfKHt_puQv4/s320/fig4.gif" alt="" id="BLOGGER_PHOTO_ID_5212024936539832674" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFTVTICs-rI/AAAAAAAAAs8/ro5eoJhqefk/s1600-h/fig5.gif"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFTVTICs-rI/AAAAAAAAAs8/ro5eoJhqefk/s320/fig5.gif" alt="" id="BLOGGER_PHOTO_ID_5212025193327557298" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt; A JSF application consists of the following files:&lt;/p&gt; &lt;ul&gt;&lt;li&gt;JSP pages with JSF components representing the UI&lt;/li&gt;&lt;li&gt;JavaBeans to hold the model data&lt;/li&gt;&lt;li&gt;Application configuration files specifying the JSF controller servlet, managed beans, and navigation handles&lt;/li&gt;&lt;/ul&gt; &lt;div&gt; &lt;b class="dkgrey"&gt;The JSP Pages&lt;/b&gt;&lt;br /&gt;&lt;/div&gt; &lt;p&gt; In the guess number sample application, three JSP pages are used: &lt;code&gt;index.jsp&lt;/code&gt;, &lt;code&gt;greeting.jsp&lt;/code&gt;, and &lt;code&gt;response.jsp&lt;/code&gt;. Let's start with the &lt;code&gt;index.jsp&lt;/code&gt; page.&lt;/p&gt; &lt;p&gt; &lt;b&gt;The index.jsp page&lt;/b&gt;: This page is shown in Code Sample 1.&lt;/p&gt; &lt;p&gt; &lt;b&gt;Code Sample 1&lt;/b&gt;: index.jsp&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt; &amp;lt;body&amp;gt;&lt;br /&gt;   &amp;lt;jsp:forward page="guess/greeting.jsp" /&amp;gt;&lt;br /&gt; &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;!-- END VCD7 CODE SAMPLE COMPONENT  --&gt; &lt;p&gt;As you can see, this page simply forwards the user to the main page, &lt;code&gt;greeting.jsp&lt;/code&gt;, and therefore in your application you can do without it.&lt;/p&gt;&lt;br /&gt;&lt;p&gt; &lt;b&gt;The greeting.jsp page&lt;/b&gt;: This is the main page presented to the user, which is shown in Figure 3 above. Code Sample 2 shows the content of this page.&lt;/p&gt; &lt;p&gt; &lt;b&gt;Code Sample 2&lt;/b&gt;: greeting.jsp&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;html&amp;gt;&lt;br /&gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Hello&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %&amp;gt;&lt;br /&gt;&amp;lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %&amp;gt;&lt;br /&gt;&amp;lt;body bgcolor="white"&amp;gt;&lt;br /&gt;&amp;lt;f:view&amp;gt;&lt;br /&gt;&amp;lt;h:form id="helloForm" &amp;gt;&lt;br /&gt;&amp;lt;h2&amp;gt;Hi. My name is Duke.  I'm thinking of a number from&lt;br /&gt;&amp;lt;h:outputText value="#{UserNumberBean.minimum}"/&amp;gt; to&lt;br /&gt;&amp;lt;h:outputText value="#{UserNumberBean.maximum}"/&amp;gt;.&lt;br /&gt;  Can you guess it?&amp;lt;/h2&amp;gt;&lt;br /&gt;&amp;lt;h:graphicImage id="waveImg" url="/wave.med.gif" /&amp;gt;&lt;br /&gt;&amp;lt;h:inputText id="userNo" value="#{UserNumberBean.userNumber}"&lt;br /&gt;          validator="#{UserNumberBean.validate}"/&amp;gt;     &lt;br /&gt;&amp;lt;h:commandButton id="submit" action="success"&lt;br /&gt; value="Submit" /&amp;gt;&lt;br /&gt;&amp;lt;p&amp;gt;&lt;br /&gt;&amp;lt;h:message style="color: red; font-family: 'New Century Schoolbook',&lt;br /&gt;  serif; font-style: oblique; text-decoration: overline"&lt;br /&gt;   id="errors1" for="userNo"/&amp;gt;&lt;br /&gt;&amp;lt;/h:form&amp;gt;&lt;br /&gt;&amp;lt;/f:view&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The &lt;code&gt;greeting.jsp&lt;/code&gt; page demonstrates several features that you will use in most of your JSF applications. These are: &lt;/p&gt; &lt;ul&gt;&lt;li&gt;In order to use JSF tags, you need to include the &lt;code&gt;taglib&lt;/code&gt; directives to the &lt;code&gt;html&lt;/code&gt; and &lt;code&gt;core&lt;/code&gt; tag libraries that refer to the standard HTML renderkit tag library, and the JSF core tag library, respectively.&lt;/li&gt;&lt;li&gt;A page containing JSF tags is represented by a tree of components whose root is the &lt;code&gt;UIViewRoot&lt;/code&gt;, which is represented by the &lt;code&gt;view&lt;/code&gt; tag. All component tags must be enclosed in the &lt;code&gt;view&lt;/code&gt; tag. Other content such as HTML and other JSP pages can be enclosed within that tag.&lt;/li&gt;&lt;li&gt;A typical JSP page includes a form, which is submitted when a button is clicked. The tags representing the form components (such as textfields and buttons) must be nested inside the &lt;code&gt;form&lt;/code&gt; tag.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;outputText&lt;/code&gt; tag represents a label. The &lt;code&gt;greeting.jsp&lt;/code&gt; page has two such tags that display the numbers 0 and 10. The &lt;code&gt;value&lt;/code&gt; attribute of the tag gets the values from the &lt;code&gt;minimum&lt;/code&gt; and &lt;code&gt;maximum&lt;/code&gt; properties of a bean class, &lt;code&gt;UserNumberBean&lt;/code&gt;, using value-binding expressions that have the syntax &lt;code&gt;#{bean-managed-property}&lt;/code&gt;&lt;/li&gt;&lt;li&gt;The &lt;code&gt;graphicImage&lt;/code&gt; tag is used to reference an image.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;inputText&lt;/code&gt; tag represents an input text field component. The &lt;code&gt;id&lt;/code&gt; attribute represents the ID of the component object represented by this tag, and if it is missing, then the implementation will generate one. The &lt;code&gt;validator&lt;/code&gt; attribute refers to a method-binding expression pointing to a backing bean method that performs validation on the component's data.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;commandButton&lt;/code&gt; tag represents the button used to submit the data entered in the text field. The &lt;code&gt;action&lt;/code&gt; attribute helps the navigation mechanism to decide which page to open next.&lt;/li&gt;&lt;li&gt;The &lt;code&gt;message&lt;/code&gt; tag displays an error message if the data entered is not valid. The &lt;code&gt;for&lt;/code&gt; attribute refers to the component whose value failed validation.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt; &lt;b&gt;The response.jsp page&lt;/b&gt;: This page, which is similar to Figure 4 and 4 above, is displayed as a response to the user's clicking the &lt;code&gt;Submit&lt;/code&gt; button. Code Sample 3 shows the content of this page whose tags have already been explained.&lt;/p&gt; &lt;p&gt; &lt;b&gt;Code Sample 3&lt;/b&gt;: response.jsp&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;html&amp;gt;&lt;br /&gt;   &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;Guess The Number&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;&lt;br /&gt;   &amp;lt;%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %&amp;gt;&lt;br /&gt;   &amp;lt;%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %&amp;gt;&lt;br /&gt;       &amp;lt;body bgcolor="white"&amp;gt;&lt;br /&gt;             &amp;lt;f:view&amp;gt;&lt;br /&gt;                 &amp;lt;h:form id="responseForm" &amp;gt;&lt;br /&gt;                     &amp;lt;h:graphicImage id="waveImg" url="/wave.med.gif" /&amp;gt;&lt;br /&gt;                     &amp;lt;h2&amp;gt;&amp;lt;h:outputText id="result"&lt;br /&gt;                     value="#{UserNumberBean.response}"/&amp;gt;&amp;lt;/h2&amp;gt;&lt;br /&gt;                     &amp;lt;h:commandButton id="back" value="Back" action="success"/&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;                 &amp;lt;/h:form&amp;gt;&lt;br /&gt;             &amp;lt;/f:view&amp;gt;&lt;br /&gt;     &amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/p&gt;&lt;div&gt;&lt;b class="dkgrey"&gt;The Model Object&lt;/b&gt; &lt;/div&gt; &lt;p&gt; A typical JSF application uses a bean with each page in the application. The bean defines the properties and methods associated with the UI components used on the page. A bean can also define a set of methods that perform functions, such as validating the component's data, for the component. The model object bean is like any other JavaBeans component: it has a set of accessor methods. Code Sample 4 shows a sample JavaBean component, which is referenced in the &lt;code&gt;greeting.jsp&lt;/code&gt; and &lt;code&gt;response.jsp&lt;/code&gt; pages.&lt;/p&gt; &lt;p&gt; &lt;b&gt;Code Sample 4&lt;/b&gt;: UserNumberBean.java&lt;/p&gt;&lt;pre&gt;package guessNumber;&lt;br /&gt;import javax.faces.component.UIComponent;&lt;br /&gt;import javax.faces.context.FacesContext;&lt;br /&gt;import javax.faces.validator.LongRangeValidator;&lt;br /&gt;import javax.faces.validator.Validator;&lt;br /&gt;import javax.faces.validator.ValidatorException;&lt;br /&gt;import java.util.Random;&lt;br /&gt;public class UserNumberBean {&lt;br /&gt;Integer userNumber = null;&lt;br /&gt;Integer randomInt = null;&lt;br /&gt;String response = null;&lt;br /&gt;public UserNumberBean() {&lt;br /&gt;   Random randomGR = new Random();&lt;br /&gt;   randomInt = new Integer(randomGR.nextInt(10));&lt;br /&gt;   System.out.println("Duke's number: " + randomInt);&lt;br /&gt;}&lt;br /&gt;public void setUserNumber(Integer user_number) {&lt;br /&gt;   userNumber = user_number;&lt;br /&gt;   System.out.println("Set userNumber " + userNumber);&lt;br /&gt;}&lt;br /&gt;public Integer getUserNumber() {&lt;br /&gt;   System.out.println("get userNumber " + userNumber);&lt;br /&gt;   return userNumber;&lt;br /&gt;}&lt;br /&gt;public String getResponse() {&lt;br /&gt;   if (userNumber != null &amp;amp;&amp;amp; userNumber.compareTo(randomInt) == 0) {&lt;br /&gt;       return "Yay! You got it!";&lt;br /&gt;   } else {&lt;br /&gt;       return "Sorry, " + userNumber + " is incorrect.";&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;protected String[] status = null;&lt;br /&gt;public String[] getStatus() {&lt;br /&gt;   return status;&lt;br /&gt;}&lt;br /&gt;public void setStatus(String[] newStatus) {&lt;br /&gt;   status = newStatus;&lt;br /&gt;}&lt;br /&gt;private int maximum = 0;&lt;br /&gt;private boolean maximumSet = false;&lt;br /&gt;public int getMaximum() {&lt;br /&gt;   return (this.maximum);&lt;br /&gt;}&lt;br /&gt;public void setMaximum(int maximum) {&lt;br /&gt;   this.maximum = maximum;&lt;br /&gt;   this.maximumSet = true;&lt;br /&gt;}&lt;br /&gt;private int minimum = 0;&lt;br /&gt;private boolean minimumSet = false;&lt;br /&gt;public int getMinimum() {&lt;br /&gt;   return (this.minimum);&lt;br /&gt;}&lt;br /&gt;public void setMinimum(int minimum) {&lt;br /&gt;   this.minimum = minimum;&lt;br /&gt;   this.minimumSet = true;&lt;br /&gt;}&lt;br /&gt;public void validate(FacesContext context,&lt;br /&gt;                    UIComponent component,&lt;br /&gt;                    Object value) throws ValidatorException {&lt;br /&gt;   if ((context == null) || (component == null)) {&lt;br /&gt;       throw new NullPointerException();&lt;br /&gt;   }&lt;br /&gt;   if (value != null) {&lt;br /&gt;       try {&lt;br /&gt;           int converted = intValue(value);&lt;br /&gt;           if (maximumSet &amp;amp;&amp;amp;&lt;br /&gt;               (converted &gt; maximum)) {&lt;br /&gt;               if (minimumSet) {&lt;br /&gt;                   throw new ValidatorException(&lt;br /&gt;                       MessageFactory.getMessage&lt;br /&gt;                       (context, component,&lt;br /&gt;                        Validator.NOT_IN_RANGE_MESSAGE_ID,&lt;br /&gt;                        new Object[]{&lt;br /&gt;                            new Integer(minimum),&lt;br /&gt;                            new Integer(maximum)&lt;br /&gt;                        }));&lt;br /&gt;               } else {&lt;br /&gt;                   throw new ValidatorException(&lt;br /&gt;                       MessageFactory.getMessage&lt;br /&gt;                       (context, component,&lt;br /&gt;                        LongRangeValidator.MAXIMUM_MESSAGE_ID,&lt;br /&gt;                        new Object[]{&lt;br /&gt;                            new Integer(maximum)&lt;br /&gt;                        }));&lt;br /&gt;               }&lt;br /&gt;           }&lt;br /&gt;           if (minimumSet &amp;amp;&amp;amp;&lt;br /&gt;               (converted &lt;&gt;&lt;div&gt;&lt;b class="dkgrey"&gt;Application Configuration Resource File&lt;/b&gt; &lt;/div&gt; &lt;p&gt; An application configuration resource file, &lt;code&gt;faces-config.xml&lt;/code&gt;, is used to define your managed beans, validators, converters, and navigation rules. Code Sample 5 shows the &lt;code&gt;faces-config.xml&lt;/code&gt; file for the guess number application that defines navigation rules and the mapping of managed beans.&lt;/p&gt; &lt;p&gt; &lt;b&gt;Code Sample 5&lt;/b&gt;: faces-config.xml&lt;br /&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE faces-config PUBLIC&lt;br /&gt;"-//Sun Microsystems, Inc.//DTD JSF Config 1.1//EN"&lt;br /&gt;"http://java.sun.com/dtd/web-facesconfig_1_1.dtd"&amp;gt;&lt;br /&gt;&amp;lt;faces-config&amp;gt;&lt;br /&gt;&amp;lt;application&amp;gt;&lt;br /&gt;&amp;lt;locale-config&amp;gt;&lt;br /&gt; &amp;lt;default-locale&amp;gt;en&amp;lt;/default-locale&amp;gt;&lt;br /&gt; &amp;lt;supported-locale&amp;gt;de&amp;lt;/supported-locale&amp;gt;&lt;br /&gt; &amp;lt;supported-locale&amp;gt;fr&amp;lt;/supported-locale&amp;gt;&lt;br /&gt; &amp;lt;supported-locale&amp;gt;es&amp;lt;/supported-locale&amp;gt;&lt;br /&gt;&amp;lt;/locale-config&amp;gt;&lt;br /&gt;&amp;lt;/application&amp;gt;&lt;br /&gt;&amp;lt;navigation-rule&amp;gt;&lt;br /&gt;&amp;lt;description&amp;gt;&lt;br /&gt;&lt;br /&gt;   The decision rule used by the NavigationHandler to&lt;br /&gt;   determine which view must be displayed after the&lt;br /&gt;   current view, greeting.jsp is processed.&lt;br /&gt;&lt;br /&gt;&amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;from-view-id&amp;gt;/greeting.jsp&amp;lt;/from-view-id&amp;gt;&lt;br /&gt;&amp;lt;navigation-case&amp;gt;&lt;br /&gt;   &amp;lt;description&amp;gt;&lt;br /&gt;&lt;br /&gt;       Indicates to the NavigationHandler that the response.jsp&lt;br /&gt;       view must be displayed if the Action referenced by a&lt;br /&gt;       UICommand component on the greeting.jsp view returns&lt;br /&gt;       the outcome "success".&lt;br /&gt;&lt;br /&gt;   &amp;lt;/description&amp;gt;&lt;br /&gt; &amp;lt;from-outcome&amp;gt;success&amp;lt;/from-outcome&amp;gt;&lt;br /&gt; &amp;lt;to-view-id&amp;gt;/response.jsp&amp;lt;/to-view-id&amp;gt;&lt;br /&gt;&amp;lt;/navigation-case&amp;gt;&lt;br /&gt;&amp;lt;/navigation-rule&amp;gt;&lt;br /&gt;&amp;lt;navigation-rule&amp;gt;&lt;br /&gt;&amp;lt;description&amp;gt;&lt;br /&gt;&lt;br /&gt;   The decision rules used by the NavigationHandler to&lt;br /&gt;   determine which view must be displayed after the&lt;br /&gt;   current view, response.jsp is processed.&lt;br /&gt;&lt;br /&gt;&amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;from-view-id&amp;gt;/response.jsp&amp;lt;/from-view-id&amp;gt;&lt;br /&gt;&amp;lt;navigation-case&amp;gt;&lt;br /&gt;   &amp;lt;description&amp;gt;&lt;br /&gt;&lt;br /&gt;       Indicates to the NavigationHandler that the greeting.jsp&lt;br /&gt;       view must be displayed if the Action referenced by a&lt;br /&gt;       UICommand component on the response.jsp view returns&lt;br /&gt;       the outcome "success".&lt;br /&gt;&lt;br /&gt;   &amp;lt;/description&amp;gt;&lt;br /&gt;   &amp;lt;from-outcome&amp;gt;success&amp;lt;/from-outcome&amp;gt;&lt;br /&gt; &amp;lt;to-view-id&amp;gt;/greeting.jsp&amp;lt;/to-view-id&amp;gt;&lt;br /&gt;&amp;lt;/navigation-case&amp;gt;&lt;br /&gt;&amp;lt;/navigation-rule&amp;gt;&lt;br /&gt;&amp;lt;managed-bean&amp;gt;&lt;br /&gt;&amp;lt;description&amp;gt;&lt;br /&gt; The "backing file" bean that backs up the guessNumber webapp&lt;br /&gt;&amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;managed-bean-name&amp;gt;UserNumberBean&amp;lt;/managed-bean-name&amp;gt;&lt;br /&gt;&amp;lt;managed-bean-class&amp;gt;guessNumber.UserNumberBean&amp;lt;/managed-bean-class&amp;gt;&lt;br /&gt;&amp;lt;managed-bean-scope&amp;gt;session&amp;lt;/managed-bean-scope&amp;gt;&lt;br /&gt;&amp;lt;managed-property&amp;gt;&lt;br /&gt; &amp;lt;property-name&amp;gt;minimum&amp;lt;/property-name&amp;gt;&lt;br /&gt; &amp;lt;property-class&amp;gt;int&amp;lt;/property-class&amp;gt;&lt;br /&gt; &amp;lt;value&amp;gt;0&amp;lt;/value&amp;gt;&lt;br /&gt;&amp;lt;/managed-property&amp;gt;&lt;br /&gt;&amp;lt;managed-property&amp;gt;&lt;br /&gt; &amp;lt;property-name&amp;gt;maximum&amp;lt;/property-name&amp;gt;&lt;br /&gt; &amp;lt;property-class&amp;gt;int&amp;lt;/property-class&amp;gt;&lt;br /&gt; &amp;lt;value&amp;gt;10&amp;lt;/value&amp;gt;&lt;br /&gt;&amp;lt;/managed-property&amp;gt;&lt;br /&gt;&amp;lt;/managed-bean&amp;gt;&lt;br /&gt;&amp;lt;/faces-config&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;p&gt;The task of defining navigation rules involves defining which page is to be displayed after the user clicks on a button or a hyperlink. Each &lt;code&gt;&lt;navigation-rule&gt;&lt;/navigation-rule&gt;&lt;/code&gt; element defines how to get from one page as defined by the &lt;code&gt;&lt;form-view-id&gt;&lt;/form-view-id&gt;&lt;/code&gt; to the other pages of the application. A &lt;code&gt;&lt;navigation-rule&gt;&lt;/navigation-rule&gt;&lt;/code&gt; element can contain any number of &lt;code&gt;&lt;navigation-case&gt;&lt;/navigation-case&gt;&lt;/code&gt; elements that define the page to open next using the &lt;code&gt;&lt;to-view-id&gt;&lt;/to-view-id&gt;&lt;/code&gt; based on a logical outcome defined by the &lt;code&gt;&lt;from-outcome&gt;&lt;/from-outcome&gt;&lt;/code&gt;. This outcome is defined by the &lt;code&gt;action&lt;/code&gt; attribute of the component that submits the form (such as the &lt;code&gt;commandButton&lt;/code&gt; in Code Samples 2 and 3).&lt;/p&gt; &lt;p&gt; In addition, the beans need to be configured in the &lt;code&gt;faces-config.xml&lt;/code&gt; file so that the implementation can automatically create new instances of the beans as needed. The &lt;code&gt;&lt;managed-bean&gt;&lt;/managed-bean&gt;&lt;/code&gt; element is used to create a mapping between a bean name and class. The first time the &lt;code&gt;UserNumberBean&lt;/code&gt; is referenced, the object is created and stored in the appropriate scope.&lt;/p&gt; &lt;p&gt; Finally, in order to use the JSF framework in your web applications, you need to define the &lt;code&gt;FaceServlet&lt;/code&gt; and its mapping in your deployment descript file, &lt;code&gt;web.xml&lt;/code&gt;. This servlet acts as the front controller and handles all JSF-related requests. Code Sample 6 shows the &lt;code&gt;web.xml&lt;/code&gt; file for the guess number application. An important thing to note is the &lt;code&gt;javax.faces.STATE_SAVING_METHOD&lt;/code&gt; paramter, which is used to specify where the state should be saved (the client in this case). If you want to save the state on the server (this is the default in the JavaServer Faces reference implementation), then specify &lt;code&gt;server&lt;/code&gt; instead of &lt;code&gt;client&lt;/code&gt; in the &lt;code&gt;param-value&lt;/code&gt;. Note that if the state is saved on the client, the state of the entire view is rendered to a hidden field on the page.&lt;/p&gt; &lt;p&gt; &lt;b&gt;Code Sample 6&lt;/b&gt;: web.xml&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;?xml version='1.0' encoding='UTF-8'?&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE web-app PUBLIC&lt;br /&gt;"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"&lt;br /&gt;"http://java.sun.com/dtd/web-app_2_3.dtd"&amp;gt;&lt;br /&gt;&amp;lt;web-app&amp;gt;&lt;br /&gt;&amp;lt;display-name&amp;gt;JSF Guess Number Sample Application&amp;lt;/display-name&amp;gt;&lt;br /&gt;&amp;lt;description&amp;gt;&lt;br /&gt;    JSF Guess Number Sample Application&lt;br /&gt;&amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt;    &amp;lt;param-name&amp;gt;javax.faces.STATE_SAVING_METHOD&amp;lt;/param-name&amp;gt;&lt;br /&gt;    &amp;lt;param-value&amp;gt;client&amp;lt;/param-value&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt;    &amp;lt;param-name&amp;gt;com.sun.faces.validateXml&amp;lt;/param-name&amp;gt;&lt;br /&gt;    &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;    &amp;lt;description&amp;gt;&lt;br /&gt;&lt;br /&gt;        Set this flag to true if you want the JSF&lt;br /&gt;        Reference Implementation to validate the XML in your&lt;br /&gt;        faces-config.xml resources against the DTD.  Default&lt;br /&gt;        value is false.&lt;br /&gt;&lt;br /&gt;    &amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&amp;lt;context-param&amp;gt;&lt;br /&gt;    &amp;lt;param-name&amp;gt;com.sun.faces.verifyObjects&amp;lt;/param-name&amp;gt;&lt;br /&gt;    &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;br /&gt;    &amp;lt;description&amp;gt;&lt;br /&gt;&lt;br /&gt;        Set this flag to true if you want the JSF&lt;br /&gt;        Reference Implementation to verify that all of the application&lt;br /&gt;        objects you have configured (components, converters,&lt;br /&gt;        renderers, and validators) can be successfully created.&lt;br /&gt;        Default value is false.&lt;br /&gt;&lt;br /&gt;    &amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;/context-param&amp;gt;&lt;br /&gt;&amp;lt;!-- Faces Servlet --&amp;gt;&lt;br /&gt;&amp;lt;servlet&amp;gt;&lt;br /&gt;    &amp;lt;servlet-name&amp;gt;Faces Servlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;    &amp;lt;servlet-class&amp;gt;javax.faces.webapp.FacesServlet&amp;lt;/servlet-class&amp;gt;&lt;br /&gt;    &amp;lt;load-on-startup&amp;gt; 1 &amp;lt;/load-on-startup&amp;gt;&lt;br /&gt;&amp;lt;/servlet&amp;gt;&lt;br /&gt;&amp;lt;!-- Faces Servlet Mapping --&amp;gt;&lt;br /&gt;&amp;lt;servlet-mapping&amp;gt;&lt;br /&gt;    &amp;lt;servlet-name&amp;gt;Faces Servlet&amp;lt;/servlet-name&amp;gt;&lt;br /&gt;    &amp;lt;url-pattern&amp;gt;/guess/*&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;&amp;lt;/servlet-mapping&amp;gt;&lt;br /&gt;&amp;lt;security-constraint&amp;gt;&lt;br /&gt; &amp;lt;!-- This security constraint illustrates how JSP pages&lt;br /&gt;         with JSF components can be protected from&lt;br /&gt;         being accessed without going through the Faces Servlet.&lt;br /&gt;         The security constraint ensures that the Faces Servlet will&lt;br /&gt;         be used or the pages will not be processed. --&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;display-name&amp;gt;Restrict access to JSP pages&amp;lt;/display-name&amp;gt;&lt;br /&gt;&amp;lt;web-resource-collection&amp;gt;&lt;br /&gt;        &amp;lt;web-resource-name&amp;gt;&lt;br /&gt;    Restrict access to JSP pages&lt;br /&gt;        &amp;lt;/web-resource-name&amp;gt;&lt;br /&gt;    &amp;lt;url-pattern&amp;gt;/greeting.jsp&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;    &amp;lt;url-pattern&amp;gt;/response.jsp&amp;lt;/url-pattern&amp;gt;&lt;br /&gt;&amp;lt;/web-resource-collection&amp;gt;&lt;br /&gt;&amp;lt;auth-constraint&amp;gt;&lt;br /&gt;    &amp;lt;description&amp;gt;&lt;br /&gt;    With no roles defined, no access granted&lt;br /&gt;    &amp;lt;/description&amp;gt;&lt;br /&gt;&amp;lt;/auth-constraint&amp;gt;&lt;br /&gt;&amp;lt;/security-constraint&amp;gt;&lt;br /&gt;&amp;lt;/web-app&amp;gt;&lt;/p&gt;&lt;div&gt;&lt;b class="dkgrey"&gt;Creating Your Own Applications&lt;/b&gt; &lt;/div&gt; &lt;p&gt; The easiest way to start creating your own JSF applications is by adapting some of the file from the guess number application. Here is how to get started: &lt;/p&gt; &lt;ol&gt;&lt;li&gt;Create the following directory (for example, &lt;code&gt;MyApp&lt;/code&gt;) and its structure under the &lt;code&gt;samples&lt;/code&gt; directory of your JSF RI: &lt;!-- BEGIN VCD7 CODE SAMPLE COMPONENT  --&gt; &lt;table class="grey4" border="0" cellpadding="10" cellspacing="0" width="100%"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td&gt; &lt;pre&gt; c:\jsf-1_1\samples\MyApp&lt;br /&gt;                 \src&lt;br /&gt;                    YourBeans.java&lt;br /&gt;                 \web&lt;br /&gt;                    YourJSP-pages.jsp&lt;br /&gt;                    AnyImages.gif&lt;br /&gt;                 \WEB-INF&lt;br /&gt;                    web.xml&lt;br /&gt;                    faces-config.xml&lt;br /&gt;&lt;/pre&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;span class="sp20"&gt; &lt;/span&gt;&lt;br /&gt;&lt;!-- END VCD7 CODE SAMPLE COMPONENT  --&gt; &lt;/li&gt;&lt;/ol&gt; &lt;ol start="2"&gt;&lt;li&gt;Create the JSP pages and the model objects (beans).&lt;/li&gt;&lt;li&gt;Modify the &lt;code&gt;web.xml&lt;/code&gt; and &lt;code&gt;faces-config.xml&lt;/code&gt; as needed for your application.&lt;/li&gt;&lt;li&gt;Copy the file &lt;code&gt;build.properties.sample&lt;/code&gt; to &lt;code&gt;build.properties&lt;/code&gt;. This file is located in the &lt;code&gt;samples&lt;/code&gt; directory, then set the &lt;code&gt;tomcat.home&lt;/code&gt; property to the location of the application server installation. And finally, set the other self-explanatory properties as described in the file.&lt;/li&gt;&lt;li&gt;To build and package your application, create a &lt;code&gt;build.xml&lt;/code&gt; file such as the one in Code Sample 7, and place it in your directory (for example, &lt;code&gt;MyApp&lt;/code&gt;)&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;&lt;b&gt;Code Sample 7&lt;/b&gt;: build.xml &lt;/p&gt;&lt;p&gt;&amp;lt;project name="MyFirst" default="build.war" basedir="."&amp;gt;&lt;br /&gt;&amp;lt;property file="../build.properties"/&amp;gt;&lt;br /&gt;&amp;lt;!-- Configure the context path for this application --&amp;gt;&lt;br /&gt;&amp;lt;property name="context.path" value="/jsf-MyFirst"/&amp;gt;&lt;br /&gt;&amp;lt;property name="example" value="jsf-MyFirst" /&amp;gt;&lt;br /&gt;&amp;lt;property name="build"  value="${basedir}/build" /&amp;gt;&lt;br /&gt;&amp;lt;path id="classpath"&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${commons-beanutils.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${commons-collections.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${commons-digester.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${commons-logging.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${jsf-api.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${jsf-impl.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${jstl.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${build}/${example}/WEB-INF/classes"/&amp;gt;&lt;br /&gt;&amp;lt;pathelement location="${servlet.jar}"/&amp;gt;&lt;br /&gt;&amp;lt;/path&amp;gt;&lt;br /&gt;&amp;lt;target name="clean" &amp;gt;&lt;br /&gt;&amp;lt;delete dir="${build}" /&amp;gt;&lt;br /&gt;&amp;lt;delete dir="${context.path}" /&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;target name="prepare" description="Create build directories."&amp;gt;&lt;br /&gt;&amp;lt;mkdir dir="${build}/${example}" /&amp;gt;&lt;br /&gt;&amp;lt;mkdir dir="${build}/${example}/WEB-INF" /&amp;gt;&lt;br /&gt;&amp;lt;mkdir dir="${build}/${example}/WEB-INF/classes" /&amp;gt;&lt;br /&gt;&amp;lt;mkdir dir="${build}/${example}/WEB-INF/lib" /&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;!-- Executable Targets --&amp;gt;&lt;br /&gt;&amp;lt;target name="build" depends="prepare,deploy.copyJars"&lt;br /&gt; description="Compile Java files and copy static files." &amp;gt;&lt;br /&gt;&amp;lt;javac srcdir="src" destdir="${build}/${example}/WEB-INF/classes"&amp;gt;&lt;br /&gt;    &amp;lt;include name="**/*.java" /&amp;gt;&lt;br /&gt; &amp;lt;classpath refid="classpath"/&amp;gt;&lt;br /&gt;&amp;lt;/javac&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF"&amp;gt;&lt;br /&gt;    &amp;lt;fileset dir="web/WEB-INF"&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.xml" /&amp;gt;&lt;br /&gt;  &amp;lt;/fileset&amp;gt;&lt;br /&gt;&amp;lt;/copy&amp;gt;&lt;br /&gt; &amp;lt;copy todir="${build}/${example}/"&amp;gt;&lt;br /&gt;  &amp;lt;fileset dir="web"&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.html" /&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.gif" /&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.jpg" /&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.jsp" /&amp;gt;&lt;br /&gt;    &amp;lt;include name="*.xml" /&amp;gt;&lt;br /&gt;  &amp;lt;/fileset&amp;gt;&lt;br /&gt;&amp;lt;/copy&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/classes/${example}" &amp;gt;&lt;br /&gt;  &amp;lt;fileset dir="web" &amp;gt;&lt;br /&gt;     &amp;lt;include name="*properties"/&amp;gt;&lt;br /&gt;  &amp;lt;/fileset&amp;gt;&lt;br /&gt;&amp;lt;/copy&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;target name="deploy.copyJars" if="build.standalone"&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${commons-beanutils.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${commons-collections.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${commons-logging.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${commons-digester.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${jsf-api.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${jsf-impl.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${jstl.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;copy todir="${build}/${example}/WEB-INF/lib" file="${standard.jar}" /&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;target name="build.war" depends="build"&amp;gt;&lt;br /&gt;&amp;lt;!-- create a war file for distribution --&amp;gt;&lt;br /&gt;&amp;lt;jar jarfile="${example}.war" basedir="${build}/${example}"/&amp;gt;&lt;br /&gt;&amp;lt;copy todir=".." file="${example}.war" /&amp;gt;&lt;br /&gt;&amp;lt;delete file="${example}.war" /&amp;gt;&lt;br /&gt;&amp;lt;/target&amp;gt;&lt;br /&gt;&amp;lt;/project&amp;gt;&lt;/p&gt;&lt;ol start="2"&gt;&lt;li&gt;Modify the &lt;code&gt;build.xml&lt;/code&gt; shown in Code Sample 6 to suit your needs.&lt;/li&gt;&lt;li&gt;Go to the &lt;code&gt;MyApp&lt;/code&gt; directory and run the command &lt;code&gt;asant&lt;/code&gt;. Your application will be built and a &lt;code&gt;.war&lt;/code&gt; (for example, &lt;code&gt;jsf-MyFirst.war&lt;/code&gt;) file will be created in the &lt;code&gt;samples&lt;/code&gt; directory.&lt;/li&gt;&lt;li&gt;To deploy the application, ensure that the application server is running, copy the &lt;code&gt;.war&lt;/code&gt; file to the &lt;code&gt;autodeploy&lt;/code&gt; directory of your Sun Java Application Server 8 (such as &lt;code&gt;C:\Sun-Studio-Creator\SunAppServer8\domains\creator\autodeploy&lt;/code&gt;). &lt;/li&gt;&lt;li&gt;Now, your can test your application using the URL: &lt;code&gt;httpL://localhost:18080/jsf-MyFirst&lt;/code&gt;.&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;div&gt;&lt;b&gt;Conclusion&lt;/b&gt;&lt;/div&gt;&lt;/pre&gt;&lt;p&gt; JavaServer Faces (JSF) is a user interface framework for building web applications that run on the server side and render the user interface back to the client. It lets you develop tools that simplify coding web-based Java applications. Sun and other members of the JSF expert group -- which includes Borland, IBM, Macromedia, and Oracle, along with many other companies and individuals -- are evaluating ways to incorporate JSF technology into a new generation of tools that simplify the development of multi tier web-based applications. One of these tools is Sun's Java Studio Creator.&lt;/p&gt; &lt;p&gt; Users of your JSF-based web applications will appreciate the wide range of user actions made available by JSF controls. You can offer more features, more conveniently than you can with a standard HTML front end. And remember, JSF requires little more effort than an ordinary JSP configuration -- but with many more benefits.&lt;/p&gt;&lt;pre&gt;&lt;p&gt;Reference : &lt;a href="http://java.sun.com/"&gt;http://java.sun.com&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="https://glassfish.dev.java.net/public/downloadsindex.html"&gt;&lt;img style="cursor: pointer;" src="http://3.bp.blogspot.com/_vJc4QlgRE6c/SFTcsre6rWI/AAAAAAAAAtE/cC4tat5YpTE/s320/download_GFv2ur2-200_48px.jpg" alt="" id="BLOGGER_PHOTO_ID_5212033328919260514" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-691001093851379835?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/wOxrefjP45PI8GwJgx_xlLbCU-o/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wOxrefjP45PI8GwJgx_xlLbCU-o/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/wOxrefjP45PI8GwJgx_xlLbCU-o/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/wOxrefjP45PI8GwJgx_xlLbCU-o/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=85kZgrPM"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Wnn0QheN"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=8m7ZZTcg"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=8m7ZZTcg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=ctHhVsml"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=KeNXXFRg"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=KeNXXFRg" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=wqTYXz3k"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=T2sYzFhO"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=T2sYzFhO" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=QZp8kxW1"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=42OndSJz"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=42OndSJz" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=rjWA3WXN"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/E3qPJtXwra8" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/E3qPJtXwra8/java-server-faces.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://2.bp.blogspot.com/_vJc4QlgRE6c/SFTSxtEdvgI/AAAAAAAAAsc/rII40caGZU0/s72-c/fig1.gif" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/java-server-faces.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-4100337882913255467</guid><pubDate>Sun, 15 Jun 2008 02:32:00 +0000</pubDate><atom:updated>2008-06-24T23:29:21.191-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP symfony</category><title>PHP SYMFONY</title><description>&lt;p&gt;&lt;span style="color: #6699CC;font-size:180%;" &gt;Open-source web PHP-Framework&lt;/span&gt;
&lt;br /&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;
&lt;br /&gt;&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Symfony is a full-stack framework, a library of cohesive classes written in PHP5.&lt;/strong&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;It provides an architecture, components and tools for developers to build complex web applications faster. Choosing symfony allows you to release your applications earlier, host and scale them without problem, and maintain them over time with no surprise. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Symfony is based on experience. It does not reinvent the wheel: it uses most of the best practices of web development and integrates some great third-party libraries. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Overview&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;Symfony has &lt;st1:city&gt;&lt;st1:place&gt;Ajax&lt;/st1:place&gt;&lt;/st1:city&gt; helpers that make programming an elaborate interface a piece of cake. This tutorial will show you step-by-step how to create an Ajax-powered symfony application in minutes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;&lt;a name="Introduction"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Introduction&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;Real lazy folks that can't stand reading long documentation are advised to watch the &lt;a href="http://www.symfony-project.org/screencast/cart"&gt;online screencast&lt;/a&gt; that demonstrates exactly what is written below.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Adding items to a shopping cart in common e-commerce applications isn't very close to the actual "add to cart" metaphor, since it requires clicking an "add to cart" button, watch a new page (the shopping cart), and then go back to the shop or checkout with buttons.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;&lt;st1:city&gt;&lt;st1:place&gt;Ajax&lt;/st1:place&gt;&lt;/st1:city&gt; allows to get closer to the cart metaphor, by enabling drag-and-drop interactions and giving immediate visual feedback, without leaving the shop.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;The target application of this tutorial will be a symfony ported version of the shopping cart demo published by &lt;a href="http://script.aculo.us/demos/shop"&gt;script.aculo.us&lt;/a&gt; in &lt;a href="http://www.rubyonrails.com/"&gt;Rails&lt;/a&gt;. It uses the &lt;a href="http://prototype.conio.net/"&gt;prototype&lt;/a&gt; JavaScript framework (bundled with symfony) and some &lt;a href="http://script.aculo.us/"&gt;script.aculo.us&lt;/a&gt; JavaScript that is the core of the JavaScript helpers.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;&lt;a name="Application_Setup"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Application Setup&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;First, create a &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo&lt;/span&gt;&lt;/code&gt; project, an &lt;code&gt;&lt;span style="font-size:10;"&gt;app&lt;/span&gt;&lt;/code&gt; application and a &lt;code&gt;&lt;span style="font-size:10;"&gt;cart&lt;/span&gt;&lt;/code&gt; module:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;$ cd /home/steve&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;$ mkdir sfdemo&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;$ cd sfdemo&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;$ symfony init-project sfdemo&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;$ symfony init-app app&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;$ symfony init-module app cart&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Setup your web server to be able to access this new application (whether using a virtual host or an alias, as described in the &lt;a href="http://www.symfony-project.org/cookbook/1_0/web_server"&gt;web server setup&lt;/a&gt; chapter of the documentation). For this example, let's assume that this module is accessible via a localhost:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;http://localhost/cart/&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Congratulations, it says.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Your app must have access to the symfony JavaScript libraries. If your app doesn't work, check you can access these libraries within your browser (test &lt;code&gt;&lt;span style="font-size:10;"&gt;http://localhost/sf/prototype/js/prototype.js&lt;/span&gt;&lt;/code&gt; for example). If not, you have 3 different ways to fix this problem:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Symbol;font-size:10;"  &gt;&lt;span style=""&gt;·&lt;span style=""&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;configure Apache with the following &lt;code&gt;&lt;span style="font-size:10;"&gt;Alias&lt;/span&gt;&lt;/code&gt;:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;code&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;!--[endif]--&gt;&lt;code&gt;Alias /sf /$data_dir/symfony/web/sf&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Symbol;font-size:10;"  &gt;&lt;span style=""&gt;·&lt;span style=""&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;create a &lt;code&gt;&lt;span style="font-size:10;"&gt;sf&lt;/span&gt;&lt;/code&gt; symbolic link in your &lt;code&gt;&lt;span style="font-size:10;"&gt;web&lt;/span&gt;&lt;/code&gt; directory:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;code&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;!--[endif]--&gt;&lt;code&gt;$ cd /home/steve/sfdemo/web&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;code&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;!--[endif]--&gt;&lt;code&gt;$ ln -sf /$data_dir/symfony/web/sf sf&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;span style=";font-family:Symbol;font-size:10;"  &gt;&lt;span style=""&gt;·&lt;span style=""&gt;         &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;!--[endif]--&gt;copy the JavaScript files in &lt;code&gt;&lt;span style="font-size:10;"&gt;web/js&lt;/span&gt;&lt;/code&gt; directory:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;code&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;!--[endif]--&gt;&lt;code&gt;$ cd /home/steve/sfdemo/web&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;code&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;!--[endif]--&gt;&lt;code&gt;$ mkdir -p sf/js&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre style="margin-left: 36pt; text-indent: -18pt;"&gt;&lt;!--[if !supportLists]--&gt;&lt;code&gt;&lt;span style="font-family:Symbol;"&gt;&lt;span style=""&gt;·&lt;span style=""&gt;                &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;!--[endif]--&gt;&lt;code&gt;$ cp /$data_dir/symfony/web/sf/prototype/js/*.js sf/js/&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="The_Main_Page"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;The Main Page&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;First, you need to create a list of items to be purchased. To keep the project simple, the element list is accessed via a simple &lt;code&gt;&lt;span style="font-size:10;"&gt;getProducts()&lt;/span&gt;&lt;/code&gt; method of the &lt;code&gt;&lt;span style="font-size:10;"&gt;cart&lt;/span&gt;&lt;/code&gt; actions class. The shopping cart is a simple parameter of the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfUser&lt;/span&gt;&lt;/code&gt; object, set with the Attribute &lt;a href="http://www.symfony-project.org/book/1_0/02-Exploring-Symfony-s-Code#Parameter%20Holders"&gt;parameter holder&lt;/a&gt;. Modify the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/apps/app/modules/cart/actions/actions.class.php&lt;/span&gt;&lt;/code&gt; to:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span class="kw2"&gt;class&lt;/span&gt; cartActions &lt;span class="kw2"&gt;extends&lt;/span&gt; sfActions&lt;o:p&gt;&lt;/o:p&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="kw2"&gt;public&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; executeIndex&lt;span class="br0"&gt;()&lt;/span&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;()&lt;/span&gt;-&gt;&lt;span class="me1"&gt;setAttribute&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'cart'&lt;/span&gt;, &lt;span class="kw3"&gt;array&lt;/span&gt;&lt;span class="br0"&gt;())&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;products&lt;/span&gt; = &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getProducts&lt;/span&gt;&lt;span class="br0"&gt;()&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span class="br0"&gt;
&lt;br /&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;   &lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span class="kw2"&gt;private&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; getProducts&lt;span class="br0"&gt;()&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span class="kw1"&gt;return&lt;/span&gt; &lt;span class="kw3"&gt;array&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'iPod black'&lt;/span&gt;, &lt;span class="st0"&gt;'iMac'&lt;/span&gt;, &lt;span class="st0"&gt;'iMac RC'&lt;/span&gt;, &lt;span class="st0"&gt;'iPod'&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;span style=""&gt;&lt;/span&gt;&lt;span class="br0"&gt;
&lt;br /&gt;}
&lt;br /&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;  &lt;p&gt;The main page of the &lt;code&gt;&lt;span style="font-size:10;"&gt;cart&lt;/span&gt;&lt;/code&gt; module will contain a list of items, and a zone to drag items to. This zone is the shopping cart. So open the template &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/apps/app/modules/cart/templates/indexSuccess.php&lt;/span&gt;&lt;/code&gt; and write in:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-family:monospace;"&gt;&amp;lt;h1&amp;gt;symfony Apple store demo&amp;lt;/h1&amp;gt;
&lt;br /&gt;
&lt;br /&gt;&amp;lt;div id="shopping_cart"&amp;gt;
&lt;br /&gt;&amp;lt;h2&amp;gt;Products:&amp;lt;/h2&amp;gt;
&lt;br /&gt;&amp;lt;div id="product_list"&amp;gt;
&lt;br /&gt;&amp;lt;?php foreach ($products as $id =&amp;gt; $title): ?&amp;gt;
&lt;br /&gt;  &amp;lt;?php echo image_tag('product'.$id, array(
&lt;br /&gt;    'id'    =&amp;gt; 'product_'.$id,
&lt;br /&gt;    'class' =&amp;gt; 'products'
&lt;br /&gt;  )) ?&amp;gt;
&lt;br /&gt;&amp;lt;?php endforeach; ?&amp;gt;
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;&amp;lt;h2&amp;gt;Cart:&amp;lt;/h2&amp;gt;
&lt;br /&gt;&amp;lt;div id="cart" class="cart"&amp;gt;
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;&lt;pre&gt;&lt;o:p&gt;&lt;/o:p&gt;You can see that products are shown as images. Use the images available in &lt;a href="http://www.symfony-project.org/downloads/demo/cart/products.tgz"&gt;this
&lt;br /&gt;archive&lt;/a&gt;, and put them in the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/web/images/&lt;/span&gt;&lt;/code&gt; directory. In addition, part of the styling was done for you, so it is recommended that you upload &lt;a href="http://www.symfony-project.org/downloads/demo/cart/cart.css"&gt;this
&lt;br /&gt;stylesheet&lt;/a&gt; to the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/web/css/&lt;/span&gt;&lt;/code&gt; directory and add a &lt;code&gt;&lt;span style="font-size:10;"&gt;view.yml&lt;/span&gt;&lt;/code&gt; in the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/apps/app/modules/cart/config/&lt;/span&gt;&lt;/code&gt; directory with the following content:&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;    &lt;pre&gt;&lt;code&gt;all:&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=""&gt;  &lt;/span&gt;stylesheets:&lt;span style=""&gt;  &lt;/span&gt;[cart]&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Now watch the chop and cart backdrop by requesting again:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;http://localhost/cart/&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;h2&gt;&lt;a name="Focus_on_the_Cart"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Focus on the Cart&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;The cart content will change as you drag items to it. This means that the content of the cart in the template must be in an independent file. Use the &lt;code&gt;&lt;span style="font-size:10;"&gt;include_partial()&lt;/span&gt;&lt;/code&gt; helper for that. The items in the shopping cart will be stored in divs with &lt;code&gt;&lt;span style="font-size:10;"&gt;float:left&lt;/span&gt;&lt;/code&gt; style, so a clearing div is necessary after the container. So change the end of the &lt;code&gt;&lt;span style="font-size:10;"&gt;indexSuccess.php&lt;/span&gt;&lt;/code&gt; template to:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-family:monospace;"&gt;&amp;lt;h2&amp;gt;Cart:&amp;lt;/h2&amp;gt;
&lt;br /&gt;&amp;lt;div id="cart" class="cart"&amp;gt;
&lt;br /&gt;&amp;lt;div id="items"&amp;gt;
&lt;br /&gt;  &amp;lt;?php include_partial('cart') ?&amp;gt;
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;&amp;lt;div style="clear: both"&amp;gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;  &lt;p&gt;The &lt;code&gt;&lt;span style="font-size:10;"&gt;include_partial()&lt;/span&gt;&lt;/code&gt; helper will include a &lt;code&gt;&lt;span style="font-size:10;"&gt;_cart.php&lt;/span&gt;&lt;/code&gt; file, and look for this file in the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/apps/app/modules/cart/templates/&lt;/span&gt;&lt;/code&gt; directory. Create it with the following content:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-family:monospace;"&gt;&amp;lt;?php foreach ($sf_user-&amp;gt;getAttribute('cart') as $product_id =&amp;gt; $quantity): ?&amp;gt;
&lt;br /&gt;&amp;lt;div&amp;gt;
&lt;br /&gt;&amp;lt;?php for ($i = 1; $i &amp;lt;= $quantity; $i++): ?&amp;gt;
&lt;br /&gt;&amp;lt;?php echo image_tag('product'.$product_id, array(
&lt;br /&gt;  'class' =&amp;gt; 'cart-items',
&lt;br /&gt;  'id'    =&amp;gt; 'item_'.$product_id.'_'.$i,
&lt;br /&gt;  'style' =&amp;gt; 'position:relative'
&lt;br /&gt;)) ?&amp;gt;
&lt;br /&gt;&amp;lt;?php endfor; ?&amp;gt;
&lt;br /&gt;(&amp;lt;?php echo $quantity ?&amp;gt; &amp;lt;?php echo $products[$product_id] ?&amp;gt;)
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;&amp;lt;?php endforeach; ?&amp;gt;
&lt;br /&gt;
&lt;br /&gt;&amp;lt;?php if (!$sf_user-&amp;gt;getAttribute('cart')): ?&amp;gt;
&lt;br /&gt;nothing yet in your shopping cart.
&lt;br /&gt;&amp;lt;?php endif; ?&amp;gt;
&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;&lt;p&gt;If the cart contains items, they appear as images, as many times as they are added; the quantity is be displayed after each series.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Now watch again the shopping cart at:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;http://localhost/cart/&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Well, there is not much change, it is still very empty... It's time to make things &lt;st1:city&gt;&lt;st1:place&gt;AJAX&lt;/st1:place&gt;&lt;/st1:city&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;&lt;a name="Add_JavaScript_Behaviors"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Add JavaScript Behaviors&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;Edit the &lt;code&gt;&lt;span style="font-size:10;"&gt;indexSuccess.php&lt;/span&gt;&lt;/code&gt; template to require the JavaScript helper:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span class="kw2"&gt;&amp;lt;?php use_helper('Javascript') ?&amp;gt;&lt;/span&gt;&lt;span class="kw2"&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;  &lt;p&gt;Make the images draggable by adding the following call to the &lt;code&gt;&lt;span style="font-size:10;"&gt;draggable_element&lt;/span&gt;&lt;/code&gt; JavaScript helper:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-family:monospace;"&gt;&amp;lt;?php foreach ($products as $id =&amp;gt; $title): ?&amp;gt;
&lt;br /&gt;&amp;lt;?php echo image_tag('product'.$id, array(
&lt;br /&gt;'id'    =&amp;gt; 'product_'.$id,
&lt;br /&gt;'class' =&amp;gt; 'products'
&lt;br /&gt;)) ?&amp;gt;
&lt;br /&gt;&amp;lt;?php echo draggable_element('product_'.$id, array('revert' =&amp;gt; true)) ?&amp;gt;
&lt;br /&gt;&amp;lt;?php endforeach; ?&amp;gt;
&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;&lt;p&gt;This adds a 'draggable' behavior to each of the images of the list of products. The &lt;code&gt;&lt;span style="font-size:10;"&gt;revert&lt;/span&gt;&lt;/code&gt; option will make images go back to their origin position when released (unless received by a receiving element).&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Now, define the cart as a receiving element. You just need to define which part of the template will have to be updated when the event occurs, which action will be called for its content, and which type of draggable elements can be dragged into it. Use the &lt;code&gt;&lt;span style="font-size:10;"&gt;drop_receiving_elements&lt;/span&gt;&lt;/code&gt; JavaScript helper for that:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-family:monospace;"&gt;&amp;lt;?php echo drop_receiving_element('cart', array(
&lt;br /&gt;'update'     =&amp;gt; 'items',
&lt;br /&gt;'url'        =&amp;gt; 'cart/add',
&lt;br /&gt;'accept'     =&amp;gt; 'products',
&lt;br /&gt;)) ?&amp;gt;
&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;&lt;p&gt;Now try again, and move the products to the cart: it works. When a draggable item is dragged to the receiving element, an XMLHTTPRequest is sent to the &lt;code&gt;&lt;span style="font-size:10;"&gt;add&lt;/span&gt;&lt;/code&gt; action, and the result is displayed in the &lt;code&gt;&lt;span style="font-size:10;"&gt;items&lt;/span&gt;&lt;/code&gt; div. The thing is, the &lt;code&gt;&lt;span style="font-size:10;"&gt;add&lt;/span&gt;&lt;/code&gt; action of the &lt;code&gt;&lt;span style="font-size:10;"&gt;cart&lt;/span&gt;&lt;/code&gt; module is not defined yet...&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;&lt;a name="Define_the_Updating_Action"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Define the Updating Action&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;Edit the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/apps/app/modules/cart/actions/actions.class.php&lt;/span&gt;&lt;/code&gt; to add an &lt;code&gt;&lt;span style="font-size:10;"&gt;add&lt;/span&gt;&lt;/code&gt; action:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span class="kw2"&gt;public&lt;/span&gt; &lt;span class="kw2"&gt;function&lt;/span&gt; executeAdd&lt;span class="br0"&gt;()&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="re0"&gt;$tmp&lt;/span&gt; = &lt;span class="kw3"&gt;split&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'_'&lt;/span&gt;, &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getRequestParameter&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'id'&lt;/span&gt;, &lt;span class="st0"&gt;''&lt;/span&gt;&lt;span class="br0"&gt;))&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="re0"&gt;$product_id&lt;/span&gt; = &lt;span class="re0"&gt;$tmp&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="nu0"&gt;1&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="re0"&gt;$cart&lt;/span&gt; = &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;()&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getAttribute&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'cart'&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="kw1"&gt;if&lt;/span&gt; &lt;span class="br0"&gt;(&lt;/span&gt;!&lt;span class="kw3"&gt;isset&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="re0"&gt;$cart&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="re0"&gt;$product_id&lt;/span&gt;&lt;span class="br0"&gt;]))&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;&lt;span class="re0"&gt;$cart&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="re0"&gt;$product_id&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt; = &lt;span class="nu0"&gt;1&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="kw1"&gt;else&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="br0"&gt;{&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;    &lt;/span&gt;++&lt;span class="re0"&gt;$cart&lt;/span&gt;&lt;span class="br0"&gt;[&lt;/span&gt;&lt;span class="re0"&gt;$product_id&lt;/span&gt;&lt;span class="br0"&gt;]&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getUser&lt;/span&gt;&lt;span class="br0"&gt;()&lt;/span&gt;-&gt;&lt;span class="me1"&gt;setAttribute&lt;/span&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="st0"&gt;'cart'&lt;/span&gt;, &lt;span class="re0"&gt;$cart&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span style=""&gt;  &lt;/span&gt;&lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;products&lt;/span&gt; = &lt;span class="re0"&gt;$this&lt;/span&gt;-&gt;&lt;span class="me1"&gt;getProducts&lt;/span&gt;&lt;span class="br0"&gt;()&lt;/span&gt;;&lt;span style=""&gt;      &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt;&lt;span class="br0"&gt;}&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;  &lt;p&gt;This action looks for the parameter sent by the JavaScript (the id of the dragged item) and adds it to the cart.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;The result of the &lt;code&gt;&lt;span style="font-size:10;"&gt;add&lt;/span&gt;&lt;/code&gt; action will be the &lt;code&gt;&lt;span style="font-size:10;"&gt;addSuccess.php&lt;/span&gt;&lt;/code&gt; template. It is a simple inclusion of the &lt;code&gt;&lt;span style="font-size:10;"&gt;_cart.php&lt;/span&gt;&lt;/code&gt; partial, but this time it is necessary to pass the products as a parameter :&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;span class="kw2"&gt;&amp;lt;?php include_partial('cart', array('products' =&amp;gt; $products)) ?&amp;gt;&lt;/span&gt;&lt;span class="kw2"&gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;&lt;pre&gt; &lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;  &lt;p&gt;This template must not use the global layout, so edit the &lt;code&gt;&lt;span style="font-size:10;"&gt;view.yml&lt;/span&gt;&lt;/code&gt; in the &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/apps/app/modules/cart/config/&lt;/span&gt;&lt;/code&gt; directory, and write in:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;addSuccess:&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=""&gt;  &lt;/span&gt;has_layout:&lt;span style=""&gt;   &lt;/span&gt;off&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;all:&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=""&gt;  &lt;/span&gt;has_layout:&lt;span style=""&gt;   &lt;/span&gt;on&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;&lt;pre&gt;&lt;code&gt;&lt;span style=""&gt;  &lt;/span&gt;stylesheets:&lt;span style=""&gt;  &lt;/span&gt;[cart]&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Try it on: you can now add items to the cart by dragging them.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;h2&gt;&lt;a name="Focus_on_Usability"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Focus on Usability&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;You could stop now, but this shopping cart has a big default: while the cart is updated, the interface doesn't change and the user might be disoriented. This is a general issue of asynchronous requests: an indicator zone has to be added to show that the request is being processed. In addition, nothing tells the user when the dragged item is considered accepted by the cart, so the &lt;code&gt;&lt;span style="font-size:10;"&gt;hover&lt;/span&gt;&lt;/code&gt; style of the &lt;code&gt;&lt;span style="font-size:10;"&gt;cart&lt;/span&gt;&lt;/code&gt; div also has to be defined.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;To do that, edit the &lt;code&gt;&lt;span style="font-size:10;"&gt;indexSuccess.php&lt;/span&gt;&lt;/code&gt; template and write in:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-family:monospace;"&gt;&amp;lt;div style="height:20px"&amp;gt;
&lt;br /&gt;&amp;lt;p id="indicator" style="display:none"&amp;gt;
&lt;br /&gt;&amp;lt;?php echo image_tag('indicator.gif') ?&amp;gt; updating cart...
&lt;br /&gt;&amp;lt;/p&amp;gt;
&lt;br /&gt;
&lt;br /&gt;&amp;lt;/div&amp;gt;
&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;&lt;p&gt;Save the 'indicator.gif' &lt;a href="http://www.symfony-project.org/downloads/demo/cart/indicator.gif"&gt;image file&lt;/a&gt; to your &lt;code&gt;&lt;span style="font-size:10;"&gt;sfdemo/web/images/&lt;/span&gt;&lt;/code&gt; directory.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Now, modify the &lt;code&gt;&lt;span style="font-size:10;"&gt;drop_receiving_element()&lt;/span&gt;&lt;/code&gt; JavaScript helper call in the same template to show this new indicator while requests are processed and declare the hover style:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;span style="font-family:monospace;"&gt;&amp;lt;?php echo drop_receiving_element('cart', array(
&lt;br /&gt;'update'     =&amp;gt; 'items',
&lt;br /&gt;'url'        =&amp;gt; 'cart/add',
&lt;br /&gt;'accept'     =&amp;gt; 'products',
&lt;br /&gt;'script'     =&amp;gt; 'true',
&lt;br /&gt;'hoverclass' =&amp;gt; 'cart-active',
&lt;br /&gt;'loading'    =&amp;gt; "Element.show('indicator')",
&lt;br /&gt;'complete'   =&amp;gt; "Element.hide('indicator')"
&lt;br /&gt;)) ?&amp;gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/span&gt;  &lt;h2&gt;&lt;a name="Conclusion"&gt;&lt;/a&gt;&lt;span style="color: rgb(255, 204, 51);"&gt;Conclusion&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/h2&gt;  &lt;p&gt;The complete source of the demo can be &lt;a href="http://www.symfony-project.org/downloads/demo/cart/project.tgz"&gt;downloaded&lt;/a&gt; and is available &lt;a href="http://www.symfony-project.org/demo/cart.html"&gt;online&lt;/a&gt;. You will notice a few minor differences with the code described in this tutorial (including a trash box), but the core behaviors are the same.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Until the full documentation of the JavaScript helpers is released, you can find more information about them in the &lt;a href="http://wiki.script.aculo.us/scriptaculous/list?category=Controls"&gt;script.aculo.us documentation&lt;/a&gt;.&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0); font-weight: bold;font-size:180%;" &gt;Download and Install&lt;/span&gt;
&lt;br /&gt;&lt;p&gt;   You can choose between several alternatives to install symfony, from the simplest to the most advanced one.   If you need a step-by-step guide, refer to the &lt;a href="http://www.symfony-project.org/book/1_0/03-Running-Symfony"&gt;installation chapter&lt;/a&gt; of the symfony book. &lt;/p&gt;  &lt;h2 style="color: rgb(255, 204, 51);"&gt;The sandbox&lt;/h2&gt;  &lt;p&gt;   The sandbox is an empty symfony project where all the required libraries are already included,   and where the basic configuration is already done.   It is made for symfony beginners, who want to play with the framework or try the tutorials without installing anything. &lt;/p&gt;  &lt;p&gt;     You can download a sandbox &lt;a href="http://www.symfony-project.org/get/sf_sandbox.tgz"&gt;sf_sandbox.tgz&lt;/a&gt;.   Unpack it in your root web directory.   Refer to the included readme file for more information. &lt;/p&gt;  &lt;p&gt;   After downloading the sandbox, you might want to follow the &lt;a href="http://www.symfony-project.org/tutorial/1_0/my_first_project"&gt;My first project&lt;/a&gt; tutorial   to discover the basics of symfony development. &lt;/p&gt;  &lt;h2 style="color: rgb(255, 204, 51);"&gt;Source Download&lt;/h2&gt;  &lt;p&gt;   If you want to customize your own installation, or if you want to browse the symfony source without installing it,   you might prefer a simple download.   Beware that you will have to create shortcuts to the symfony libraries and binaries if you want to use it for a project.   Refer to the &lt;a href="http://www.symfony-project.org/book/1_0/03-Running-Symfony"&gt;installation chapter&lt;/a&gt; for more details. &lt;/p&gt;  &lt;dl&gt;&lt;dt&gt;&lt;strong&gt;Download a .tgz archive&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;         &lt;a href="http://www.symfony-project.org/get/symfony-stable.tgz"&gt;http://www.symfony-project.org/get/symfony-stable.tgz&lt;/a&gt;   &lt;/dd&gt;&lt;dt&gt;&lt;strong&gt;Checkout from the Subversion repository&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;To check out the 1.0 stable release, type in a command line:
&lt;br /&gt;&lt;pre&gt;&lt;code&gt;$ svn co http://svn.symfony-project.com/branches/1.0&lt;/code&gt;&lt;/pre&gt;   &lt;/dd&gt;&lt;dt&gt;&lt;strong&gt;Use &lt;code&gt;svn:externals&lt;/code&gt;&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;If your project is already under version control with SVN, you might want to use symfony as a &lt;code&gt;svn:externals&lt;/code&gt; dependency. To do so, browse to the root of the project where you want to put symfony in, and type:
&lt;br /&gt;&lt;pre&gt;&lt;code&gt;$ svn propedit svn:externals lib/vendor
&lt;br /&gt;
&lt;br /&gt;// your favorite text editor then opens, and you must then type
&lt;br /&gt;symfony http://svn.symfony-project.com/branches/1.0&lt;/code&gt;&lt;/pre&gt;   &lt;/dd&gt;&lt;dt&gt;&lt;strong&gt;Browse the source online&lt;/strong&gt;&lt;/dt&gt;&lt;dd&gt;Head to the &lt;a href="http://www.symfony-project.org/trac/browser"&gt;source browser&lt;/a&gt; of the symfony trac.&lt;/dd&gt;&lt;/dl&gt;  &lt;h2 style="color: rgb(255, 204, 51);"&gt;PEAR installation&lt;/h2&gt;  &lt;p&gt;   The PEAR installation is for those who want to run several symfony-based projects, with an easy way to upgrade.   It requires PEAR version 1.4.0 or higher, which is bundled in most PHP distributions. &lt;/p&gt;  &lt;p&gt;Type in the command line:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;$ pear channel-discover pear.symfony-project.com&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Then, to install the latest stable release:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;$ pear install symfony/symfony&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;or to install the nightly release:&lt;/p&gt; &lt;pre&gt;&lt;code&gt;$ pear install symfony/symfony-beta&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;PEAR also provides an easy way to upgrade symfony, for instance to get the latest beta version:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;$ pear upgrade symfony/symfony-beta&lt;/code&gt;&lt;/pre&gt;  &lt;h2 style="color: rgb(255, 204, 51);"&gt;Linux installation&lt;/h2&gt;  &lt;p&gt;Some Linux distributions have symfony packages. As of now, packages have been created for Debian like distributions and SUSE.&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;strong&gt;Debian/Ubuntu&lt;/strong&gt; package:     &lt;ul&gt;&lt;li&gt;Add to your &lt;code&gt;/etc/apt/sources.list&lt;/code&gt;:         &lt;pre&gt;&lt;code&gt;  deb http://www.symfony-project.org/get debian/&lt;/code&gt;&lt;/pre&gt;       &lt;/li&gt;&lt;li&gt;Run as root:         &lt;pre&gt;&lt;code&gt;  $ apt-get update&lt;/code&gt;&lt;/pre&gt;       &lt;/li&gt;&lt;li&gt;Install it:         &lt;pre&gt;&lt;code&gt;  $ apt-get install php5-symfony&lt;/code&gt;&lt;/pre&gt;       &lt;/li&gt;&lt;/ul&gt;   &lt;/li&gt;&lt;li&gt;&lt;strong&gt;SUSE&lt;/strong&gt; package is available in the server:php:applications repository:     &lt;pre&gt;&lt;code&gt;
&lt;br /&gt;http://software.opensuse.org/download/server:/php:/applications/
&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;   &lt;/li&gt;&lt;/ul&gt;  &lt;h2 style="color: rgb(255, 204, 51);"&gt;User-contributed guides&lt;/h2&gt; &lt;p&gt;The &lt;a href="http://www.symfony-project.org/trac"&gt;symfony wiki&lt;/a&gt; contains a few articles describing step-by-step installations on various platforms.&lt;/p&gt; The &lt;a href="http://www.symfony-project.org/forum/"&gt;forum&lt;/a&gt; has a dedicated section where many installation issues have already been solved, and where you will find a symfony user willing to help you in minutes if you have a new problem
&lt;br /&gt;&lt;p&gt;&lt;span style="color: rgb(255, 102, 0);font-size:180%;" &gt;&lt;span style="font-weight: bold;"&gt;
&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: rgb(255, 102, 0);font-size:180%;" &gt;&lt;span style="font-weight: bold;"&gt;Documentation&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;&lt;/p&gt;You want to learn more about symfony? We have plenty of documentation for you.
&lt;br /&gt;
&lt;br /&gt;&lt;h2 style="color: rgb(255, 204, 51);"&gt;The Definitive Guide to symfony&lt;/h2&gt;           &lt;p&gt;Also known as "&lt;a href="http://www.symfony-project.org/book/1_0/"&gt;The Book&lt;/a&gt;", this is the online version of a 490p book published by Apress and written by the symfony core team. Complete, didactic and practical, the definitive reference.&lt;/p&gt;            &lt;div&gt;             &lt;a href="http://www.symfony-project.org/book/1_0/" class="read"&gt;Read&lt;/a&gt;               &lt;ul class="languages"&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/book/1_0/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/en.png" title="Read in English" alt="Read in English" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;           &lt;/div&gt;
&lt;br /&gt;&lt;h2 style="color: rgb(255, 204, 51);"&gt;The API Documentation&lt;/h2&gt;         &lt;p&gt;Every class, method and function in symfony has PHPDoc comments explaining the way it works. The best way to check the parameters of a function or the nature of the returned value is there.&lt;/p&gt;         &lt;p&gt;           &lt;a href="http://www.symfony-project.org/api/1_0/" class="read"&gt;Read&lt;/a&gt;           &lt;a href="http://www.symfony-project.org/trac/browser" class="browse"&gt;Browse&lt;/a&gt;         &lt;/p&gt;
&lt;br /&gt;&lt;h2 style="color: rgb(255, 204, 51);"&gt;The Cookbook&lt;/h2&gt;           &lt;p&gt;Recipies for everyday meals.&lt;/p&gt;            &lt;div&gt;             &lt;a href="http://www.symfony-project.org/cookbook/1_0/en/" class="read"&gt;Read&lt;/a&gt;                &lt;ul class="languages"&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/cookbook/1_0/en/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/en.png" title="Read in English" alt="Read in English" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
&lt;br /&gt;&lt;span style="color: rgb(255, 102, 0);font-size:180%;" &gt;&lt;span style="font-weight: bold;"&gt;Tutorials&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;&lt;h2 style="color: rgb(255, 204, 51);"&gt;My First Project&lt;/h2&gt;         &lt;p&gt;Discover the basics of symfony with this one-hour tutorial, covering installation, page creation, model modification, the admin generator, and much more...&lt;/p&gt;&lt;a href="http://www.symfony-project.org/tutorial/1_0/my-first-project" class="read"&gt;Read&lt;/a&gt;                       &lt;a href="http://www.symfony-project.org/tutorial/1_0/doctrine-my-first-project" class="read"&gt;Read for Doctrine&lt;/a&gt;                     &lt;a href="http://www.symfony-project.org/downloads/my_first_project.tgz" class="download"&gt;Download&lt;/a&gt;
&lt;br /&gt;&lt;p&gt;
&lt;br /&gt;&lt;/p&gt;&lt;h2 style="color: rgb(255, 204, 51);"&gt;The Admin Generator&lt;/h2&gt;         &lt;p&gt;Discover the power of the administration generator. You will never code a backend application by hand after seeing this!&lt;/p&gt;         &lt;p&gt;           &lt;a class="watch" href="http://www.symfony-project.org/screencast/admin-generator"&gt;Watch&lt;/a&gt;          &lt;a class="read" href="http://www.symfony-project.org/book/1_0/14-Generators#Administration"&gt;Read&lt;/a&gt;                 &lt;a href="http://downloads.symfony-project.org/demo/admin/admin_generator.tgz" class="download"&gt;Download&lt;/a&gt;         &lt;/p&gt;&lt;p&gt;         &lt;/p&gt;
&lt;br /&gt;&lt;h2 style="color: rgb(255, 204, 51);"&gt;Askeet&lt;/h2&gt;           &lt;p&gt;24 tutorials of 1 hour each, that's all it takes to build up a complete and effective application from scratch. Definitely the best way to become a good symfony developer!&lt;/p&gt;           &lt;div&gt;             &lt;a class="read" href="http://www.symfony-project.org/askeet/1_0/en/"&gt;Read&lt;/a&gt;              &lt;ul class="languages"&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/de/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/de.png" title="Read in German" alt="Read in German" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/en/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/en.png" title="Read in English" alt="Read in English" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/es/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/es.png" title="Read in Spanish" alt="Read in Spanish" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/fr/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/fr.png" title="Read in French" alt="Read in French" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/id/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/id.png" title="Read in Indonesian" alt="Read in Indonesian" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/ja/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/ja.png" title="Read in Japanese" alt="Read in Japanese" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/ko/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/ko.png" title="Read in Korean" alt="Read in Korean" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.symfony-project.org/askeet/1_0/pt/"&gt;&lt;img src="http://www.symfony-project.org/sfSymfonyWebDocPlugin/images/flags/pt.png" title="Read in Portuguese" alt="Read in Portuguese" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;           &lt;/div&gt;                        &lt;a class="test" href="http://www.askeet.com/"&gt;Test&lt;/a&gt;            &lt;a href="http://trac.askeet.com/trac/browser/trunk" class="browse"&gt;Browse&lt;/a&gt;             &lt;a href="http://www.symfony-project.org/downloads/askeet_release_1_0.tgz" class="download"&gt;Download&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;h2 style="color: rgb(255, 204, 51);"&gt;Easy Ajax&lt;/h2&gt;         &lt;p&gt;Create a drag and drop shopping cart in minutes with symfony.&lt;/p&gt;         &lt;p&gt;           &lt;a class="watch" href="http://www.symfony-project.org/screencast/cart"&gt;Watch&lt;/a&gt;          &lt;a class="read" href="http://www.symfony-project.org/tutorial/1_0/symfony-ajax"&gt;Read&lt;/a&gt;          &lt;a class="test" href="http://www.symfony-project.org/demo/cart.html"&gt;Test&lt;/a&gt;          &lt;a href="http://www.symfony-project.org/downloads/demo/cart/project.tgz" class="download"&gt;Download&lt;/a&gt;         &lt;/p&gt;
&lt;br /&gt;Reference :  &lt;a style="color: rgb(255, 204, 51);" href="http://www.symfony-project.org/"&gt;http://www.symfony-project.org&lt;/a&gt;
&lt;br /&gt;      &lt;/div&gt;&lt;p&gt;
&lt;br /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;span style="color: rgb(255, 153, 0); font-weight: bold;"&gt;PHP technology video&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/i&gt;&lt;div id="vu_ytplayer_vjVQa1PpcFOHXlflG7yRwi78_I48roiyvSaEv_fWeDU="&gt;&lt;i&gt;&lt;a href="http://www.youtube.com/browse"&gt;Watch the latest videos on YouTube.com&lt;/a&gt;&lt;/i&gt;&lt;/div&gt;&lt;i&gt;&lt;script type="text/javascript" src="http://www.youtube.com/cp/vjVQa1PpcFOHXlflG7yRwi78_I48roiyvSaEv_fWeDU="&gt;&lt;/script&gt;&lt;/i&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-4100337882913255467?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/zhsGnzW1hCHCVgvx2_FRLWmZ1bA/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zhsGnzW1hCHCVgvx2_FRLWmZ1bA/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/zhsGnzW1hCHCVgvx2_FRLWmZ1bA/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/zhsGnzW1hCHCVgvx2_FRLWmZ1bA/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=wtfYIwz5"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=N9Rv5uDq"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=4IfB2HE1"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=4IfB2HE1" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=X39GtPNK"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=SbxGV42U"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=SbxGV42U" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=dsqK743c"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=nOTRW0ua"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=nOTRW0ua" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=nDeebs5s"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=milmPFRS"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=milmPFRS" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=Psif5aT3"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/_dDxpnQ0yFs" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/_dDxpnQ0yFs/php-symfony.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><enclosure url="http://www.symfony-project.org/downloads/demo/cart/products.tgz" length="44497" type="application/x-gzip" /><media:content url="http://www.symfony-project.org/downloads/demo/cart/products.tgz" fileSize="44497" type="application/x-gzip" /><itunes:explicit>no</itunes:explicit><itunes:subtitle> Open-source web PHP-Framework Symfony is a full-stack framework, a library of cohesive classes written in PHP5. It provides an architecture, components and tools for developers to build complex web applications faster. Choosing symfony allows you to rele</itunes:subtitle><itunes:author>sky.dodiya@gmail.com (SKY)</itunes:author><itunes:summary> Open-source web PHP-Framework Symfony is a full-stack framework, a library of cohesive classes written in PHP5. It provides an architecture, components and tools for developers to build complex web applications faster. Choosing symfony allows you to release your applications earlier, host and scale them without problem, and maintain them over time with no surprise. Symfony is based on experience. It does not reinvent the wheel: it uses most of the best practices of web development and integrates some great third-party libraries. Overview Symfony has Ajax helpers that make programming an elaborate interface a piece of cake. This tutorial will show you step-by-step how to create an Ajax-powered symfony application in minutes. Introduction Real lazy folks that can't stand reading long documentation are advised to watch the online screencast that demonstrates exactly what is written below. Adding items to a shopping cart in common e-commerce applications isn't very close to the actual "add to cart" metaphor, since it requires clicking an "add to cart" button, watch a new page (the shopping cart), and then go back to the shop or checkout with buttons. Ajax allows to get closer to the cart metaphor, by enabling drag-and-drop interactions and giving immediate visual feedback, without leaving the shop. The target application of this tutorial will be a symfony ported version of the shopping cart demo published by script.aculo.us in Rails. It uses the prototype JavaScript framework (bundled with symfony) and some script.aculo.us JavaScript that is the core of the JavaScript helpers. Application Setup First, create a sfdemo project, an app application and a cart module: $ cd /home/steve$ mkdir sfdemo$ cd sfdemo$ symfony init-project sfdemo$ symfony init-app app$ symfony init-module app cart Setup your web server to be able to access this new application (whether using a virtual host or an alias, as described in the web server setup chapter of the documentation). For this example, let's assume that this module is accessible via a localhost: http://localhost/cart/ Congratulations, it says. Your app must have access to the symfony JavaScript libraries. If your app doesn't work, check you can access these libraries within your browser (test http://localhost/sf/prototype/js/prototype.js for example). If not, you have 3 different ways to fix this problem: · configure Apache with the following Alias: · Alias /sf /$data_dir/symfony/web/sf · create a sf symbolic link in your web directory: · $ cd /home/steve/sfdemo/web· $ ln -sf /$data_dir/symfony/web/sf sf · copy the JavaScript files in web/js directory: · $ cd /home/steve/sfdemo/web· $ mkdir -p sf/js· $ cp /$data_dir/symfony/web/sf/prototype/js/*.js sf/js/ The Main Page First, you need to create a list of items to be purchased. To keep the project simple, the element list is accessed via a simple getProducts() method of the cart actions class. The shopping cart is a simple parameter of the sfUser object, set with the Attribute parameter holder. Modify the sfdemo/apps/app/modules/cart/actions/actions.class.php to: class cartActions extends sfActions{ public function executeIndex(){ $this-getUser()-setAttribute('cart', array()); $this-products = $this-getProducts(); } private function getProducts(){ return array('iPod black', 'iMac', 'iMac RC', 'iPod'); } } The main page of the cart module will contain a list of items, and a zone to drag items to. This zone is the shopping cart. So open the template sfdemo/apps/app/modules/cart/templates/indexSuccess.php and write in:&amp;lt;h1&amp;gt;symfony Apple store demo&amp;lt;/h1&amp;gt; &amp;lt;div id="shopping_cart"&amp;gt; &amp;lt;h2&amp;gt;Products:&amp;lt;/h2&amp;gt; &amp;lt;div id="product_list"&amp;gt; &amp;lt;?php foreach ($products as $id =&amp;gt; $title): ?&amp;gt; &amp;lt;?php echo image_tag('product'.$id, array( 'id' =&amp;gt; 'product_'.$id, 'class' =&amp;gt; 'products' )) ?&amp;gt; &amp;lt;?php endforeach; ?&amp;gt; &amp;lt;/div&amp;gt; &amp;lt;h2&amp;gt;Cart:&amp;lt;/h2&amp;gt; &amp;lt;div id="cart" class="cart"&amp;gt; &amp;lt;/div&amp;gt; &amp;lt;/div&amp;gt; You can</itunes:summary><itunes:keywords>iPhone,Sony,Ericssion,Nokia</itunes:keywords><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/php-symfony.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-2367489127217433488</guid><pubDate>Sat, 14 Jun 2008 04:28:00 +0000</pubDate><atom:updated>2008-07-04T20:53:14.676-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">PHP Smarty</category><title>PHP SMARTY</title><description>&lt;span style="font-weight: bold; color: rgb(153, 153, 0);font-size:130%;" &gt;PHP Smarty&lt;/span&gt;&lt;br /&gt;Smarty is a web template system written in PHP. Smarty is primarily promoted as a tool for separation of concerns, which is a common design strategy for certain kinds of applications. Smarty generates web content by the placement of special Smarty tags within a document. These tags are processed and substituted with other code.&lt;br /&gt;&lt;br /&gt;Tags are directives for Smarty that are enclosed by template delimiters. These directives can be variables, denoted by a dollar sign ($), functions, or logical or control flow statements. Smarty allows PHP programmers to define functions that can be accessed using Smarty tags.&lt;br /&gt;&lt;br /&gt;Smarty is intended to simplify compartmentalization, allowing the presentation of a web page to change separately from the back-end. Ideally, this eases the costs and efforts associated with software maintenance. Under successful application of this development strategy, designers are shielded from the back-end coding, and PHP programmers are shielded from the presentation coding.&lt;br /&gt;&lt;br /&gt;Smarty supports several high-level template programming features, including:&lt;br /&gt;&lt;br /&gt;* Control flow statements, foreach&lt;br /&gt;* if, elseif, else&lt;br /&gt;* variable modifiers - For example {$variable|nl2br}&lt;br /&gt;* user created functions&lt;br /&gt;* mathematical evaluation within the template&lt;br /&gt;&lt;br /&gt;along with other features. There are other template engines that also support these features. Smarty templates are often incorporated into existing PHP web applications to some extent. More often it is used where a web application or a website has a theme system built into it, where the templates can be changed from theme to theme.&lt;br /&gt;Code example&lt;br /&gt;&lt;br /&gt;Since Smarty separates PHP from HTML, you have two files:&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1//EN”&lt;br /&gt;“http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd”&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;{$title_text}&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;meta http-equiv=”content-type” content=”text/html; charset=iso-8859-1&amp;amp;#8243; /&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt; {* This is a little comment that won’t be visible in the HTML source *}&lt;br /&gt;&amp;lt;p&amp;gt;{$body_text}&amp;lt;/p&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&amp;lt;!– this is a little comment that will be seen in the HTML source –&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;In the business logic code you can configure Smarty to use this template:&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;define(’SMARTY_DIR’, ’smarty-2.6.9/’ );&lt;br /&gt;require_once(SMARTY_DIR . ‘Smarty.class.php’);&lt;br /&gt;&lt;br /&gt;$smarty = new Smarty();&lt;br /&gt;$smarty-&gt;template_dir = ‘./templates/’;&lt;br /&gt;$smarty-&gt;compile_dir = ‘./templates/compile/’;&lt;br /&gt;$smarty-&gt;cache_dir = ‘./templates/cache/’;&lt;br /&gt;$smarty-&gt;caching = false;&lt;br /&gt;$smarty-&gt;error_reporting = E_ALL; // LEAVE E_ALL DURING DEVELOPMENT&lt;br /&gt;&lt;br /&gt;$smarty-&gt;debugging = true;&lt;br /&gt;$smarty-&gt;assign(’title_text’, ‘TITLE: This is the Smarty basic example …’);&lt;br /&gt;$smarty-&gt;assign(’body_text’, ‘BODY: This is the message set using assign()’);&lt;br /&gt;$smarty-&gt;display(’index.tpl’);&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Notes and references&lt;br /&gt;&lt;br /&gt;Smarty separates PHP code, (often represented as business logic) from HTML, (often represented as presentation logic).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(153, 153, 0);"&gt;Crash Course&lt;/span&gt;&lt;br /&gt;For those of you who have used PHP template engines, the basic concepts&lt;br /&gt;of Smarty should look quite familiar. In your PHP application you&lt;br /&gt;assign variables for use in the template, then you display it.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.php&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;include('Smarty.class.php');&lt;br /&gt;&lt;br /&gt;// create object&lt;br /&gt;$smarty = new Smarty;&lt;br /&gt;&lt;br /&gt;// assign some content. This would typically come from&lt;br /&gt;// a database or other source, but we'll use static&lt;br /&gt;// values for the purpose of this example.&lt;br /&gt;$smarty-&gt;assign('name', 'george smith');&lt;br /&gt;$smarty-&gt;assign('address', '45th &amp;amp; Harris');&lt;br /&gt;&lt;br /&gt;// display it&lt;br /&gt;$smarty-&gt;display('index.tpl');&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The template file then contains the output interspersed with tags that&lt;br /&gt;&lt;br /&gt;Smarty replaces with assigned content.&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.tpl      &lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&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;User Info&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;br /&gt;User Information:&amp;lt;p&amp;gt;&lt;br /&gt;&lt;br /&gt;Name: {$name}&amp;lt;br&amp;gt;&lt;br /&gt;Address: {$address}&amp;lt;br&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;   &lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Output&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&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;User Info&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;br /&gt;User Information:&amp;lt;p&amp;gt;&lt;br /&gt;&lt;br /&gt;Name: george smith&amp;lt;br&amp;gt;&lt;br /&gt;Address: 45th &amp;amp; Harris&amp;lt;br&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;As you can see, Smarty cleanly separates your presentation elements&lt;br /&gt;(HTML, CSS, etc.) from your application code. However, it does not&lt;br /&gt;necessarily separate logic entirely from your templates. With respect&lt;br /&gt;to Smarty's design principles, so long as the logic in the templates is&lt;br /&gt;for presentation only, it is permissible to use it. For instance,&lt;br /&gt;looping over table row colors or including one template from another&lt;br /&gt;would be considered presentation logic. This is something the&lt;br /&gt;application should not need to accomodate (it just supplies an array of&lt;br /&gt;data.) The idea is to keep the template designer role and application&lt;br /&gt;programming role separated. You should be able to completely tear down&lt;br /&gt;the templates and rebuild them without touching the code base, all&lt;br /&gt;while retaining full control of the presentation. With this comes an&lt;br /&gt;important point: there is nothing stopping you from putting application&lt;br /&gt;logic in the template. Smarty has more than enough power to let you&lt;br /&gt;shoot yourself in the foot, so you must have some self discipline in&lt;br /&gt;this respect. Don't worry though, with a little bit of practice it&lt;br /&gt;becomes quite self-evident what logic belongs where.&lt;br /&gt;Smarty has some nice features that take advantage of this design&lt;br /&gt;principle, as you'll see in the next example. One prominant feature of&lt;br /&gt;Smarty is variable modifiers. These are used to alter the output of&lt;br /&gt;assigned variables from within the template. In our example, we would&lt;br /&gt;like to display George's name capitalized, and we would like to&lt;br /&gt;properly HTML escape the amphersand (&amp;amp;) symbol in the address. We also&lt;br /&gt;show how to display the current date with a custom formatting.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.tpl      &lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&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;User Info&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;br /&gt;User Information:&amp;lt;p&amp;gt;&lt;br /&gt;&lt;br /&gt;Name: {$name|capitalize}&amp;lt;br&amp;gt;&lt;br /&gt;Addr: {$address|escape}&amp;lt;br&amp;gt;&lt;br /&gt;Date: {$smarty.now|date_format:"%Y-%m-%d"}&amp;lt;br&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Output&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&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;User Info&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;br /&gt;User Information:&amp;lt;p&amp;gt;&lt;br /&gt;&lt;br /&gt;Name: George Smith&amp;lt;br&amp;gt;&lt;br /&gt;Addr: 45th &amp;amp;amp; Harris&amp;lt;br&amp;gt;&lt;br /&gt;Date: 2003-12-19&amp;lt;br&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Using modifiers, we have just handed formatting control of the assigned&lt;br /&gt;content over to the template and out of the application logic. Now we&lt;br /&gt;can assign the raw data straight to the template (no mods necessary for&lt;br /&gt;presentation purposes!) You can chain any number of modifiers together&lt;br /&gt;on one variable, making this feature quite flexible. There are many&lt;br /&gt;more modifiers that come with Smarty, or you can make your own with its&lt;br /&gt;easy to use plugin architecture. Drop your new modifier into the plugin&lt;br /&gt;directory, then mention it in the template!&lt;br /&gt;Smarty also has what are known as template functions. Template&lt;br /&gt;functions carry out tasks in the template that may or may not display&lt;br /&gt;content. For example, you can include other templates from within a&lt;br /&gt;template with the include function. Let's say you have many templates&lt;br /&gt;with the same header and footer information. You can manage these as&lt;br /&gt;separate templates and include them.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;header.tpl      &lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&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;{$title|default:"no title"}&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;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;footer.tpl&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.tpl&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;{include file="header.tpl" title="User Info"}&lt;br /&gt;User Information:&lt;p&gt;&lt;br /&gt;Name: {$name|capitalize}&lt;br /&gt;Address: {$address|escape}&lt;br /&gt;{include file="footer.tpl"}&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;Output&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;html&amp;gt; &amp;lt;head&amp;gt; &amp;lt;title&amp;gt;User Info&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt; &amp;lt;body&amp;gt;&lt;br /&gt;User Information:&amp;lt;p&amp;gt;&lt;br /&gt;Name: George Smith&amp;lt;br&amp;gt;&lt;br /&gt;Address: 45th &amp;amp;amp; Harris&amp;lt;br&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt; &amp;lt;/html&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;One feature of the include function is locally scoped variables. Notice&lt;br /&gt;that $title is a template variable not assigned directly to the&lt;br /&gt;template, but assigned by passing it as an attribute to the include&lt;br /&gt;function. This way the $title variable is only available within the&lt;br /&gt;scope of the header template, and can be dynamically changed any time&lt;br /&gt;the header.tpl file is included. Also, notice we used the default&lt;br /&gt;modifier on $title so in the case $title is empty, the text "no title"&lt;br /&gt;will show up instead of displaying nothing.&lt;br /&gt;There are some nice functions that automate tasks such as html dropdown&lt;br /&gt;boxes. One is html_options. You assign the arrays of data to the&lt;br /&gt;template, then this function does all the work to generate the HTML&lt;br /&gt;output for it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.php&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;include('Smarty.class.php');&lt;br /&gt;&lt;br /&gt;// create object&lt;br /&gt;$smarty = new Smarty;&lt;br /&gt;&lt;br /&gt;// assign options arrays&lt;br /&gt;$smarty-&gt;assign('id', array(1,2,3,4,5));&lt;br /&gt;$smarty-&gt;assign('names', array('bob','jim','joe','jerry','fred'));&lt;br /&gt;&lt;br /&gt;// display it&lt;br /&gt;$smarty-&gt;display('index.tpl');&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.tpl&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;select name=user&amp;gt;&lt;br /&gt;{html_options values=$id output=$names selected="5"}&lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;output&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;select name=user&amp;gt;&lt;br /&gt;&amp;lt;option label="bob"&lt;br /&gt;&lt;br /&gt;value="1"&amp;gt;bob&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option label="jim"&lt;br /&gt;&lt;br /&gt;value="2"&amp;gt;jim&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option label="joe"&lt;br /&gt;&lt;br /&gt;value="3"&amp;gt;joe&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option label="jerry"&lt;br /&gt;&lt;br /&gt;value="4"&amp;gt;jerry&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;option label="fred" value="5"&lt;br /&gt;&lt;br /&gt;selected="selected"&amp;gt;fred&amp;lt;/option&amp;gt;&lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Smarty facilitates a convenient way to loop over arrays of data with&lt;br /&gt;the section function. Here's an example of that, and we also threw in&lt;br /&gt;alternating row colors via the cycle function, and we use the strip&lt;br /&gt;function to strip out newlines and white space.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.php&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;include('Smarty.class.php');&lt;br /&gt;&lt;br /&gt;// create object&lt;br /&gt;$smarty = new Smarty;&lt;br /&gt;&lt;br /&gt;// assign an array of data&lt;br /&gt;$smarty-&gt;assign('name', array('bob','jim','joe','jerry','fred'));&lt;br /&gt;&lt;br /&gt;// assign an associative array of data&lt;br /&gt;$smarty-&gt;assign('users', array(&lt;br /&gt; array('name' =&gt; 'bob', 'phone' =&gt; '555-3425'),&lt;br /&gt; array('name' =&gt; 'jim', 'phone' =&gt; '555-4364'),&lt;br /&gt; array('name' =&gt; 'joe', 'phone' =&gt; '555-3422'),&lt;br /&gt; array('name' =&gt; 'jerry', 'phone' =&gt; '555-4973'),&lt;br /&gt; array('name' =&gt; 'fred', 'phone' =&gt; '555-3235')&lt;br /&gt; ));&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;// display it&lt;br /&gt;$smarty-&gt;display('index.tpl');&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.tpl&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;{section name=mysec loop=$name}&lt;br /&gt;{strip}&lt;br /&gt;&amp;lt;tr bgcolor="{cycle&lt;br /&gt;&lt;br /&gt;values="#eeeeee,#dddddd"}"&amp;gt;&lt;br /&gt;   &amp;lt;td&amp;gt;{$name[mysec]}&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;{/strip}&lt;br /&gt;{/section}&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;{section name=mysec loop=$users}&lt;br /&gt;{strip}&lt;br /&gt;&amp;lt;tr bgcolor="{cycle&lt;br /&gt;&lt;br /&gt;values="#aaaaaa,#bbbbbb"}"&amp;gt;&lt;br /&gt;   &amp;lt;td&amp;gt;{$users[mysec].name}&amp;lt;/td&amp;gt;&lt;br /&gt;   &amp;lt;td&amp;gt;{$users[mysec].phone}&amp;lt;/td&amp;gt;&lt;br /&gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;{/strip}&lt;br /&gt;{/section}&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;output&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#eeeeee"&amp;gt;&amp;lt;td&amp;gt;bob&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#dddddd"&amp;gt;&amp;lt;td&amp;gt;jim&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#eeeeee"&amp;gt;&amp;lt;td&amp;gt;joe&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#dddddd"&amp;gt;&amp;lt;td&amp;gt;jerry&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#eeeeee"&amp;gt;&amp;lt;td&amp;gt;fred&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#aaaaaa"&amp;gt;&amp;lt;td&amp;gt;bob&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;555-34&lt;br /&gt;25&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#bbbbbb"&amp;gt;&amp;lt;td&amp;gt;jim&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;555-43&lt;br /&gt;64&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#aaaaaa"&amp;gt;&amp;lt;td&amp;gt;joe&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;555-34&lt;br /&gt;22&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#bbbbbb"&amp;gt;&amp;lt;td&amp;gt;jerry&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;555-&lt;br /&gt;4973&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;tr&lt;br /&gt;bgcolor="#aaaaaa"&amp;gt;&amp;lt;td&amp;gt;fred&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;555-3&lt;br /&gt;235&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Smarty also has built-in caching capabilities to help speed up the page&lt;br /&gt;rendering. A copy of the template output is stored in a text file, then&lt;br /&gt;that is displayed upon subsequent calls to the request instead of&lt;br /&gt;dynamically rendering the page each time. This can speedup page&lt;br /&gt;rendering substantially, especially if there is a lot of processing&lt;br /&gt;involved to create the page such as database calls and variable&lt;br /&gt;assignments.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 153, 0);"&gt;index.php&lt;/span&gt;&lt;br /&gt;&lt;div style="border: thin double rgb(50, 0, 255);"&gt;&lt;br /&gt;include('Smarty.class.php');&lt;br /&gt;&lt;br /&gt;// create object&lt;br /&gt;$smarty = new Smarty;&lt;br /&gt;$smarty-&gt;caching = true;&lt;br /&gt;&lt;br /&gt;// see if the page is already cached&lt;br /&gt;if(!$smarty-&gt;is_cached('index.tpl')) {&lt;br /&gt;&lt;br /&gt;// not cached, so you might do some database queries here,&lt;br /&gt;// then assign the returned content. We just use static&lt;br /&gt;// values for this example.&lt;br /&gt;$smarty-&gt;assign('name', 'george smith');&lt;br /&gt;$smarty-&gt;assign('address', '45th &amp;amp; Harris');&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// display it&lt;br /&gt;$smarty-&gt;display('index.tpl');&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;You can also have multiple cached versions of a single page by passing&lt;br /&gt;a unique cache id to the display() function, check out the docs on that&lt;br /&gt;one!&lt;br /&gt;&lt;br /&gt;There are many more builtin and custom functions that come with Smarty,&lt;br /&gt;or you can make your own, again with the easy to use plugin&lt;br /&gt;architecture.&lt;br /&gt;&lt;br /&gt;Again, we'll take note that all of the functionality of Smarty&lt;br /&gt;(modifiers, functions, etc.) deal exclusively with the presentation of&lt;br /&gt;content. This is the design principle Smarty was built upon.&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-2367489127217433488?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ngzdQ0HXCAXPjbHSaQx7rjMhpkU/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ngzdQ0HXCAXPjbHSaQx7rjMhpkU/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ngzdQ0HXCAXPjbHSaQx7rjMhpkU/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ngzdQ0HXCAXPjbHSaQx7rjMhpkU/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=zg878QdV"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=X2V8nuHl"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=VDyEogLe"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=VDyEogLe" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=FCFAVgGJ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=wbrPsbRJ"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=wbrPsbRJ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=T8OzVQ32"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=H1axioQl"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=H1axioQl" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=EI6Rhl4J"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=wWo7laY4"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=wWo7laY4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=i3xQJRL9"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/qvdodyCsirI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/qvdodyCsirI/php_13.html</link><author>sky.dodiya@gmail.com (SKY)</author><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/php_13.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-278152351804857753</guid><pubDate>Tue, 10 Jun 2008 09:20:00 +0000</pubDate><atom:updated>2008-06-24T23:30:35.378-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">iPhone</category><title>iPhone</title><description>&lt;span style="color: #6699CC);font-size:180%;" &gt;&lt;span style="color: #6699CC;"&gt;iPhone 3G&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;div id="vu_ytplayer_vjVQa1PpcFOHXlflG7yRwhd51wsllbj549ddvMXAYDs="&gt;&lt;a href="http://www.youtube.com/browse"&gt;Watch the latest videos on YouTube.com&lt;/a&gt;&lt;/div&gt;&lt;script type="text/javascript" src="http://www.youtube.com/cp/vjVQa1PpcFOHXlflG7yRwhd51wsllbj549ddvMXAYDs="&gt;&lt;/script&gt;&lt;br /&gt; &lt;p class="MsoNormal"&gt;THE next-generation 3G Apple &lt;a href="http://www.news.com.au/technology/feature/0,,5016091,00.html"&gt;iPhone&lt;/a&gt; will be available in &lt;st1:country-region&gt;&lt;st1:place&gt;Australia&lt;/st1:place&gt;&lt;/st1:country-region&gt; on prepay plans without a contract when it is released here next month. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;!-- // #article-intro --&gt;  &lt;p&gt;Both Optus and Vodafone – the first carriers to announce an iPhone offering – today confirmed they would offer the handset on a prepay plan, a key concern among the phone's target demographic. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Vodafone spokesman Greg Spears said customers would be able to buy an iPhone outright and purchase credit without being locked into a contract. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Features such as applications downloads, online synchronisation and email would be available on certain prepay plans, he said. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Both carriers have begun allowing customers to pre-register for an iPhone online and in retail stories. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Apple launched its new 3G iPhone this morning and slashed the cost to almost half the price of the existing model during the Worldwide Developer's Conference in &lt;st1:city&gt;&lt;st1:place&gt;San Francisco&lt;/st1:place&gt;&lt;/st1:City&gt;. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Chief executive officer Steve Jobs said the new phone would be smaller and faster and would appeal to the 56 per cent of people – Apple says – who want an iPhone but have not bought one because of the price. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;The new version will be released in &lt;st1:country-region&gt;&lt;st1:place&gt;Australia&lt;/st1:place&gt;&lt;/st1:country-region&gt; on July 11th. Specific contract and pricing details for &lt;st1:country-region&gt;&lt;st1:place&gt;Australia&lt;/st1:place&gt;&lt;/st1:country-region&gt; have not yet been released. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;In the &lt;st1:country-region&gt;&lt;st1:place&gt;US&lt;/st1:place&gt;&lt;/st1:country-region&gt;, the new 3G iPhone will cost from $US199 ($209.32) for the 8GB model to $US299 ($314.50) for 16GB. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Despite selling 6 million iPhones in one year, Apple said its research showed the cost of the previous model had put off would-be buyers. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;The new model has 3G speeds faster than the Nokia N95 and Treo 750, according to Apple, and is almost on par with WiFi speeds. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;It has better battery life, with almost 5 hours of 3G talk time, and sports a slimmer form. Some of the phone's more innovative features stem from Apple's software development program. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Apple is internationally launching a new App Store that will make applications available for download onto the iPhone. Games, office tools and even learning aids will be available for free, or around $US9.99 ($10.50), according to demonstrations. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Third-party developers will keep 70 per cent of revenue for applications sold through the App Store, which will add FairPlay digital rights management (DRM) to the files. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;The company also announced MobileMe today, an online synchronisation tool that unifies data between computers and the iPhone using a web-based interface. This feature, which includes iDisk integration for online file storage and sending, will replace Apple's existing .mac service. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;The iPhone 3G will be released with version 2.0 software, which includes support for Office and iWork documents, live contact search, bulk message delete, image saving, scientific calculator, language support and parental controls. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;Mr Jobs' keynote address at the Worldwide Developer's Conference did not mention the iPhone's camera – which was expected to be upgraded from the existing 2 megapixel configuration – or video chat. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;  &lt;p&gt;The next-generation model will be released in 22 countries on July 11th and will eventually reach 70 countries in total. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt; &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_vJc4QlgRE6c/SE5HtsUHtwI/AAAAAAAAAsI/Wc4gM6OY_vc/s1600-h/apple_iphone3g_20080609.jpg"&gt;&lt;img style="cursor: pointer; width: 468px; height: 283px;" src="http://2.bp.blogspot.com/_vJc4QlgRE6c/SE5HtsUHtwI/AAAAAAAAAsI/Wc4gM6OY_vc/s320/apple_iphone3g_20080609.jpg" alt="" id="BLOGGER_PHOTO_ID_5210180669229479682" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;Subscibe Here for RSS Feed&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/3595613705597819503-278152351804857753?l=technothinktank.blogspot.com' alt='' /&gt;&lt;/div&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/hRWEhzxIX5E7cNzQNUzbnjERGdI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hRWEhzxIX5E7cNzQNUzbnjERGdI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/hRWEhzxIX5E7cNzQNUzbnjERGdI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/hRWEhzxIX5E7cNzQNUzbnjERGdI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=yVbbYQaq"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=41" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=LK8jq3Dc"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=43" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=lFHk9H1T"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=lFHk9H1T" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=TQg9K7R2"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=50" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=C0KiVuVD"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=C0KiVuVD" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=66I4MMxi"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=52" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=vG8n8Xa4"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=vG8n8Xa4" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=lLPp6sY0"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=54" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=cwxNRIKh"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?i=cwxNRIKh" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~f/blogspot/wGPX?a=VxhO35Pe"&gt;&lt;img src="http://feeds.feedburner.com/~f/blogspot/wGPX?d=129" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/blogspot/wGPX/~4/AjjruVGiVRQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/blogspot/wGPX/~3/AjjruVGiVRQ/iphone.html</link><author>sky.dodiya@gmail.com (SKY)</author><media:thumbnail url="http://2.bp.blogspot.com/_vJc4QlgRE6c/SE5HtsUHtwI/AAAAAAAAAsI/Wc4gM6OY_vc/s72-c/apple_iphone3g_20080609.jpg" height="72" width="72" /><thr:total xmlns:thr="http://purl.org/syndication/thread/1.0">0</thr:total><feedburner:origLink>http://technothinktank.blogspot.com/2008/06/iphone.html</feedburner:origLink></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3595613705597819503.post-5923591658575194704</guid><pubDate>Sun, 08 Jun 2008 08:37:00 +0000</pubDate><atom:updated>2008-06-09T19:36:42.888-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Linux Begginers</category><title>Linux Begginers</title><description>&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;1. What is Linux?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Linux is an &lt;a href="http://www.opensource.org/"&gt;Open Source&lt;/a&gt;, free Operating System created by Linus Torvalds. For more information, please see our General Information page.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;2. What is the linux kernel?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The Linux kernel is the core of the Linux operating system. To find out which version of the Linux kernel you are running, simply type uname -r in a terminal. For more information on the Linux kernel, please visit &lt;a href="http://www.kernel.org"&gt;http://www.kernel.org&lt;/a&gt;. For information on how to install or compile the Linux Kernel, please see our Kernel Compile/Upgrade Guide.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;3. What distribution of Linux should I install?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of the pleasures of running &lt;a href="http://www.ubuntu.com/"&gt;linux&lt;/a&gt; is choice. The choice of which Linux Distribution you wish to run is 100% up to you. You can browse our Distributions Page for comparisons of the various distributions out there. If you are totally new to linux we suggest you start off with either Red Hat Linux or Mandrake Linux as they are easier to install, configure and maintain.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;   4. Who is the root user?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The root user is the master user or systems adminstrator of the machine. The root user has full access to all files and directories, which is why you will only want to use the root account to perform system maintainance or to install applications.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;   5. How do I reboot my machine?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In order to reboot your machine, you must instruct the &lt;a href="http://www.kernel.org/"&gt;Linux kernel&lt;/a&gt; to stop all the processes (programs) it's currently running. Do not simply press the reboot button on the front of your computer case, as Linux must be properly shut down/restarted. To restart your machine, as root, run either of the following commands in a terminal:&lt;br /&gt;reboot&lt;br /&gt;shutdown -r now&lt;br /&gt;On most systems you can also press (all at once) the control, alt and delete keys.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;   6. How do I shut down my machine?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In order to shut down your machine, you must instruct the Linux kernel to stop all the processes (programs) it's currently running. Do not simply press the power off button on the front of your computer case, as Linux must be properly shut down/restarted. To shut down your machine, as root, run either of the following commands in a terminal:&lt;br /&gt;halt&lt;br /&gt;shutdown -h now&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;   7. How do I remove/uninstall Lilo/Grub?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you want to remove the Lilo or Grub boot loader from your system (if you are uninstalling linux etc) follow the procedures below:&lt;br /&gt;&lt;br /&gt;For Windows 95/98 etc:&lt;br /&gt;Use a dos boot disk and at the command prompt type:&lt;br /&gt;fdisk /mbr&lt;br /&gt;&lt;br /&gt;For &lt;a href="http://www.microsoft.com/windows/products/windowsxp/default.mspx"&gt;Windows XP&lt;/a&gt;:&lt;br /&gt;Boot off the XP Installation CD and go into rescue mode. From there run the command:&lt;br /&gt;fixmbr&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;   8. How do I add a user?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While logged in as root, type adduser username at the shell prompt, replacing username with the name you want to use to log in. You can create as many users as you wish, one for each member of your family, for example.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;   9. How do I delete a user?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;While logged in as root, type userdel username at the shell prompt, replacing username with the user name you wish to delete.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  10. How do I change my login password?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To set the password for a specific user, type (while logged in as root) passwd username at the shell prompt, replacing username with the name of the person who's password you wish to change. By typing just passwd you'll be able to change the password of the user under who's name you're currently logged in as. Do not use passwords which are easy to guess, like your middle name or your pets name.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  11. How do I change directories?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cd - Used to change directories&lt;br /&gt;Usage: cd [directory]&lt;br /&gt;Example: cd /home/joey/html&lt;br /&gt;Example: cd ../ (to move back one directory)&lt;br /&gt;Example: cd (to return to your home directory)&lt;br /&gt;For more information, in a terminal, type man cd&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  12. How do I copy files?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;cp - Used to copy files/directories from one location to another&lt;br /&gt;Usage: cp file newlocation&lt;br /&gt;Example: cp /home/joey/index.html /var/www/index.html&lt;br /&gt;Example: cp /home/joey/* /var/www/ (this will copy everything in /home/joey to /var/www/)&lt;br /&gt;For more information, in a terminal, type man cp&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  13. How do I rename files?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;mv - Used to move or rename files&lt;br /&gt;Usage: mv file location (to move)&lt;br /&gt;Usage: mv filename newfilename (to rename)&lt;br /&gt;Example: mv index.html /var/www/index.html (to move)&lt;br /&gt;Example: mv index.html index2.html (rename)&lt;br /&gt;For more information, in a terminal, type man mv&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  14. How do I move files?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;mv - Used to move or rename files&lt;br /&gt;Usage: mv file location (to move)&lt;br /&gt;Usage: mv filename newfilename (to rename)&lt;br /&gt;Example: mv index.html /var/www/index.html (to move)&lt;br /&gt;Example: mv index.html index2.html (rename)&lt;br /&gt;For more information, in a terminal, type man mv&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  15. How do I edit files?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The default editor that ships with almost every distribution of Linux is Vi. This editor is slightly advanced and confuses most newbies. We suggest starting off with Pico, a more simple editor. Pico is part of the Pine software package which can be downloaded at http://www.washington.edu/pine (It might already be installed on your system). To edit a file with pico, simply run:&lt;br /&gt;pico filename&lt;br /&gt;&lt;br /&gt;This will open up the file and allow to you edit it. At the bottom of the screen you will notice the various commands that you have access to with Pico. If you wish to save the file and exit, simply hold down the control key and hit the x key on your keyboard.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  16. How do I list directory contents?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;ls - To list the contents of a directory&lt;br /&gt;Usage: ls [flags] directory&lt;br /&gt;Example: ls (To list the current directory)&lt;br /&gt;Example: ls /home/joey (To list the contents of /home/joey)&lt;br /&gt;Example: ls -a (To list hidden files)&lt;br /&gt;Example: ls -l (To list file/directory permissions and file sizes)&lt;br /&gt;Example: ls -al /home/joey (To list all files and permissions in /home/joey)&lt;br /&gt;For more information, in a terminal, type man ls&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  17. How do I delete files?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To delete a file you must first have write permission to it. For information about permissions, click here. Once you have write permission, in a terminal run:&lt;br /&gt;rm filename&lt;br /&gt;There is no "Recycle Bin" in Linux so once you delete a file, it's gone for good.&lt;br /&gt;When removing files, you may use an astrix (*) as a wildcard flag to remove certain files, for example if I wanted to remove all files that began with the letter j, I would run rm j*&lt;br /&gt;If anyone tells you to run rm -rf / as root, DO NOT LISTEN TO THEM. Running this command will delete all the files/directories on your Linux system.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  18. How do I delete directories?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;If you have ownership to the directory and the directory is empty, you can simply type rmdir directoryname to remove the directory. If the directory is not empty and you wish to simply delete it and all its contents, run rm -rf directoryname&lt;br /&gt;Please be careful with the -rf flag, as it will remove everything in the specified directory including sub directories. With root access and the rm -rf command you can wipe out your entire system if you make an error.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  19. How do I access my cdrom drive?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Linux requires you to mount your cdrom/floppy drives when you wish to use them. On most Linux distributions, the mount command will require root access. Depending on which Linux distribution you run, one of the following commands should mount your cdrom drive. As root, run:&lt;br /&gt;mount /dev/cdrom /mnt/cdrom&lt;br /&gt;mount /dev/cdrom /cdrom&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  20. How do I access my floppy drive?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Linux requires you to mount your cdrom/floppy drives when you wish to use them. On most Linux distributions, the mount command will require root access. Depending on which Linux distribution you run, one of the following commands should mount your floppy drive. As root, run:&lt;br /&gt;mount /dev/fd0 /mnt/floppy&lt;br /&gt;mount /dev/fd0 /floppy&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  21. How do I view/change ownership on files/directories?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One of the great features of Linux is that it is a multi-user system. With multi-users, it allows certain users to own files and directories so nobody else can access/modify them, for example your /home directory. To change the ownership of a file/directory, as root execute the following command in a terminal:&lt;br /&gt;chown username. filename/directory&lt;br /&gt;This will change the ownership and group ownership of the specified file or directory to the specified user. For more information, in a terminal, type man chown&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  22. How do I view/change permissions on files/directories?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are 3 different attributes a file can have that make up the permissions for the file.&lt;br /&gt;There is read access that allows users to read the file.&lt;br /&gt;There is write access that allows users to modify the file.&lt;br /&gt;There is executable access that allows users to execute the file.&lt;br /&gt;&lt;br /&gt;From these three attributes, you now have three different levels of permissions, the first being for the owner of the file, the second being for the group the file belongs to and the third being all other users on the system.&lt;br /&gt;&lt;br /&gt;To view the current permissions on files and directories run the following command:&lt;br /&gt;ls -l and you should see something that looks like:&lt;br /&gt;&lt;br /&gt;drwxrwxr-x    3 joey     html         4096 Sep 12  2000 images/&lt;br /&gt;-rw-rw-r--    1 joey     html          267 Aug  8 12:55 index.shtml&lt;br /&gt;&lt;br /&gt;The above shows you that images is a directory (d) and that the owner and group (joey html) have read (r), write (w) and execute (x) permissions while other users on the system only have read (r) and execute (x) permissions.&lt;br /&gt;For the index.shtml file, it shows joey and html as the owner and group and they both have read and write access to the file. It also shows that other users on the system only have read access. Note there is no executable permission since the file is not an executable.&lt;br /&gt;&lt;br /&gt;To modify the permissions on a file, you either have to own it or be logged in as root. To modify the permissions, in a terminal type:&lt;br /&gt;chmod xxx filename/directory&lt;br /&gt;You will have to replace the xxx flags with the permissions you wish to change. You can either go by the numerical value or by the actuals.&lt;br /&gt;&lt;br /&gt;Some common numerical values are:&lt;br /&gt;755 - Read, Write, Execute for owner, read, execute for group and other.&lt;br /&gt;644 - Read, Write for owner, read for group and other.&lt;br /&gt;666 - Read, Write for all.&lt;br /&gt;700 - Read, Write, Execute for owner, nothing for group, other.&lt;br /&gt;&lt;br /&gt;So if you wanted to make a file an executable for your user and other users on the system, you would run the following:&lt;br /&gt;&lt;br /&gt;chmod 755 somefile&lt;br /&gt;&lt;br /&gt;For more information, in a terminal, type man chmod&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  23. How do I find files on my system?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;There are two methods to search for files on your Linux machine, one method being the locate command and the other being the find command. If you wish to use the locate command, you must first update the locate database by running the following command in a terminal as root:&lt;br /&gt;/usr/bin/updatedb&lt;br /&gt;This will create an index of all the files and their locations on your hard drive. Once updatedb has completed running, you may now search your drive for a specific file by running the following command in a terminal:&lt;br /&gt;/usr/bin/locate filename&lt;br /&gt;&lt;br /&gt;Another way to search your linux system is with the find command. To find a file on your sytem with the find command, in a terminal run the follwoing:&lt;br /&gt;/usr/bin/find / -name filename Be sure to replace "filename" with the actual name of the file.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  24. How do I unzip a .tar.gz/.tgz file?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To extract .tar.gz or .tgz files, run the following command in a terminal:&lt;br /&gt;tar -zxvf file.tar.gz (or file.tgz)&lt;br /&gt;This will normally create a new directory based on the filename. If you want to extract a filename called file.tar (without the .gz) simply run:&lt;br /&gt;tar -xvf file.tar&lt;br /&gt;For more information, in a terminal, type man tar&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102, 0);"&gt;  25. How do I unzip a .bz2 file?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To extract .bz2 files, run the following command in a terminal:&lt;br /&gt;bunzip2 -dv file.bz2&lt;br /&gt;This will normally create a new directory based on the filename. For more information, in a terminal, type man buznip2&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(255, 102,