<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>PHP Scripting Language</title>
	<atom:link href="http://phpisthebest.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://phpisthebest.wordpress.com</link>
	<description>Hypertext Preprocessor</description>
	<lastBuildDate>Thu, 06 Jan 2011 18:21:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='phpisthebest.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/8aca059ad9b8a591002d6083e2ea4dd8?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>PHP Scripting Language</title>
		<link>http://phpisthebest.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://phpisthebest.wordpress.com/osd.xml" title="PHP Scripting Language" />
	<atom:link rel='hub' href='http://phpisthebest.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Differences between HTML and XHTML</title>
		<link>http://phpisthebest.wordpress.com/2009/08/28/differences-between-html-and-xhtml/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/28/differences-between-html-and-xhtml/#comments</comments>
		<pubDate>Fri, 28 Aug 2009 11:49:49 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/2009/08/28/differences-between-html-and-xhtml/</guid>
		<description><![CDATA[XHTML is not very different from the HTML 4.01 standard. So, bringing your code up to the 4.01 standard is a good start. Our complete HTML 4.01 reference can help you with that. In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER skip closing tags (like &#60;/p&#62;). The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=56&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>XHTML is not very different from the HTML 4.01 standard.</p>
<p>So, bringing your code up to the 4.01 standard is a good start.</p>
<p>Our complete HTML 4.01 reference can help you with that.</p>
<p>In addition, you should start NOW to write your HTML code in lowercase letters, and NEVER skip closing tags (like &lt;/p&gt;).<br />
The Most Important Differences:<br />
<strong>XHTML elements must be properly nested<br />
XHTML elements must always be closed<br />
XHTML elements must be in lowercase<br />
XHTML documents must have one root element<br />
XHTML Elements Must Be Properly Nested</strong></p>
<p>In HTML, some elements can be improperly nested within each other, like this:&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/b&gt;&lt;/i&gt;</p>
<p>In XHTML, all elements must be properly nested within each other, like this:&lt;b&gt;&lt;i&gt;This text is bold and italic&lt;/i&gt;&lt;/b&gt;</p>
<p>Note: A common mistake with nested lists, is to forget that the inside list must be within &lt;li&gt; and &lt;/li&gt; tags.</p>
<p>This is wrong:&lt;ul&gt;<br />
&lt;li&gt;Coffee&lt;/li&gt;<br />
&lt;li&gt;Tea<br />
&lt;ul&gt;<br />
&lt;li&gt;Black tea&lt;/li&gt;<br />
&lt;li&gt;Green tea&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;li&gt;Milk&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>This is correct:&lt;ul&gt;<br />
&lt;li&gt;Coffee&lt;/li&gt;<br />
&lt;li&gt;Tea<br />
&lt;ul&gt;<br />
&lt;li&gt;Black tea&lt;/li&gt;<br />
&lt;li&gt;Green tea&lt;/li&gt;<br />
&lt;/ul&gt;<br />
&lt;/li&gt;<br />
&lt;li&gt;Milk&lt;/li&gt;<br />
&lt;/ul&gt;</p>
<p>Notice that we have inserted a &lt;/li&gt; tag after the &lt;/ul&gt; tag in the &#8220;correct&#8221; code example.<br />
XHTML Elements Must Always Be Closed</p>
<p>Non-empty elements must have a closing tag.</p>
<p>This is wrong:&lt;p&gt;This is a paragraph<br />
&lt;p&gt;This is another paragraph</p>
<p>This is correct:&lt;p&gt;This is a paragraph&lt;/p&gt;<br />
&lt;p&gt;This is another paragraph&lt;/p&gt;</p>
<p>Empty Elements Must Also Be Closed</p>
<p>Empty elements must also be closed.</p>
<p>This is wrong:A break: &lt;br&gt;<br />
A horizontal rule: &lt;hr&gt;<br />
An image: &lt;img src=&#8221;happy.gif&#8221; alt=&#8221;Happy face&#8221;&gt;</p>
<p>This is correct:A break: &lt;br /&gt;<br />
A horizontal rule: &lt;hr /&gt;<br />
An image: &lt;img src=&#8221;happy.gif&#8221; alt=&#8221;Happy face&#8221; /&gt;</p>
<p>XHTML Elements Must Be In Lower Case</p>
<p>Tag names and attributes must be in lower case.</p>
<p>This is wrong:&lt;BODY&gt;<br />
&lt;P&gt;This is a paragraph&lt;/P&gt;<br />
&lt;/BODY&gt;</p>
<p>This is correct:&lt;body&gt;<br />
&lt;p&gt;This is a paragraph&lt;/p&gt;<br />
&lt;/body&gt;</p>
<p>XHTML Documents Must Have One Root Element</p>
<p>All XHTML elements must be nested within the &lt;html&gt; root element. Child elements must be in pairs and correctly nested within their parent element.</p>
<p>The basic document structure is:&lt;html&gt;<br />
&lt;head&gt; &#8230; &lt;/head&gt;<br />
&lt;body&gt; &#8230; &lt;/body&gt;<br />
&lt;/html&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/56/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/56/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/56/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=56&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/28/differences-between-html-and-xhtml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP vs ASP.net</title>
		<link>http://phpisthebest.wordpress.com/2009/08/22/php-vs-asp-net/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/22/php-vs-asp-net/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:52:00 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=39</guid>
		<description><![CDATA[PHP stands for Hypertext Preprocessor and ASP.net stand for Active Server Pages. PHP was originally created by Rasmus Lerdorf in 1995 and has been in continuous development ever since. The main implementation of PHP is now produced by The PHP Group and serves as the de facto standard for PHP as there is no formal [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=39&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="http://mcct-skads.oan.es/Images/php-logo.png" alt="http://mcct-skads.oan.es/Images/php-logo.png" /></p>
<p><img src="http://farm4.static.flickr.com/3164/3083655246_af2be79c6d.jpg?v=0" alt="http://farm4.static.flickr.com/3164/3083655246_af2be79c6d.jpg?v=0" /></p>
<p>PHP stands for Hypertext Preprocessor and ASP.net stand for Active Server Pages.</p>
<p>PHP was originally created by Rasmus Lerdorf in 1995 and has been in continuous development ever since. The main implementation of PHP is now produced by <strong>The PHP Group</strong> and serves as the <em>de facto</em> standard for PHP as there is no formal specification.<sup></sup> PHP is free software released under the PHP License, which is incompatible with the GNU General Public License (GPL) because of restrictions on the use of the term <em>PHP</em>.<sup></sup></p>
<p><strong>ASP.NET</strong> is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites, web applications and web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft&#8217;s Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language.</p>
<p>PHP has evolved to include a command line interface capability and can also be used in standalone graphical applications.<sup></sup></p>
<p>PHP is a relatively simpler language to use than ASP.net. Initially, PHP was written in the C programming language to replace a set of scripts in Perl. That is the reason why coding in PHP remains simple even today. Many developers find themselves to be more at ease with the user-friendly nature of PHP when it comes to coding. However, critics also count this advantage of PHP as a disadvantage. Some of them maintain that the language of PHP has not been updated much, and hence it is still quite archaic and even, somewhat cumbersome for coding. ASP.net, which is a relatively new development, has a lot of options when it comes to languages. Here, you can use languages such as <em>C#, J#, C++ and VB.net</em>. Hence, when it comes to sheer choice, ASP.net has better to offer. But PHP is no less, since it can do its task quite well, even with its minimum language tools.</p>
<p><strong>»</strong> PHP is has much better support for the database management system, <em>MySQL</em>. In fact, the very popular blogging platform, WordPress uses the formidable combination of PHP coding on MySQL for its content management system, which includes about hundreds of thousands of blog posts every single day. Another very popular and frequently updated service that uses the combination of PHP and MySQL is Wikipedia. ASP.net can also support MySQL, but PHP is unanimously hailed, by the masses and classes alike, for its great support for this database management system.</p>
<p><strong>»</strong> People who use both PHP and ASP.net also maintain their opinion that PHP is better for embedded support with another database management system, viz. SQLite. SQLite is described as a relational database management system and since it is contained in a C programming library, PHP can provide better support to it.</p>
<p><strong>»</strong> PHP has also a very good support for object oriented programming, on which whole scripting languages are being built nowadays. ASP.net also provides very capable support to OOP.</p>
<p><strong>»</strong> When it comes to support, PHP wins over ASP.net. The main reason for this is that PHP is open source. Hence, the support can come freely from all over the world. In most cases, PHP fixes are made instantly. Being open source also ensures that there are very few snags in PHP. While, ASP.net could take a while to make fixes. That is because it is owned by Microsoft, and it is the development team of Microsoft that will need to respond to the support query. That could take more time than the worldwide open source support that PHP is able to get. Most PHP supports can be instantly found online by doing a simple search on the Internet. Some of the providers of support for PHP are Zend, NuSphere and ThinkPHP.</p>
<p><strong>»</strong> PHP can use the command line to perform many everyday activities. Some of the things that the PHP command line is useful for is for manipulating across many files and for putting files into multiple directories at once. These are just some of the important features that PHP&#8217;s command line is used for.</p>
<p><strong>»</strong> PHP is an open source programming language, which means it is free for anyone to use. Programmers can develop PHP applications virtually at no cost, because PHP is free to use. ASP.net is not free too, but its extensions are available for free on Windows platforms, upwards of 98. Hence, ASP.net is available to Windows users when they buy it. That puts a bit of restriction in its use.</p>
<p><strong>»</strong> ASP.net is compiled into memory in binary code. So, when ASP.net is used for coding, it is evident that it takes much longer time to process since the codes need to be retrieved from memory. However, PHP is not compiled into memory like ASP.net is. It is interpreted at runtime. That is the reason why PHP coding leads to better speed and even efficiency. However, it must be said that both PHP and ASP.net can run at supreme speeds and efficiency when they are coded expertly.</p>
<p><strong>»</strong> Talking about hosting charges, both PHP and ASP.net are quite cheap to host. If you do a good deal of shopping online, you will also be able to find hosting for as little as $4. While there are several pricier hosting services out there, their charges are higher for both PHP and ASP.net. Hence, it can be said that both PHP and ASP.net are at par with each other on the hosting charges.</p>
<p><strong>»</strong> Since PHP is older, there are many people who claim that it is much more secure than ASP.net where coding is concerned. ASP.net is much new, and the security options may not be fully in place yet. However, many programmers will pooh-pooh at this point, because they maintain that security in coding does not depend on the language that is used, but in the way that the coding is done by the coder. Even so, there is a lot of talk on the Internet about PHP coded sites being more difficult to hack into than those done with ASP.net.</p>
<p>Hence, there is a lot to debate on about the worthiness of PHP over ASP.net or vice-versa. There is probably no end to it, and there never shall be. The problem mainly is that both of them are good in their own place, but people who have been staunchly using PHP for several years now – some of them for more than a decade – would certainly not like to go in for the new ASP.net. The price to be paid is quite high, i.e. learning a whole new syntax and getting used to it. That is more the reason why <strong>PHP is still so popular. </strong></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/39/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/39/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/39/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=39&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/22/php-vs-asp-net/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>

		<media:content url="http://mcct-skads.oan.es/Images/php-logo.png" medium="image">
			<media:title type="html">http://mcct-skads.oan.es/Images/php-logo.png</media:title>
		</media:content>

		<media:content url="http://farm4.static.flickr.com/3164/3083655246_af2be79c6d.jpg?v=0" medium="image">
			<media:title type="html">http://farm4.static.flickr.com/3164/3083655246_af2be79c6d.jpg?v=0</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP-GTK</title>
		<link>http://phpisthebest.wordpress.com/2009/08/22/php-gtk/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/22/php-gtk/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:40:17 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=32</guid>
		<description><![CDATA[PHP-GTK is an extension for the PHP programming language that implements language bindings for GTK+. It provides an object-oriented interface to GTK+ classes and functions and greatly simplifies writing client-side cross-platform GUI applications. Rumours of PHP-GTK&#8217;s death have been greatly exaggerated! The project is very much still alive, but we&#8217;re waiting for PHP 5.3 to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=32&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img src="/DOCUME%7E1/ASHOKM%7E1/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" /></p>
<p style="text-align:center;"><img class="aligncenter" src="http://upload.wikimedia.org/wikipedia/en/8/85/Php-gtk.png" alt="http://upload.wikimedia.org/wikipedia/en/8/85/Php-gtk.png" /></p>
<p>PHP-GTK is an extension for the <acronym title="recursive acronym for PHP: Hypertext Preprocessor">PHP</acronym> programming language that implements language bindings for      <acronym title="The GIMP Toolkit">GTK+</acronym>. It provides an      object-oriented interface to GTK+ classes and functions and greatly      simplifies writing <strong>client-side cross-platform GUI applications.</strong></p>
<p>Rumours of PHP-GTK&#8217;s death have been greatly exaggerated! The project is very much still alive, but we&#8217;re waiting for PHP 5.3 to come out, and also some work needs to be done on the Cairo extension before a new release can be made. This should be completed soon. This release will come with support for GTK+ 2.14 and 2.16, Cairo, and PHP 5.3.</p>
<p>The next release will also include official installers for Windows and Mac OSX,  and an installer script (thank you bob) for Linux.</p>
<p>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 &#8211; also from the PHP development team &#8211; supplied Windows binaries for the project.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=32&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/22/php-gtk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>

		<media:content url="/DOCUME%7E1/ASHOKM%7E1/LOCALS%7E1/Temp/moz-screenshot.jpg" medium="image" />

		<media:content url="http://upload.wikimedia.org/wikipedia/en/8/85/Php-gtk.png" medium="image">
			<media:title type="html">http://upload.wikimedia.org/wikipedia/en/8/85/Php-gtk.png</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP Tips</title>
		<link>http://phpisthebest.wordpress.com/2009/08/22/php-tips/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/22/php-tips/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:33:32 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=27</guid>
		<description><![CDATA[It All Adds Up $variable = $variable + 1; Is the same as: $variable ++; This method also works for subtraction: $variable --; You can also apply a similar method for concocting strings. So instead of: $mytext = 'Done and Done.'; $mytext = "$mytext And I mean Done!"; // $mytext = 'Done and Done And [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=27&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2>It All Adds Up</h2>
<div>
<p><code>$variable = $variable + 1;</code></div>
<p>Is the same as:</p>
<div>
<p><code>$variable ++;</code></div>
<p>This method also works for subtraction:</p>
<div>
<p><code>$variable --;</code></div>
<p>You can also apply a similar method for concocting strings.  So instead of:</p>
<div>
<p><code>$mytext = 'Done and Done.';<br />
$mytext = "$mytext And I mean Done!"; // $mytext = 'Done and Done And I mean Done!';</code></div>
<p>Use this shorthand method of adding another string of text onto the end of the first string:</p>
<div>
<p><code>$mytext = 'Done and Done.';<br />
$mytext .= ' And I mean Done!'; // $mytext = 'Done and Done And I mean Done!';</code></div>
<h2>Single Quotes versus Double Quotes</h2>
<p>Any time you put something in &#8220;double&#8221; quotes, you are asking PHP to check that content for a variable. So even though the following lines do not contain variables within the double quotes, PHP will still waste precious computing time scanning them anyway.</p>
<div>
<p><code>$mytext = "Dental Plan";<br />
if ($mytext == "Dental Plan") {<br />
echo "Lisa needs braces"; }</code></div>
<p>Those same three lines of code could be executed much faster if &#8216;single&#8217; quotes were used in place of &#8220;double&#8221; quotes.</p>
<div>
<p><code>$mytext = 'Dental Plan';<br />
if ($mytext == 'Dental Plan') {<br />
echo 'Lisa needs braces'; }</code></div>
<p>Now that may not seem like much, but having PHP check for variables where it doesn&#8217;t need to over the course of a larger script, can certainly impede run-time. Just to clarify my point, PHP will <em>not</em> read a variable if it is within &#8216;single&#8217; quotes.</p>
<div>
<p><code>echo '$mytext, Lisa needs braces.';<br />
// Will output: $mytext, Lisa needs braces.<br />
echo "$mytext, Lisa needs braces.";<br />
// Will output: Dental Plan, Lisa needs braces.</code></div>
<p>What is the the super-secret of keeping those scripts speeding along the rusty pipes of your server?  <strong>Avoid double quotes at all costs.</strong> Even if you are working with a variable and think you need double quotes, it is more efficient for PHP to execute this:</p>
<div>
<p><code>echo $mytext . 'Lisa needs braces.';</code></div>
<p>As opposed to this bit of molasses-like code:</p>
<div>
<p><code>echo "$mytext Lisa needs braces.";</code></div>
<h2>One control structure to rule them all, One constant to find them, One set of conditional brackets to bring them all and in the darkness bind them</h2>
<p>Not anymore!  If you have a single expression following a control structure, you do not need to waste your time with brackets <code>{ }</code>.</p>
<div>
<p><code>if ($gollum == 'halfling') {<br />
$height --;<br />
}</code></div>
<p>Is the same as:</p>
<div>
<p><code>if ($gollum == 'halfling') $height --;</code></div>
<p>This can be applied to any control structure statement.  For example:</p>
<div>
<p><code>if ($gollum == 'halfling') $height --;<br />
else $height ++;</code></p>
<p>if ($frodo != &#8216;dead&#8217;)<br />
echo &#8216;Gosh darnit, roll again Sauron&#8217;;</p>
<p>foreach ($kill as $count)<br />
echo &#8216;Legolas strikes again, that makes&#8217; . $count . &#8216;for me!&#8217;;</p></div>
<p>The fewer brackets you have cluttering up your code, the easier it may be to read.</p>
<h2>They true did false, they were the trueiest bunch of falses that ever trued</h2>
<p>If all you are trying to test for is a boolean (true/false) of a variable or function then instead of laying down a bunch of code like this:</p>
<div>
<p><code>if ($blackbeard == true) echo 'Arr, this chair be high, says I.';<br />
elseif ($seacaptain == false) echo 'Yar, I'm not attractive.';</code></div>
<p>You can omit <code>==</code> and <code>!=</code> with:</p>
<div>
<p><code>if ($blackbeard) echo 'Arr, this chair be high, says I.';<br />
elseif (!$seacaptain) echo 'Yar, I'm not attractive.';</code></div>
<p>This same format can apply to functions and multiple conditions.  For example:</p>
<div>
<p><code>if ($benedict_arnold != true &amp;&amp; strpos($photo,'map') == true)<br />
echo 'You idiot, you can't read!';</code></p>
<p>if (high_chair($blackbeard) == false)<br />
echo &#8216;Aye, &#8217;tis true.  My debauchery was my way of compensating.&#8217;;</p></div>
<p>The following is the same exact statement (except with less code):</p>
<div>
<p><code>if (!$benedict_arnold &amp;&amp; strpos($photo,'map'))<br />
echo 'You idiot, you can't read!';</code></p>
<p>if (!high_chair($blackbeard))<br />
echo &#8216;Aye, &#8217;tis true.  My debauchery was my way of compensating.&#8217;;</p></div>
<h2>In and out of PHP before they even knew what hit &#8216;em</h2>
<p>When embedding PHP within HTML, you can close your PHP tag whenever you want to output HTML. This enables speedier processing of your PHP. For instance:</p>
<div>
<p><code><span style="color:#000000;"><span style="color:#0000cc;">&lt;?php </span><span style="color:#006600;">if(</span><span style="color:#0000cc;">$bush_sewer</span><span style="color:#006600;">) { </span><span style="color:#0000cc;">?&gt;</span></span></code></p>
<p>&lt;div class=&#8217;neighbor&#8217;&gt;<br />
&lt;strong&gt;Hey Turkeys!  Behind ya!&lt;/strong&gt;<br />
&lt;/div&gt;</p>
<p><span style="color:#000000;"><span style="color:#0000cc;">&lt;?php </span><span style="color:#006600;">} elseif (</span><span style="color:#0000cc;">street</span><span style="color:#006600;">(</span><span style="color:#0000cc;">$gorbachev</span><span style="color:#006600;">)) { </span><span style="color:#0000cc;">?&gt;</span></span></p>
<p>&lt;div class=&#8217;russian&#8217;&gt;<br />
&lt;i&gt;I just drop by with present for warming of house, instead find you grappling with <span style="color:#000000;"><span style="color:#0000cc;">&lt;?php </span><span style="color:#006600;">echo </span><span style="color:#0000cc;">$local_oaf ?&gt;</span></span>&lt;/i&gt;<br />
&lt;/div&gt;</p>
<p>&lt;?php</p>
<p>}</p>
<p>$name = &#8216;Stu&#8217;;<br />
echo &#8216;Disco&#8217; . $name . &#8216;doesn&#8217;t advertise&#8230;&#8217;; ?&gt;</p></div>
<p>Hopefully that last one didn&#8217;t confuse you as much it confused me, the example is a <em>bit</em> extreme. However look over it a few times and you will understand exactly what is going on.</p>
<h2>A few more for the road&#8230;</h2>
<ol>
<li>Don&#8217;t use spaces to format your code, use tabs. Every space takes up 1 byte, every tab takes up 1 byte too. So if you are using 4 spaces to make 1 tab, you will have added unnecessary bulk (and CPU time) to your code.</li>
<li>Learn <a href="http://evolt.org/node/22700/">Regular Expressions</a>, which are beyond the scope of this article. However once mastered, you will transform into an unstoppable coder of such power that even your own expertise of regular expressions cannot calculate your might.</li>
<li>If you are dealing with external variables through get/post.  Always use <code>$_POST['variable']</code> or <code>$_GET['variable']</code>.  Assuming <code>$variable</code> can open a huge security hole into your script.  With the upgrade to PHP5, <code>register_globals</code> is turned off, by default &#8211; so scripts will be forced to use the above method.Here is a code snippet to quickly gather <code>$_GET</code> and <code>$_POST</code> variables:
<div><code>// $_POST['form_name'] = 'Anus Mcgee';</code>foreach ($_POST as $key =&gt; $value)<br />
$$key = $value;</p>
<p>// Now $form_name = &#8216;Anus Mcgee&#8217;;</p></div>
</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/27/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/27/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/27/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=27&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/22/php-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>
	</item>
		<item>
		<title>Session Hijacking</title>
		<link>http://phpisthebest.wordpress.com/2009/08/22/session-hijacking/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/22/session-hijacking/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:28:00 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=23</guid>
		<description><![CDATA[Session Fixation Session security is a sophisticated topic, and it&#8217;s no surprise that sessions are a frequent target of attack. Most session attacks involve impersonation, where the attacker attempts to gain access to another user&#8217;s session by posing as that user. The most crucial piece of information for an attacker is the session identifier, because [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=23&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h2><a name="4.1">Session Fixation</a></h2>
<p>Session security is a sophisticated topic, and it&#8217;s no surprise that sessions are a frequent target of attack. Most session attacks involve impersonation, where the attacker attempts to gain access to another user&#8217;s session by posing as that user.</p>
<p>The most crucial piece of information for an attacker is the session identifier, because this is required for any impersonation attack. There are three common methods used to obtain a valid session identifier:</p>
<ul type="square">
<li>Prediction</li>
<li>Capture</li>
<li>Fixation</li>
</ul>
<p>Prediction refers to guessing a valid session identifier. With PHP&#8217;s native session mechanism, the session identifier is extremely random, and this is unlikely to be the weakest point in your implementation.</p>
<p>Capturing a valid session identifier is the most common type of session attack, and there are numerous approaches. Because session identifiers are typically propagated in cookies or as <tt>GET</tt> variables, the different approaches focus on attacking these methods of transfer. While there have been a few browser vulnerabilities regarding cookies, these have mostly been Internet Explorer, and cookies are slightly less exposed than GET variables. Thus, for those users who enable cookies, you can provide them with a more secure mechanism by using a cookie to propagate the session identifier.</p>
<p>Fixation is the simplest method of obtaining a valid session identifier. While it&#8217;s not very difficult to defend against, if your session mechanism consists of nothing more than <tt>session_start()</tt>, you are vulnerable.</p>
<p>In order to demonstrate session fixation, I will use the following script, <tt>session.php</tt>:</p>
<p>&lt;?php</p>
<p>session_start();</p>
<p>if (!isset($_SESSION['visits']))<br />
{<br />
$_SESSION['visits'] = 1;<br />
}<br />
else<br />
{<br />
$_SESSION['visits']++;<br />
}</p>
<p>echo $_SESSION['visits'];</p>
<p>?&gt;</p>
<p>Upon first visiting the page, you should see <tt>1</tt> output to the screen. On each subsequent visit, this should increment to reflect how many times you have visited the page.</p>
<p>To demonstrate session fixation, first make sure that you do not have an existing session identifier (perhaps delete your cookies), then visit this page with <tt>?PHPSESSID=1234</tt> appended to the URL. Next, with a completely different browser (or even a completely different computer), visit the same URL again with <tt>?PHPSESSID=1234</tt> appended. You will notice that you do not see <tt>1</tt> output on your first visit, but rather it continues the session you previously initiated.</p>
<p>Why can this be problematic? Most session fixation attacks simply use a link or a protocol-level redirect to send a user to a remote site with a session identifier appended to the URL. The user likely won&#8217;t notice, since the site will behave exactly the same. Because the attacker chose the session identifier, it is already known, and this can be used to launch impersonation attacks such as session hijacking.</p>
<p>A simplistic attack such as this is quite easy to prevent. If there isn&#8217;t an active session associated with a session identifier that the user is presenting, then regenerate it just to be sure:</p>
<p>&lt;?php</p>
<p>session_start();</p>
<p>if (!isset($_SESSION['initiated']))<br />
{<br />
session_regenerate_id();<br />
$_SESSION['initiated'] = true;<br />
}</p>
<p>?&gt;</p>
<p>The problem with such a simplistic defense is that an attacker can simply initialize a session for a particular session identifier, and then use that identifier to launch the attack.</p>
<p>To protect against this type of attack, first consider that session hijacking is only really useful after the user has logged in or otherwise obtained a heightened level of privilege. So, if we modify the approach to regenerate the session identifier whenever there is any change in privilege level (for example, after verifying a username and password), we will have practically eliminated the risk of a successful session fixation attack.</p>
<h2><a name="4.2">Session Hijacking</a></h2>
<p>Arguably the most common session attack, session hijacking refers to all attacks that attempt to gain access to another user&#8217;s session.</p>
<p>As with session fixation, if your session mechanism only consists of <tt>session_start()</tt>, you are vulnerable, although the exploit isn&#8217;t as simple.</p>
<p>Rather than focusing on how to keep the session identifier from being captured, I am going to focus on how to make such a capture less problematic. The goal is to complicate impersonation, since every complication increases security. To do this, we will examine the steps necessary to successfully hijack a session. In each scenario, we will assume that the session identifier has been compromised.</p>
<p>With the most simplistic session mechanism, a valid session identifier is all that is needed to successfully hijack a session. In order to improve this, we need to see if there is anything extra in an HTTP request that we can use for extra identification.</p>
<blockquote><p><strong>Note</strong><br />
It is unwise to rely on anything at the TCP/IP level, such as IP address, because these are lower level protocols that are not intended to accommodate activities taking place at the HTTP level. A single user can potentially have a different IP address for each request, and multiple users can potentially have the same IP address.</p></blockquote>
<p>Recall a typical HTTP request:</p>
<p>GET / HTTP/1.1<br />
Host: example.org<br />
User-Agent: Mozilla/5.0 Gecko<br />
Accept: text/xml, image/png, image/jpeg, image/gif, */*<br />
Cookie: PHPSESSID=1234</p>
<p>Only the <tt>Host</tt> header is required by <tt>HTTP/1.1</tt>, so it seems unwise to rely on anything else. However, consistency is really all we need, because we&#8217;re only interested in complicating impersonation without adversely affecting legitimate users.</p>
<p>Imagine that the previous request is followed by a request with a different <tt>User-Agent</tt>:</p>
<p>GET / HTTP/1.1<br />
Host: example.org<br />
User-Agent: Mozilla Compatible (MSIE)<br />
Accept: text/xml, image/png, image/jpeg, image/gif, */*<br />
Cookie: PHPSESSID=1234</p>
<p>Although the same cookie is presented, should it be assumed that this is the same user? It seems highly unlikely that a browser would change the <tt>User-Agent</tt> header between requests, right? Let&#8217;s modify the session mechanism to perform an extra check:</p>
<p>&lt;?php</p>
<p>session_start();</p>
<p>if (isset($_SESSION['HTTP_USER_AGENT']))<br />
{<br />
if ($_SESSION['HTTP_USER_AGENT'] != md5($_SERVER['HTTP_USER_AGENT']))<br />
{<br />
/* Prompt for password */<br />
exit;<br />
}<br />
}<br />
else<br />
{<br />
$_SESSION['HTTP_USER_AGENT'] = md5($_SERVER['HTTP_USER_AGENT']);<br />
}</p>
<p>?&gt;</p>
<p>Now an attacker must not only present a valid session identifier, but also the correct <tt>User-Agent</tt> header that is associated with the session. This complicates things slightly, and it is therefore a bit more secure.</p>
<p>Can we improve this? Consider that the most common method used to obtain cookie values is by exploiting a vulnerable browser such as Internet Explorer. These exploits involve the victim visiting the attacker&#8217;s site, so the attacker will be able to obtain the correct <tt>User-Agent</tt> header. Something additional is necessary to protect against this situation.</p>
<p>Imagine if we required the user to pass the MD5 of the <tt>User-Agent</tt> in each request. An attacker could no longer just recreate the headers that the victim&#8217;s requests contain, but it would also be necessary to pass this extra bit of information. While guessing the construction of this particular token isn&#8217;t too difficult, we can complicate such guesswork by simply adding an extra bit of randomness to the way we construct the token:</p>
<p>&lt;?php</p>
<p>$string = $_SERVER['HTTP_USER_AGENT'];<br />
$string .= &#8216;SHIFLETT&#8217;;</p>
<p>/* Add any other data that is consistent */</p>
<p>$fingerprint = md5($string);</p>
<p>?&gt;</p>
<p>Keeping in mind that we&#8217;re passing the session identifier in a cookie, and this already requires that an attack be used to compromise this cookie (and likely all HTTP headers as well), we should pass this fingerprint as a URL variable. This must be in all URLs as if it were the session identifier, because both should be required in order for a session to be automatically continued (in addition to all checks passing).</p>
<p>In order to make sure that legitimate users aren&#8217;t treated like criminals, simply prompt for a password if a check fails. If there is an error in your mechanism that incorrectly suspects a user of an impersonation attack, prompting for a password before continuing is the least offensive way to handle the situation. In fact, your users may appreciate the extra bit of protection perceived from such a query.</p>
<p>There are many different methods you can use to complicate impersonation and protect your applications from session hijacking. Hopefully you will at least do something in addition to <tt>session_start()</tt> as well as be able to come up with a few ideas of your own. Just remember to make things difficult for the bad guys and easy for the good guys.</p>
<blockquote><p><strong>Note</strong><br />
Some experts claim that the <tt>User-Agent</tt> header is not consistent enough to be used in the way described. The argument is that an HTTP proxy in a cluster can modify the <tt>User-Agent</tt> header inconsistently with other proxies in the same cluster. While I have never observed this myself (and feel comfortable relying on the consistency of <tt>User-Agent</tt>), it is something you may want to consider.</p>
<p>The <tt>Accept</tt> header has been known to change from request to request in Internet Explorer (depending on whether the user refreshes the browser), so this should not be relied upon for consistency.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=23&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/22/session-hijacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>
	</item>
		<item>
		<title>Sessions and Cookies</title>
		<link>http://phpisthebest.wordpress.com/2009/08/22/sessions-and-cookies/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/22/sessions-and-cookies/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:18:46 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=20</guid>
		<description><![CDATA[Sessions PHP Session Variables When you are working with an application, you open it, do some changes and then you close it. This is much like a Session. The computer knows who you are. It knows when you start the application and when you end. But on the internet there is one problem: the web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=20&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1><span style="text-decoration:underline;">Sessions</span></h1>
<h2></h2>
<h2>PHP Session Variables</h2>
<p>When you are working with an application, you open it, do some changes and  then you close it. This is much like a Session. The computer knows who you are.  It knows when you start the application and when you end. But on the internet  there is one problem: the web server does not know who you are and what you do  because the HTTP address doesn&#8217;t maintain state.</p>
<p>A PHP session solves this problem by allowing you to store user information  on the server for later use (i.e. username, shopping items, etc). However, session information is temporary and  will be deleted after  the user has left the website. If you need a permanent storage you may want to store the data in a database.</p>
<p>Sessions work by creating a unique id (UID) for each  visitor and store variables based on this UID. The UID is either stored in a  cookie or is propagated in the URL.</p>
<hr />
<h2>Starting a PHP Session</h2>
<p>Before you can store user information in your PHP session, you must  first start up the session.</p>
<p><strong>Note:</strong> The session_start() function must appear BEFORE the &lt;html&gt; tag:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php session_start(); ?&gt;</p>
<p>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>The code above will register the user&#8217;s session with the server, allow you to  start saving user information, and assign a UID  for that user&#8217;s session.</p>
<hr />
<h2>Storing a Session Variable</h2>
<p>The correct way to store and retrieve session variables is to use the  PHP $_SESSION variable:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
session_start();<br />
// store session data<br />
$_SESSION['views']=1;<br />
?&gt;</p>
<p>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;?php<br />
//retrieve session data<br />
echo &#8220;Pageviews=&#8221;. $_SESSION['views'];<br />
?&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>Output:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>Pageviews=1</td>
</tr>
</tbody>
</table>
<p>In the example below, we create a simple page-views counter. The isset()  function checks if the &#8220;views&#8221; variable has already been set. If &#8220;views&#8221; has  been set, we can increment our counter. If &#8220;views&#8221; doesn&#8217;t exist, we create a &#8220;views&#8221;  variable, and set it to 1:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
session_start();</p>
<p>if(isset($_SESSION['views']))<br />
$_SESSION['views']=$_SESSION['views']+1;<br />
else<br />
$_SESSION['views']=1;<br />
echo &#8220;Views=&#8221;. $_SESSION['views'];<br />
?&gt;</td>
</tr>
</tbody>
</table>
<hr />
<h2>Destroying a Session</h2>
<p>If you wish to delete some session data, you can use the unset() or the  session_destroy() function.</p>
<p>The unset() function is used to free the specified session variable:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
unset($_SESSION['views']);<br />
?&gt;</td>
</tr>
</tbody>
</table>
<p>You can also completely destroy the session by calling the session_destroy() function:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
session_destroy();<br />
?&gt;</td>
</tr>
</tbody>
</table>
<p><strong>Note:</strong> session_destroy() will reset your session and you will lose all  your stored session data.</p>
<h1><span style="text-decoration:underline;">Cookies</span></h1>
<p><span style="text-decoration:underline;"><br />
</span></p>
<h2>What is a Cookie?</h2>
<p>A cookie is often used to identify a user. A cookie is a small file that the  server embeds on the user&#8217;s computer. Each time the same computer requests a  page with a browser, it will send the cookie too. With PHP, you can both create  and retrieve cookie values.</p>
<hr />
<h2>How to Create a Cookie?</h2>
<p>The setcookie() function is used to set a cookie.</p>
<p><strong>Note:</strong> The setcookie() function must appear BEFORE the &lt;html&gt; tag.</p>
<h3>Syntax</h3>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>setcookie(name, value, expire, path, domain);</td>
</tr>
</tbody>
</table>
<h3>Example 1</h3>
<p>In the example below, we will create a cookie named &#8220;user&#8221; and assign the  value &#8220;Alex Porter&#8221; to it. We also specify that the cookie should expire after  one hour:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
setcookie(&#8220;user&#8221;, &#8220;Alex Porter&#8221;, time()+3600);<br />
?&gt;</p>
<p>&lt;html&gt;<br />
&#8230;..</td>
</tr>
</tbody>
</table>
<p><strong>Note: </strong>The value of the cookie is automatically URLencoded when  sending the cookie, and automatically decoded when received (to prevent  URLencoding, use setrawcookie() instead).</p>
<h3>Example 2</h3>
<p>You can also set the expiration time of the cookie in another way. It may be  easier than using seconds.</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
$expire=time()+60*60*24*30;<br />
setcookie(&#8220;user&#8221;, &#8220;Alex Porter&#8221;, $expire);<br />
?&gt;</p>
<p>&lt;html&gt;<br />
&#8230;..</td>
</tr>
</tbody>
</table>
<p>In the example above the expiration time is set to a month (<em>60 sec * 60  min * 24 hours * 30 days</em>).</p>
<hr />
<h2>How to Retrieve a Cookie Value?</h2>
<p>The PHP $_COOKIE variable is used to  retrieve a cookie value.</p>
<p>In the example below, we retrieve the value of the cookie named &#8220;user&#8221; and  display it on a page:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
// Print a cookie<br />
echo $_COOKIE["user"];</p>
<p>// A way to view all cookies<br />
print_r($_COOKIE);<br />
?&gt;</td>
</tr>
</tbody>
</table>
<p>In the following example we use the isset() function to find out if a cookie  has been set:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;?php<br />
if (isset($_COOKIE["user"]))<br />
echo &#8220;Welcome &#8221; . $_COOKIE["user"] . &#8220;!&lt;br /&gt;&#8221;;<br />
else<br />
echo &#8220;Welcome guest!&lt;br /&gt;&#8221;;<br />
?&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</td>
</tr>
</tbody>
</table>
<hr />
<h2>How to Delete a Cookie?</h2>
<p>When deleting a cookie you should assure that the expiration date is in the  past.</p>
<p>Delete example:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;?php<br />
// set the expiration date to one hour ago<br />
setcookie(&#8220;user&#8221;, &#8220;&#8221;, time()-3600);<br />
?&gt;</td>
</tr>
</tbody>
</table>
<hr />
<h2>What if a Browser Does NOT Support Cookies?</h2>
<p>If your application deals with browsers that do not support cookies, you will  have to use other methods to pass information from one page to another in your  application. One method is to pass the data through forms (forms and user input are described  earlier in this tutorial).</p>
<p>The form below passes the user input to &#8220;welcome.php&#8221; when the user clicks on  the &#8220;Submit&#8221; button:</p>
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>&lt;form action=&#8221;welcome.php&#8221; method=&#8221;post&#8221;&gt;<br />
Name: &lt;input type=&#8221;text&#8221; name=&#8221;name&#8221; /&gt;<br />
Age: &lt;input type=&#8221;text&#8221; name=&#8221;age&#8221; /&gt;<br />
&lt;input type=&#8221;submit&#8221; /&gt;<br />
&lt;/form&gt;</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</td>
</tr>
</tbody>
</table>
<p>Retrieve the values in the &#8220;welcome.php&#8221; file like this:</p>
<p>&lt;html&gt;<br />
&lt;body&gt;</p>
<p>Welcome &lt;?php echo $_POST["name"]; ?&gt;.&lt;br /&gt;<br />
You are &lt;?php echo $_POST["age"]; ?&gt; years old.</p>
<p>&lt;/body&gt;<br />
&lt;/html&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=20&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/22/sessions-and-cookies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>
	</item>
		<item>
		<title>Install Apache MySQL PHP ( LAMP) in Linux Ubuntu</title>
		<link>http://phpisthebest.wordpress.com/2009/08/22/install-apache-mysql-php-lamp-in-linux-ubuntu/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/22/install-apache-mysql-php-lamp-in-linux-ubuntu/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 15:09:25 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=18</guid>
		<description><![CDATA[Install Apache To start off we will install Apache. 1. Open up the Terminal (Applications &#62; Accessories &#62; Terminal). 2. Copy/Paste the following line of code into Terminal and then press enter: sudo apt-get install apache2 3. The Terminal will then ask you for you&#8217;re password, type it and then press enter. Testing Apache To [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=18&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h3>Install Apache</h3>
<p>To start off we will install Apache.</p>
<p>1. Open up the Terminal (<em>Applications &gt; Accessories &gt; Terminal</em>).</p>
<p>2. Copy/Paste the following line of code into Terminal and then press enter:</p>
<p><em>sudo apt-get install apache2</em></p>
<p>3. The Terminal will then ask you for you&#8217;re password, type it and then press enter.</p>
<h3>Testing Apache</h3>
<p>To make sure everything installed correctly we will now test Apache to ensure it is working properly.</p>
<p>1. Open up any web browser and then enter the following into the web address:</p>
<p><em>http://localhost/</em></p>
<p>You should see a folder entitled <em>apache2-default/</em>. Open it and you will see a message saying &#8220;It works!&#8221; , congrats to you!</p>
<h3>Install PHP</h3>
<p>In this part we will install PHP 5.</p>
<p>Step 1. Again open up the Terminal (<em>Applications &gt; Accessories &gt; Terminal</em>).</p>
<p>Step 2. Copy/Paste the following line into Terminal and press enter:</p>
<p><em>sudo apt-get install php5 libapache2-mod-php5</em></p>
<p>Step 3. In order for PHP to work and be compatible with Apache we must restart it. Type the following code in Terminal to do this:</p>
<p><em>sudo /etc/init.d/apache2 restart</em></p>
<h3>Test PHP</h3>
<p>To ensure there are no issues with PHP let&#8217;s give it a quick test run.</p>
<p>Step 1. In the terminal copy/paste the following line:</p>
<p><em>sudo gedit /var/www/testphp.php</em></p>
<p>This will open up a file called <em>phptest.php</em>.</p>
<p>Step 2. Copy/Paste this line into the phptest file:</p>
<p><em>&lt;?php phpinfo(); ?&gt;</em></p>
<p>Step 3. Save and close the file.</p>
<p>Step 4. Now open you&#8217;re web browser and type the following into the web address:</p>
<p><em>http://localhost/testphp.php</em></p>
<h3>Install MySQL</h3>
<p>To finish this guide up we will install MySQL. (Note &#8211; Out of Apache and PHP, MySQL is the most difficult to set up. I will provide some great resources for anyone having trouble at the end of this guide.)</p>
<p>Step 1. Once again open up the amazing Terminal and then copy/paste this line:</p>
<p><em>sudo apt-get install mysql-server</em></p>
<p>Step 2 (optional). In order for other computers on your network to view the server you have created, you must first edit the &#8220;Bind Address&#8221;. Begin by opening up Terminal to edit the <em>my.cnf</em> file.</p>
<p><em>gksudo gedit /etc/mysql/my.cnf</em></p>
<p>Change the line</p>
<p><em>bind-address = 127.0.0.1</em></p>
<p>And change the <em>127.0.0.1</em> to your IP address.</p>
<p>Step 3. This is where things may start to get tricky. Begin by typing the following into Terminal:</p>
<p><em>mysql -u root</em></p>
<p>Following that copy/paste this line:</p>
<p><em>mysql&gt; SET PASSWORD FOR &#8216;root&#8217;@'localhost&#8217; = PASSWORD(&#8216;yourpassword&#8217;);</em></p>
<p>(Make sure to change <em>yourpassword</em> to a password of your choice.)</p>
<p>Step 4. We are now going to install a program called phpMyAdmin which is an easy tool to edit your databases. Copy/paste the following line into Terminal:</p>
<p><em>sudo apt-get install libapache2-mod-auth-mysql php5-mysql phpmyadmin</em></p>
<p>After that is installed our next task is to get PHP to work with MySQL. To do this we will need to open a file entitled<em>php.ini</em>. To open it type the following:</p>
<p><em>gksudo gedit /etc/php5/apache2/php.ini</em></p>
<p>Now we are going to have to uncomment the following line by taking out the semicolon (<em>;</em>).</p>
<p>Change this line:</p>
<p><em>;extension=mysql.so</em></p>
<p>To look like this:</p>
<p><em>extension=mysql.so</em></p>
<p>Now just restart Apache and you are all set!</p>
<p><em>sudo /etc/init.d/apache2 restart</em></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=18&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/22/install-apache-mysql-php-lamp-in-linux-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>
	</item>
		<item>
		<title>Install Apache, PHP and MySQL manually in Windows</title>
		<link>http://phpisthebest.wordpress.com/2009/08/22/install-apache-php-and-mysql-manually-in-windows/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/22/install-apache-php-and-mysql-manually-in-windows/#comments</comments>
		<pubDate>Sat, 22 Aug 2009 07:05:09 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=11</guid>
		<description><![CDATA[I strongly recommend you to use notepad++ as your text editor because there is a chance of conflict between fancy symbols and standard symbols&#8230; To download notepad ++,  click here This tutorial will show you step-by-step how to install: Apache 2 PHP 5 MySQL 5 phpMyAdmin The Apache Server combined with the power of PHP, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=11&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1 style="text-align:center;"><span style="color:#000000;">I strongly recommend you </span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">to use </span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">notepad++ </span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">as your text editor</span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">because there is</span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">a chance of</span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">conflict between</span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">fancy symbols</span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">and </span></h1>
<h1 style="text-align:center;"><span style="color:#000000;">standard symbols&#8230;</span></h1>
<h2></h2>
<h2><a title="Notepad++" href="http://www.filehippo.com/download_notepad/" target="_blank">To download notepad ++,  click here</a></h2>
<p>This tutorial will show you step-by-step how to install:</p>
<ul>
<li>Apache 2</li>
<li>PHP 5</li>
<li>MySQL 5</li>
<li>phpMyAdmin</li>
</ul>
<p>The Apache Server combined with the power of PHP, MySQL, and phpMyAdmin, creates   one of the best possible development environments for a web programmer. Getting  everything properly configured can take 20-30 minutes, so make sure you have enough  time set aside before beginning the installation.</p>
<p>Don&#8217;t be intimidated by the length of this page. I&#8217;ll walk you step-by-step through  each part of the installaton. All you need is a basic understanding of HTML and  computers, and if any part of the installation isn&#8217;t clear to you, just  send me an email.</p>
<p><strong>Start the Installation:</strong></p>
<ul>
<li>Installing Apache</li>
<li>Installing PHP</li>
<li>Installing MySQL</li>
<li>Configuring PHP to work with MySQL</li>
<li>Installing phpMyAdmin</li>
</ul>
<p><!-- Start Apache Install --><a name="apache"></a></p>
<h2>Installing Apache:</h2>
<ol>
<li> Go to www.apache.org and download &#8220;Win32 Binary (MSI Installer): apache_2.2.4-win32-x86-no_ssl.msi&#8221; to your  		desktop.<strong>Note:</strong> <span style="text-decoration:underline;">Make sure that you download Apache version 2.2.4 (Win32 Binary MSI Installer)!  		The rest of the tutorial is written using this version.</span></li>
<li> Double click &#8220;apache_2.2.4-win32-x86-no_ssl.msi&#8221;, and if prompted, click &#8220;run&#8221;.</li>
<li> An installation wizard will appear:<img src="http://www.bicubica.com/apache-php-mysql/screenshots/apache_1.jpg" alt="Start the Apache Server Installation" />Click &#8220;Next&#8221;.</li>
<li> The next page contains the terms of agreement. Select &#8220;I accept&#8221;, and click &#8220;Next&#8221;.</li>
<li> Read about the Apache Server, and click &#8220;Next&#8221;</li>
<li> The next screen will ask you for specific server information. Enter the values seen  		below:<img src="http://www.bicubica.com/apache-php-mysql/screenshots/apache_2.jpg" alt="Configure Apache" />Click &#8220;Next&#8221;.</li>
<li> On the next screen, select &#8220;Typical Installation&#8221; and click &#8220;Next&#8221;.</li>
<li> Click &#8220;Next&#8221;.</li>
<li> Click &#8220;Install&#8221;.</li>
<li> Open up Internet Explorer and type in &#8220;http://localhost&#8221;. If you see a page that says &#8220;It works!&#8221;  		then the Apache server has been installed successfully.<img src="http://www.bicubica.com/apache-php-mysql/screenshots/apache_3.jpg" alt="Apache Server Success Page" /></li>
</ol>
<p>A few notes on your Apache Server Configuration:</p>
<ul>
<li>Apache is installed by default in your &#8220;C:\Program Files\Apache Software Foundation\Apache2.2&#8243; directory.</li>
<li>Inside that directory there is a folder called &#8220;htdocs&#8221; (the equivilant of your \www\ or \public_html\ directory). You can develop your applications inside this folder and access them by going to http://localhost/your_file_name.php</li>
<li>The Apache Configuration settings are defined in a file named &#8220;httpd.conf&#8221; located in the &#8220;conf&#8221; directory. <span style="text-decoration:underline;">Do not attempt to change these settings unless you know what you&#8217;re doing. An error in this file will result in the Apache Server not functioning correctly!</span></li>
</ul>
<p>By default Apache&#8217;s <strong>document root </strong>is set to<strong> htdocs</strong> directory. The document root is where you must put all your PHP             or HTML files so it will be process by Apache ( and can be seen through             a web browser ). Of course you can change it to point to any directory             you want. The configuration file for Apache is stored in C:\Program             Files\Apache Group\Apache2\conf\httpd.conf ( assuming you installed             Apache in C:\Program Files\Apache Group )             . It&#8217;s just a plain text file so you can use Notepad to edit it.</p>
<p>For example, if you want to put all your PHP or HTML files in C:\www just find this line in the httpd.conf :</p>
<p>DocumentRoot &#8220;C:/Program Files/Apache Group/Apache2/htdocs&#8221;</p>
<p>and change it to :</p>
<p>DocumentRoot &#8220;C:/www&#8221;</p>
<p>After making changes to the configuration file you have to restart Apache             ( Start &gt; Programs &gt; Apache HTTP Server 2.0.50             &gt; Control Apache Server &gt; Restart ) to see the effect.</p>
<p>Another configuration you may want to change is the <strong>directory index.</strong> This is the file that Apache will show when you request a directory. As             an example if you type http://www.php-mysql-tutorial.com/ without specifying any file the index.php file will be automatically shown.</p>
<p>Suppose you want apache to use index.html, index.php or main.php as the directory index you can             modify the DirectoryIndex value like this             :</p>
<p>DirectoryIndex index.html index.php main.php</p>
<p>Now whenever you request a directory such as http://localhost/ Apache will try to find the index.html file             or if it&#8217;s not found Apache will use index.php.             In case index.php is also not found then             main.php will be used.</p>
<h2>Installing PHP:</h2>
<p>Next we will be installing PHP version 5. Follow the steps carefully.</p>
<ol>
<li> Go to www.php.net and download  		the &#8220;PHP 5.2.0 zip package&#8221; to your desktop. (Be patient while it downloads, the ZIP file is  		over 9MB!)<strong>Note:</strong> <span style="text-decoration:underline;">Make sure that you download the PHP 5.2.0 zip package! The rest of the tutorial is  		written using this version.</span></li>
<li> Create a new folder called &#8220;php&#8221; in your C Drive. Copy the &#8220;php-5.2.0-Win32.zip&#8221; file to there  		(&#8220;C:\php&#8221;) and extract it using WinZIP or a similiar program.</li>
<li> Your &#8220;C:\php&#8221; directory should now look like:<img src="http://www.bicubica.com/apache-php-mysql/screenshots/php_1.jpg" alt="PHP Directory" /></li>
<li> Next copy the &#8220;php.ini-dist&#8221; file from &#8220;C:/php/&#8221; to &#8220;C:/WINDOWS&#8221; and rename it to &#8220;php.ini&#8221;. This  		is your PHP configuration file. We&#8217;ll come back to this later.</li>
<li> Now it&#8217;s time to tell Apache that PHP exists. Open up your Apache configuration file (&#8220;C:\Program  		Files\Apache Software Foundation\Apache2.2\conf\httpd.conf&#8221;) in notepad and add these four lines to  		the bottom of the &#8220;LoadModule&#8221; section:
<div style="color:blue;">LoadModule php5_module &#8220;c:/php/php5apache2_2.dll&#8221;<br />
AddHandler application/x-httpd-php .php<br />
# configure the path to php.ini<br />
PHPIniDir &#8220;c:/windows&#8221;</div>
</li>
<li><strong> ( I recommend you to manually type these in the file because the double quotes here is fancy double quotes which will result in an error if you copy paste these lines&#8230;) or use notepad++ as your text editor&#8230;<br />
</strong></li>
<li> In your &#8220;htdocs&#8221; directory, create a file called &#8220;info.php&#8221;. Open it in notepad and add this line of  		code to it:
<div style="color:blue;">&lt;?php phpinfo(); ?&gt;</div>
</li>
<li> Restart your Apache Server for the changes to take effect: Start &gt; All Programs &gt; Apache HTTP Server 4.2.4 &gt;  		Control Apache Server &gt; Restart</li>
<li> Open up Internet Explorer and type in: http://localhost/info.php. If your browser takes you to a page that  		looks like this, then PHP has been installed successfully!<img src="http://www.bicubica.com/apache-php-mysql/screenshots/php_2.jpg" alt="PHP Info Page" /></li>
</ol>
<p>Modifying your PHP Configuration File:</p>
<ul>
<li>Your PHP configuration (php.ini) file is located in &#8220;C:/WINDOWS/php.ini&#8221;. You can modify it with notepad or a similiar text editor.</li>
<li>Open it up and find the line that says:
<div style="color:blue;">extension_dir = &#8220;./&#8221;</div>
<p>and change it to</p>
<div style="color:blue;">extension_dir = &#8220;C:\php\ext&#8221;</div>
</li>
<li>Find the line that says:
<div style="color:blue;">;session.save_path = &#8220;/tmp&#8221;</div>
<p>and change it to</p>
<div style="color:blue;">session.save_path = &#8220;C:\WINDOWS\temp&#8221;</div>
</li>
</ul>
<h2>Installing MYSQL:</h2>
<p>Next we will be installing MySQL version 5. Follow the steps carefully.</p>
<ol>
<li> Go to www.mysql.com and download the &#8220;Windows (x86) ZIP/Setup.EXE (version 5.0.27)&#8221; to your desktop. (To do this you&#8217;ll need  		to register an account with MySQL.)</li>
<li> Once &#8220;mysql-5.0.27-win32.zip&#8221; has finished downloading, you can extract it using WinZIP or a similiar  		program.</li>
<li> Once extracted, double click on the &#8220;Setup.exe&#8221; file. An installation wizard will appear.<img src="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_1.jpg" alt="Start the MySQL Server Installation" />Click &#8220;Next&#8221;.</li>
<li> Select &#8220;Typical&#8221; Installation and click &#8220;Next&#8221;.</li>
<li> Click &#8220;Install&#8221;. (Be patient, this can take up to several minutes).</li>
<li> The next screen will ask you to &#8220;Sign Up&#8221;. Select &#8220;Skip Sign-Up&#8221; for now.</li>
<li> The next screen will tell you that the installation wizard is complete. <span style="text-decoration:underline;">Make sure  		that the &#8220;Configure the MySQL Server now&#8221; field is checked before clicking &#8220;Finish&#8221;.</span><img src="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_2.jpg" alt="Create a MySQL Server Instance" /></li>
<li> The MySQL Server Instance Configuration Wizard should appear. Click &#8220;Next&#8221;.</li>
<li> Select &#8220;Detailed Configuration&#8221; and click &#8220;Next&#8221;.</li>
<li> Select &#8220;Developer Machine&#8221; and click &#8220;Next&#8221;.</li>
<li> Select &#8220;Multifunctional Database&#8221; and click &#8220;Next&#8221;.</li>
<li> Click &#8220;Next&#8221;.</li>
<li> Select &#8220;Decision Support (DSS)/OLAP&#8221; and click &#8220;Next&#8221;.</li>
<li> Select &#8220;Multifunctional Database&#8221; and click &#8220;Next&#8221;.</li>
<li> Make sure &#8220;Enable TCP/IP Networking&#8221; is checked, the Port Number is set to &#8220;3306&#8243;, and  		&#8220;Enable Strict Mode&#8221; is checked. Click &#8220;Next&#8221;.</li>
<li> Select &#8220;Standard Character Set&#8221; and click &#8220;Next&#8221;.</li>
<li> Check &#8220;Install As Windows Service&#8221;, set the Service Name to &#8220;MySQL&#8221;, and check &#8220;Launch the  		MySQL Server automatically&#8221;. Make sure that the &#8220;Include Bin Directory in Windows Path&#8221; is  		NOT checked. Click &#8220;Next&#8221;.</li>
<li> On the next screen, check the box that says &#8220;Modify Security Settings&#8221;. Enter a password for  		the default &#8220;root&#8221; account, and confirm the password in the box below. Do NOT check the boxes  		&#8220;Enable root access from remote machines&#8221; or &#8220;Create An Anonymous Account&#8221;. Click &#8220;Next&#8221;.</li>
<li> Click &#8220;Execute&#8221;. (This may take a few minutes. Be patient).</li>
<li> Click &#8220;Finish&#8221;.</li>
<li> To test if MySQL was installed correct, go to: Start &gt; All Programs &gt; MySQL &gt; MySQL Server 5.0 &gt;  		MySQL Command Line Client. The MySQL Command Line Client will appear:<img src="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_3.jpg" alt="MySQL Command Line" /></li>
<li> It will ask you for a password. Enter the password you created in step 18. (If you enter an incorrect  		password MySQL will automatically close the command line)</li>
<li> Next, type in the commands shown below: (shown in blue)<img src="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_4.jpg" alt="Test MySQL" />If you don&#8217;t get any errors, and it returns the information shown above, then MySQL has been successfully  		installed! Next we will need to configure PHP to work with MySQL.</li>
</ol>
<p><!-- End MySQL Install --> <!-- Start PHP-MySQL Configuration Install --><a name="configuring-php-mysql"></a></p>
<h2>Configuring PHP to work with MySQL:</h2>
<p>Now that both PHP and MySQL are installed, we have to configure them to work together.</p>
<ol>
<li> Open up your php.ini file (C:/WINDOWS/php.ini) and find the line:
<div style="color:blue;">;extension=php_mysql.dll</div>
<p>To enable the MySQL extension, delete the semi-colon at the beginning of that line.</li>
<li> Next we must add the PHP directory to the Windows PATH. To do this, click: Start &gt; My Computer &gt; Properties &gt;  		Advanced &gt; Environment Variables. Under the second list (System Variables), there will be a variable called  		&#8220;Path&#8221;. Select it and click &#8220;Edit&#8221;. Add &#8220;;C:\php&#8221; to the very end of the string and click &#8220;OK&#8221;.</li>
<li> Restart your computer for the changes to take effect.</li>
<li> Create a new file in your &#8220;htdocs&#8221; directory called &#8220;mysql_test.php&#8221;.</li>
<li> Copy the following code into &#8220;mysql_test.php&#8221; and click save. (Make sure to replace the MYSQL_PASS constant  		with the MySQL Password you specified during the MySQL installation).
<div style="color:blue;">&lt;?php# Define MySQL Settings<br />
define(&#8220;MYSQL_HOST&#8221;, &#8220;localhost&#8221;);<br />
define(&#8220;MYSQL_USER&#8221;, &#8220;root&#8221;);<br />
define(&#8220;MYSQL_PASS&#8221;, &#8220;password&#8221;);<br />
define(&#8220;MYSQL_DB&#8221;, &#8220;test&#8221;);</p>
<p>$conn = mysql_connect(&#8220;&#8221;.MYSQL_HOST.&#8221;", &#8220;&#8221;.MYSQL_USER.&#8221;", &#8220;&#8221;.MYSQL_PASS.&#8221;") or  		die(mysql_error());<br />
mysql_select_db(&#8220;&#8221;.MYSQL_DB.&#8221;",$conn) or die(mysql_error());</p>
<p>$sql = &#8220;SELECT * FROM test&#8221;;<br />
$res = mysql_query($sql);</p>
<p>while ($field = mysql_fetch_array($res))<br />
{<br />
$id = $field['id'];<br />
$name = $field['name'];</p>
<p>echo &#8216;ID: &#8216; . $field['id'] . &#8216;&lt;br /&gt;&#8217;;<br />
echo &#8216;Name: &#8216; . $field['name'] . &#8216;&lt;br /&gt;&lt;br /&gt;&#8217;;<br />
}</p>
<p>?&gt;</p></div>
</li>
<li> Open up Internet Explorer and type in &#8220;http://localhost/mysql_test.php&#8221;. If the &#8220;mysql_test.php&#8221; page  		returns something similiar to:
<div style="color:blue;">ID: 1<br />
Name: John</div>
<p>Then PHP &amp; MySQL have been successfully configured to work together. Congratulations! The next and final  		step is to install phpMyAdmin.</li>
</ol>
<p><!-- End PHP-MySQL Configuration Install --> <!-- Start phpMyAdmin Install --><a name="phpMyAdmin"></a></p>
<h2>Installing phpMyAdmin:</h2>
<p>Now that both Apache, PHP and MySQL are installed, we can install phpMyAdmin, a tool that allows you to easily  manage your MySQL databases.</p>
<ol>
<li> Go to www.phpMyAdmin.net and download &#8220;english.zip&#8221; under the <span style="text-decoration:underline;">phpMyAdmin 2.9.2 section</span> to your desktop (I assume that since you are  		reading this article that you understand English).</li>
<li> Create a new folder called &#8220;phpmyadmin&#8221; in your &#8220;htdocs&#8221; directory. Extract the contents of the  		&#8220;phpMyAdmin-2.9.2-english.zip&#8221; ZIP file here. Your C:\Program Files\Apache Software  		Foundation\Apache2.2\htdocs\phpmyadmin&#8221; directory should now look like:<img src="http://www.bicubica.com/apache-php-mysql/screenshots/phpmyadmin_1.jpg" alt="" /></li>
<li> Create a new file in the &#8220;phpMyAdmin&#8221; directory (above) called &#8220;config.inc.php&#8221;. Place this code inside  		it and be sure to replace &#8220;YOUR_PASSWORD_HERE&#8221; (in both places below) with your MySQL Password:
<div style="color:blue;">&lt;?php/* $Id: config.sample.inc.php 9675 2006-11-03 09:06:06Z nijel $ */<br />
// vim: expandtab sw=4 ts=4 sts=4:/**<br />
* phpMyAdmin sample configuration, you can use it as base for<br />
* manual configuration. For easier setup you can use scripts/setup.php<br />
*<br />
* All directives are explained in Documentation.html and on phpMyAdmin<br />
* wiki &lt;http://wiki.cihar.com&gt;.<br />
*/</p>
<p>/*<br />
* This is needed for cookie based authentication to encrypt password in<br />
* cookie<br />
*/<br />
$cfg['blowfish_secret'] = &#8221;; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */</p>
<p>/*<br />
* Servers configuration<br />
*/<br />
$i = 0;</p>
<p>/*<br />
* First server<br />
*/<br />
$i++;</p>
<p>$cfg['Servers'][$i]['user'] = &#8216;root&#8217;;<br />
$cfg['Servers'][$i]['password'] = &#8216;YOUR_PASSWORD_HERE&#8217;; // Your MySQL Password</p>
<p>/* Authentication type */<br />
$cfg['Servers'][$i]['auth_type'] = &#8216;config&#8217;;<br />
/* Server parameters */<br />
$cfg['Servers'][$i]['host'] = &#8216;localhost&#8217;;<br />
$cfg['Servers'][$i]['connect_type'] = &#8216;tcp&#8217;;<br />
$cfg['Servers'][$i]['compress'] = false;<br />
/* Select mysqli if your server has it */<br />
$cfg['Servers'][$i]['extension'] = &#8216;mysql&#8217;;<br />
/* User for advanced features */<br />
$cfg['Servers'][$i]['controluser'] = &#8216;root&#8217;;<br />
$cfg['Servers'][$i]['controlpass'] = &#8216;YOUR_PASSWORD_HERE&#8217;; // Your MySQL Password<br />
/* Advanced phpMyAdmin features */<br />
$cfg['Servers'][$i]['pmadb'] = &#8216;phpmyadmin&#8217;;<br />
$cfg['Servers'][$i]['bookmarktable'] = &#8216;pma_bookmark&#8217;;<br />
$cfg['Servers'][$i]['relation'] = &#8216;pma_relation&#8217;;<br />
$cfg['Servers'][$i]['table_info'] = &#8216;pma_table_info&#8217;;<br />
$cfg['Servers'][$i]['table_coords'] = &#8216;pma_table_coords&#8217;;<br />
$cfg['Servers'][$i]['pdf_pages'] = &#8216;pma_pdf_pages&#8217;;<br />
$cfg['Servers'][$i]['column_info'] = &#8216;pma_column_info&#8217;;<br />
$cfg['Servers'][$i]['history'] = &#8216;pma_history&#8217;;</p>
<p>/*<br />
* End of servers configuration<br />
*/</p>
<p>/*<br />
* Directories for saving/loading files from server<br />
*/<br />
$cfg['UploadDir'] = &#8221;;<br />
$cfg['SaveDir'] = &#8221;;</p>
<p>?&gt;</p></div>
</li>
<li><strong>( I recommend you to manually type these in the file because the double quotes, single quotes, semi colon etc here are fancy which will result in an error if you copy paste these lines&#8230;) or use notepad++ as your text editor&#8230;</strong></li>
<li> phpMyAdmin has now been successfully installed! To use it, open up Internet Explorer and type in  		&#8220;http://localhost/phpmyadmin&#8221;. This will bring you to the main phpMyAdmin page. If you have  		any questions, refer to the phpMyAdmin website or the &#8220;Documentation.html&#8221; file in the /phpMyAdmin/  		directory. <a href="redhatlovers@gmail.com"><br />
</a></li>
<li> <strong>Enjoy using Apache, PHP, MySQL, and phpMyAdmin!</strong></li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=11&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/22/install-apache-php-and-mysql-manually-in-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/apache_1.jpg" medium="image">
			<media:title type="html">Start the Apache Server Installation</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/apache_2.jpg" medium="image">
			<media:title type="html">Configure Apache</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/apache_3.jpg" medium="image">
			<media:title type="html">Apache Server Success Page</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/php_1.jpg" medium="image">
			<media:title type="html">PHP Directory</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/php_2.jpg" medium="image">
			<media:title type="html">PHP Info Page</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_1.jpg" medium="image">
			<media:title type="html">Start the MySQL Server Installation</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_2.jpg" medium="image">
			<media:title type="html">Create a MySQL Server Instance</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_3.jpg" medium="image">
			<media:title type="html">MySQL Command Line</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/mysql_4.jpg" medium="image">
			<media:title type="html">Test MySQL</media:title>
		</media:content>

		<media:content url="http://www.bicubica.com/apache-php-mysql/screenshots/phpmyadmin_1.jpg" medium="image" />
	</item>
		<item>
		<title>What is PHP ?</title>
		<link>http://phpisthebest.wordpress.com/2009/08/18/what-is-php/</link>
		<comments>http://phpisthebest.wordpress.com/2009/08/18/what-is-php/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 17:42:13 +0000</pubDate>
		<dc:creator>ashokmohan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://phpisthebest.wordpress.com/?p=7</guid>
		<description><![CDATA[PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. PHP stands for PHP: Hypertext Preprocessor. What distinguishes PHP from something like client-side JavaScript is that the code is executed on the server, generating HTML which is then sent to the client. The client would [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=7&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><acronym title="recursive acronym for PHP: Hypertext Preprocessor">PHP</acronym> is a widely-used general-purpose scripting language that is  especially suited for Web development and can be embedded into HTML. PHP stands for <em>PHP: Hypertext     Preprocessor. </em></p>
<p>What distinguishes PHP from something like client-side JavaScript     is that the code is executed on the server, generating HTML which     is then sent to the client. The client would receive     the results of running that script, but would not know     what the underlying code was. You can even configure your web server     to process all your HTML files with PHP, and then there&#8217;s really no     way that users can tell what you have up your sleeve.</p>
<p>The best things in using PHP are that it is extremely simple     for a newcomer, but offers many advanced features for     a professional programmer.</p>
<p><span style="text-decoration:underline;">A simple PHP program to print &#8220;<code><span style="color:#000000;"><span style="color:#dd0000;">Hi, I'm a PHP script!"</span></span></code></span></p>
<p><code><span style="color:#000000;">&lt;html&gt;<br />
&lt;head&gt;<br />
&lt;title&gt;Example&lt;/title&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;</span></code></p>
<p><span style="color:#0000bb;">&lt;?php<br />
</span><span style="color:#007700;">echo </span><span style="color:#dd0000;">&#8220;Hi, I&#8217;m a PHP script!&#8221;</span><span style="color:#007700;">;<br />
</span><span style="color:#0000bb;">?&gt;<br />
</span><br />
&lt;/body&gt;<br />
&lt;/html&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/phpisthebest.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/phpisthebest.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/phpisthebest.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/phpisthebest.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/phpisthebest.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/phpisthebest.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/phpisthebest.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/phpisthebest.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/phpisthebest.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/phpisthebest.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/phpisthebest.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/phpisthebest.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/phpisthebest.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/phpisthebest.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=phpisthebest.wordpress.com&amp;blog=9046697&amp;post=7&amp;subd=phpisthebest&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://phpisthebest.wordpress.com/2009/08/18/what-is-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/fb7b89ff5f53f8671eca139c990ecae0?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ashokmohan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
