<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-6217084901349644109</atom:id><lastBuildDate>Fri, 24 Jul 2026 06:05:55 +0000</lastBuildDate><category>Tutorial</category><category>Interview</category><category>MVC</category><category>php</category><category>Model control view</category><category>cms</category><category>forum</category><category>forums</category><category>phpbb</category><category>phpbb forum</category><title>gurukanagaraj</title><description></description><link>http://gurukanagaraj.blogspot.com/</link><managingEditor>noreply@blogger.com (Kanagaraj)</managingEditor><generator>Blogger</generator><openSearch:totalResults>25</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-4467441533646363815</guid><pubDate>Tue, 29 Aug 2017 19:30:00 +0000</pubDate><atom:updated>2017-08-29T12:30:48.238-07:00</atom:updated><title> Simple MVC base Login Form in PHP </title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 class=&quot;post-title entry-title&quot;&gt;
Simple MVC base Login Form in PHP
&lt;/h3&gt;
&lt;div class=&quot;post-header&quot;&gt;

&lt;/div&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;
This tutorial is about&amp;nbsp;MVC in&amp;nbsp;PHP Login form. MVC is a Model View 
Controller pattern. This pattern is very&amp;nbsp;commonly used today in the 
programming.&lt;br /&gt;
&lt;b style=&quot;font-style: italic;&quot;&gt;Model: &lt;/b&gt;Model manage the data, it stores and&amp;nbsp;retrieve&amp;nbsp;the data usually from the &lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot;&gt;data base&lt;/span&gt;.&lt;br /&gt;
&lt;i style=&quot;font-weight: bold;&quot;&gt;View: &lt;/i&gt;View represent the data in the required&amp;nbsp;format.&lt;br /&gt;
&lt;i style=&quot;font-weight: bold;&quot;&gt;Controller:&lt;/i&gt;&amp;nbsp;it is handle the Model and
 View layer. Controller take the request from the client send to Model 
for &amp;nbsp;operation and then send the required output to View.&lt;br /&gt;
Now let start to create the simple login form in php using MVC pattern.&lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;more&quot;&gt;&lt;/a&gt;&lt;div style=&quot;text-align: center;&quot;&gt;
------------------------------------------------------&lt;/div&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Step 1:&lt;/b&gt;&lt;/h4&gt;
&lt;div&gt;
Make a new folder. In this new folder make 3 another new folders with the name &lt;span style=&quot;color: magenta;&quot;&gt;&lt;i&gt;&lt;b&gt;controller&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;, &lt;i&gt;&lt;span style=&quot;color: magenta;&quot;&gt;&lt;b&gt;model&lt;/b&gt;&lt;/span&gt;&lt;/i&gt;, &lt;i style=&quot;color: magenta; font-weight: bold;&quot;&gt;view &lt;/i&gt;respectively and also create a PHP page with a name &lt;span style=&quot;color: magenta;&quot;&gt;&lt;i&gt;&lt;b&gt;index.php&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;.&lt;br /&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;b&gt;new folder&lt;/b&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/b&gt;&lt;i&gt; - &amp;nbsp;controller&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - &amp;nbsp;model&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - &amp;nbsp;view&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; - &amp;nbsp;index.php&lt;/i&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
------------------------------------------------------
&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Step 2:&lt;/h4&gt;
&lt;div&gt;
In the controller folder create a PHP page with the name &lt;span style=&quot;color: magenta; font-style: italic; font-weight: bold;&quot;&gt;Controller&lt;/span&gt;. and write the following code:&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;include_once(&quot;model/Model.php&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;class Controller {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public $model;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public function __construct() &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; { &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this-&amp;gt;model = new Model();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt; &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public function invoke()&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;$reslt = $this-&amp;gt;model-&amp;gt;getlogin(); &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;// it call the getlogin() function of model class and store the return value of this function into the reslt variable.&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if($reslt == &#39;login&#39;)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;include &#39;view/Afterlogin.php&#39;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;else&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;include &#39;view/login.php&#39;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;&lt;span style=&quot;color: magenta;&quot;&gt;  &lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
------------------------------------------------------
&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Step 3:&lt;/h4&gt;
&lt;div&gt;
In the model folder create a PHP page with the name&amp;nbsp;&lt;span style=&quot;color: magenta; font-style: italic; font-weight: bold;&quot;&gt;Model&lt;/span&gt;. and write the following code:
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;div&gt;

&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
include_once(&quot;model/Book.php&quot;);&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
class Model {&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;public function getlogin()&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// here goes some hardcoded values to simulate the database&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;if(isset($_REQUEST[&#39;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot;&gt;username&lt;/span&gt;&#39;]) &amp;amp;&amp;amp; isset($_REQUEST[&#39;password&#39;])){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;if($_REQUEST[&#39;username&#39;]==&#39;admin&#39; &amp;amp;&amp;amp; $_REQUEST[&#39;password&#39;]==&#39;admin&#39;){&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;return &#39;login&#39;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; else{&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;return &#39;invalid user&#39;;&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;}&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
}&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
?&amp;gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
------------------------------------------------------&lt;/div&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Step 4:&lt;/h4&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In the view folder create two(2) PHP page with the name&amp;nbsp;&lt;span style=&quot;color: magenta; font-style: italic; font-weight: bold;&quot;&gt;login.php, Afterlogin.php&lt;/span&gt;&amp;nbsp;respectively. and write the following code:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;login.php&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;html&gt;&lt;/html&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;head&gt;&lt;/head&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;body&gt;&lt;/body&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;

&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo $reslt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
?&amp;gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;form action=&quot;&quot; method=&quot;POST&quot;&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;label&gt;Username&lt;/label&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;input id=&quot;username&quot; name=&quot;username&quot; required=&quot;required&quot; type=&quot;text&quot; value=&quot;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;label&gt;Password&lt;/label&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;&lt;input id=&quot;password&quot; name=&quot;password&quot; required=&quot;required&quot; type=&quot;password&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt; &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt; &amp;nbsp; &lt;button class=&quot;IL_AD&quot; il_ad12=&quot;&quot; type=&quot;submit&quot;&gt;green&lt;/button&gt;&lt;/div&gt;
big&quot; name=&quot;submit&quot;&amp;gt;&lt;span&gt;Login&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;button class=&quot;grey big&quot; type=&quot;reset&quot;&gt;&lt;span&gt;Cancle&lt;/span&gt;&lt;/button&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;ul style=&quot;text-align: left;&quot;&gt;
&lt;li&gt;&lt;i&gt;&lt;b&gt;Afterlogin.php&lt;/b&gt;&lt;/i&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;color: magenta;&quot;&gt;
&lt;div&gt;
&lt;html&gt;&lt;/html&gt;&lt;/div&gt;
&lt;div&gt;
&lt;head&gt;&lt;/head&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;body&gt;&lt;/body&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;

&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;echo $reslt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
?&amp;gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;------------------------------------------------------&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;h4 style=&quot;text-align: left;&quot;&gt;
Step 5:&lt;/h4&gt;
&lt;div&gt;
&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot;&gt;Open&lt;/span&gt; the &lt;i&gt;&lt;b&gt;&lt;span style=&quot;color: magenta;&quot;&gt;index.php&lt;/span&gt;&lt;/b&gt;&lt;/i&gt; file and write the following code:&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;include_once(&quot;controller/Controller.php&quot;);&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$controller = new Controller();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;$controller-&amp;gt;invoke();&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: magenta;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
------------------------------------------------------
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now try your self. It is too simple.&lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2017/08/simple-mvc-base-login-form-in-php.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-7752127635806178962</guid><pubDate>Tue, 29 Aug 2017 06:52:00 +0000</pubDate><atom:updated>2017-08-28T23:52:14.422-07:00</atom:updated><title>Frontend developer technologies</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Experience in designing and building responsive web applications and cross browser compatible systems&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Experience in delivering design options analysis papers and manage the design approvals.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Experience on designing Front End for large scale enterprise applications.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Understanding of ECMA 6 standards&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Hands-on
 in Front End technologies with experience in designing Single Page 
Applications using in OOJS frameworks (React JS, Angular JS)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;HTML 5, CSS 3.0&amp;nbsp; and JavaScript for rapid prototyping&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Modular Design using AMD principles (RequireJS, Common JS etc) &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Experience in building applications based of node js and NPM.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Understanding of Accessibility requirements (http://www.w3.org/WAI/gettingstarted/tips/designing.html)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Experience with JavaScript&amp;nbsp; Unit Testing Frameworks (For eg Mocha,Chai,Jasmine etc)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Understanding of UX design principles&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Exposure to packaging/build tools (eg Grunt, Gulp)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Exposure to Continuous Build and integration tools (Team City, Jenkins)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Exposure to&amp;nbsp; CSS based Grid frameworks&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Familiarity
 with middleware and N-Tier architecture, and strong analytical skills 
and logical reasoning for creating complex designs&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 7px; margin-left: 0; margin-right: 0; margin-top: 0;&quot;&gt;
&lt;span style=&quot;color: black; font-family: Arial, Helvetica, sans-serif;&quot;&gt;Experience in delivering in AGILE delivery model&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2017/08/frontend-developer-technologies.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-3570161147710421284</guid><pubDate>Wed, 27 May 2015 18:57:00 +0000</pubDate><atom:updated>2015-05-27T11:57:50.826-07:00</atom:updated><title>php Interview</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;

&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;&lt;br class=&quot;Apple-interchange-newline&quot; /&gt;What is PHP?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD3&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;websites&lt;/span&gt;.Even a non technical person can cretae sites using its CMS.&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD9&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;WordPress&lt;/span&gt;,osCommerce are the famus CMS of php.It is also an object oriented programming language like java,C-sharp etc.It is very eazy for learning&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of &quot;echo&quot; in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
It is used to print a data in the webpage, Example:  , The following code print the text in the webpage&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to include a file to a php page?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
We can include a file using &quot;include() &quot; or &quot;require()&quot;&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD2&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;function&lt;/span&gt;&amp;nbsp;with file path as its parameter.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What&#39;s the difference between include and require?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;require_once(), require(), include().What is difference between them?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
require() includes and evaluates a specific file, while require_once() does that only if it has not been included before (on the same page). So, require_once() is recommended to use when you want to include a file where you have a lot of&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD1&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;functions&lt;/span&gt;&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD7&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;for example&lt;/span&gt;. This way you make sure you don&#39;t include the file more times and you will not get the &quot;function&amp;nbsp;re-declared&quot; error.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;Differences between GET and POST methods ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
We can send 1024 bytes using GET method but&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD4&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;POST method&lt;/span&gt;&amp;nbsp;can transfer large amount of data and POST is the secure method than GET method .&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to declare an array in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Eg : var $arr = array(&#39;apple&#39;, &#39;grape&#39;, &#39;lemon&#39;);&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of &#39;print&#39; in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
This is not actually a real&amp;nbsp;function, It is a language construct. So you can use with out parentheses with its argument list.&lt;br /&gt;Example&amp;nbsp;&lt;b&gt;print(&#39;PHP Interview questions&#39;);&lt;/b&gt;&lt;br /&gt;&lt;b&gt;print &#39;Job Interview &#39;);&lt;/b&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is use of in_array()&amp;nbsp;function&amp;nbsp;in php ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;in_array&lt;/b&gt;&amp;nbsp;used to checks if a value exists in an array&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is use of count()&amp;nbsp;function&amp;nbsp;in php ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;count()&lt;/b&gt;&amp;nbsp;is used to count all elements in an array, or something in an object&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What’s the difference between include and require?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
It’s how they handle failures. If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the difference between Session and Cookie?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
The main difference between sessions and cookies is that sessions are stored on the server, and cookies are stored on the user’s computers in the text file format. Cookies can not hold multiple variables,But Session can hold multiple variables.We can set expiry for a cookie,The session only remains active as long as the browser is open.Users do not have access to the data you stored in Session,Since it is stored in the server.Session is mainly used for login/logout purpose while cookies using for user activity&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD10&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;tracking&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to set cookies in PHP?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Setcookie(&quot;sample&quot;, &quot;ram&quot;, time()+3600);&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to Retrieve a Cookie Value?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
eg : echo $_COOKIE[&quot;user&quot;];&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to create a session? How to set a value in session ? How to Remove data from a session?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Create session : session_start();&lt;br /&gt;Set value into session : $_SESSION[&#39;USER_ID&#39;]=1;&lt;br /&gt;Remove data from a session : unset($_SESSION[&#39;USER_ID&#39;];&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;what types of loops exist in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
for,while,do while and foreach (NB: You should learn its usage)&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to create a mysql connection?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
mysql_connect(servername,username,password);&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to select a database?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
mysql_select_db($db_name);&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to execute an sql query? How to fetch its result ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
$my_qry = mysql_query(&quot;SELECT * FROM `users` WHERE `u_id`=&#39;1&#39;; &quot;);&lt;br /&gt;$result = mysql_fetch_array($my_qry);&lt;br /&gt;echo $result[&#39;First_name&#39;];&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;Write a program using while loop&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
$my_qry = mysql_query(&quot;SELECT * FROM `users` WHERE `u_id`=&#39;1&#39;; &quot;);&lt;br /&gt;while($result = mysql_fetch_array($my_qry))&lt;br /&gt;{&lt;br /&gt;echo $result[&#39;First_name&#39;.].&quot;&lt;br /&gt;&quot;;&lt;br /&gt;}&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How we can retrieve the data in the result set of MySQL using PHP?&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;1. mysql_fetch_row&lt;/li&gt;
&lt;li&gt;2. mysql_fetch_array&lt;/li&gt;
&lt;li&gt;3. mysql_fetch_object&lt;/li&gt;
&lt;li&gt;4. mysql_fetch_assoc&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of&amp;nbsp;&lt;b&gt;explode()&lt;/b&gt;&amp;nbsp;function&amp;nbsp;?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Syntax : array explode ( string $delimiter , string $string [, int $limit ] );&lt;br /&gt;This&amp;nbsp;function&amp;nbsp;breaks a string into an array. Each of the array elements is a substring of string formed by splitting it on boundaries formed by the string delimiter.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the difference between explode() and split()&amp;nbsp;functions?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Split&amp;nbsp;function&amp;nbsp;splits string into array by regular expression. Explode splits a string into array by string.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of mysql_real_escape_string()&amp;nbsp;function?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
It is used to escapes&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD11&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;special characters&lt;/span&gt;&amp;nbsp;in a string for use in an SQL statement&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;Write down the code for save an uploaded file in php.&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
if ($_FILES[&quot;file&quot;][&quot;error&quot;] == 0)&lt;br /&gt;{&lt;br /&gt;move_uploaded_file($_FILES[&quot;file&quot;][&quot;tmp_name&quot;],&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&quot;upload/&quot; . $_FILES[&quot;file&quot;][&quot;name&quot;]);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Stored in: &quot; . &quot;upload/&quot; . $_FILES[&quot;file&quot;][&quot;name&quot;];&lt;br /&gt;}&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to create a text file in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
$filename = &quot;/home/user/guest/newfile.txt&quot;;&lt;br /&gt;$file = fopen( $filename, &quot;w&quot; );&lt;br /&gt;if( $file == false )&lt;br /&gt;{&lt;br /&gt;echo ( &quot;Error in opening new file&quot; ); exit();&lt;br /&gt;}&lt;br /&gt;fwrite( $file, &quot;This is a&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD6&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;simple test&lt;/span&gt;\n&quot; );&lt;br /&gt;fclose( $file );&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to strip whitespace (or other characters) from the beginning and end of a string ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
The trim()&amp;nbsp;function&amp;nbsp;removes whitespaces or other predefined characters from both sides of a string.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of header()&amp;nbsp;function&amp;nbsp;in php ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
The header()&amp;nbsp;function&amp;nbsp;sends a raw HTTP header to a client browser.Remember that this&amp;nbsp;functionmust be called before sending the actual out put.For example, You do not print any HTML element before using this&amp;nbsp;function.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to redirect a page in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
The following code can be used for it,&amp;nbsp;&lt;b&gt;header(&quot;Location:index.php&quot;);&lt;/b&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How stop the execution of a php scrip ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;exit()&lt;/b&gt;&amp;nbsp;function&amp;nbsp;is used to stop the execution of a page&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to set a page as a home page in a php based site ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;index.php&lt;/b&gt;&amp;nbsp;is the default name of the home page in php based sites&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to find the length of a string?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;strlen()&lt;/b&gt;&amp;nbsp;function&amp;nbsp;used to find the length of a string&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;what is the use of rand() in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
It is used to generate random numbers.If called without the arguments it returns a pseudo-random integer between 0 and getrandmax(). If you want a random&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD5&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;number&lt;/span&gt;&amp;nbsp;between 6 and 12 (inclusive),&amp;nbsp;for example, use rand(6, 12).This&amp;nbsp;function&amp;nbsp;does not generate cryptographically safe values, and should not be used for cryptographic uses. If you want a cryptographically secure value, consider using openssl_random_pseudo_bytes() instead.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;what is the use of isset() in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
This&amp;nbsp;function&amp;nbsp;is used to determine if a variable is set and is not NULL&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the difference between mysql_fetch_array() and mysql_fetch_assoc() ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;mysql_fetch_assoc&lt;/b&gt;&amp;nbsp;function&amp;nbsp;Fetch a result row as an associative array, While&lt;b&gt;mysql_fetch_array()&lt;/b&gt;&amp;nbsp;fetches an associative array, a numeric array, or both&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is mean by an associative array?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Associative arrays are arrays that use string keys is called associative arrays.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD8&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;What is the importance&lt;/span&gt;&amp;nbsp;of &quot;method&quot; attribute in a html form?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&quot;method&quot; attribute determines how to send the form-data into the server.There are two methods, get and post. The default method&amp;nbsp;&lt;span class=&quot;IL_AD&quot; id=&quot;IL_AD12&quot; style=&quot;background-attachment: scroll !important; background-clip: initial !important; background-color: transparent !important; background-image: none !important; background-origin: initial !important; background-position: 0% 50%; background-repeat: repeat !important; background-size: initial !important; border-bottom-color: rgb(26, 23, 25) !important; border-bottom-style: solid !important; border-bottom-width: 1px !important; color: rgb(26, 23, 25) !important; cursor: pointer !important; display: inline !important; float: none !important; font-size: 16px !important; padding: 0px 0px 1px !important; position: static; text-decoration: underline !important;&quot;&gt;is get&lt;/span&gt;.This sends the form information by appending it on the URL.Information sent from a form with the&amp;nbsp;POST method&amp;nbsp;is invisible to others and has no limits on the amount of information to send.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the importance&amp;nbsp;of &quot;action&quot; attribute in a html form?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
The action attribute determines where to send the form-data in the form submission.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of &quot;enctype&quot; attribute in a html form?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
The enctype attribute determines how the form-data should be encoded when submitting it to the server. We need to set enctype as&amp;nbsp;&lt;b&gt;&quot;multipart/form-data&quot;&lt;/b&gt;&amp;nbsp;when we are using a form for uploading files&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to create an array of a group of items inside an HTML form ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
We can create input fields with same name for &quot;name&quot; attribute with squire bracket at the end of the name of the name attribute, It passes data as an array to PHP.&lt;br /&gt;For instance :&lt;/div&gt;
&lt;pre&gt;&lt;input name=&quot;MyArray[]&quot; /&gt;  &lt;input name=&quot;MyArray[]&quot; /&gt;  &lt;input name=&quot;MyArray[]&quot; /&gt;  &lt;input name=&quot;MyArray[]&quot; /&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;Define Object-Oriented Methodology&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Object orientation is a software/Web development methodology that is based on the modeling a real world system.An object is the core concept involved in the object orientation. An object is the copy of the real world enity.An object oriented model is a collection of objects and its inter-relationships&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How do you define a constant?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Using define() directive, like define (&quot;MYCONSTANT&quot;,150)&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How send email using php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
To send email using PHP, you use the mail() function.This mail() function accepts 5 parameters as follows (the last 2 are optional). You need webserver, you can&#39;t send email from localhost. eg : mail($to,$subject,$message,$headers);&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to find current date and time?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
The date() function provides you with a means of retrieving the current date and time, applying the format integer parameters indicated in your script to the timestamp provided or the current local time if no timestamp is given. In simplified terms, passing a time parameter is optional - if you don&#39;t, the current timestamp will be used.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;Difference between mysql_connect and mysql_pconnect?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends. mysql_connect()provides only for the databasenewconnection while using mysql_pconnect , the function would first try to find a (persistent) link that&#39;s already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection... the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of &quot;ksort&quot; in php?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
It is used for sort an array by key in reverse order.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the difference between $var and $$var?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
They are both variables. But $var is a variable with a fixed name. $$var is a variable who&#39;s name is stored in $var. For example, if $var contains &quot;message&quot;, $$var is the same as $message.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What are the encryption techniques in PHP&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;MD5&lt;/b&gt;&amp;nbsp;PHP implements the MD5 hash algorithm using the md5 function,&lt;br /&gt;eg : $encrypted_text = md5 ($msg);&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;mcrypt_encrypt&lt;/b&gt;&amp;nbsp;:- string mcrypt_encrypt ( string $cipher , string $key , string $data , string $mode [, string $iv ] );&lt;br /&gt;Encrypts plaintext with given parameters&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is the use of the function htmlentities?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
htmlentities Convert all applicable characters to HTML entities This function is identical to htmlspecialchars() in all ways, except with htmlentities(), all characters which have HTML character entity equivalents are translated into these entities.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to delete a file from the system&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Unlink() deletes the given file from the file system.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to get the value of current session id?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
session_id() function returns the session id for the current session.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What are the differences between mysql_fetch_array(), mysql_fetch_object(), mysql_fetch_row()?&lt;/strong&gt;&lt;ul&gt;
&lt;li&gt;Mysql_fetch_array Fetch a result row as an associative array, a numeric array, or both.&lt;/li&gt;
&lt;li&gt;mysql_fetch_object ( resource result ) Returns an object with properties that correspond to the fetched row and moves the internal data pointer ahead. Returns an object with properties that correspond to the fetched row, or FALSE if there are no more rows&lt;/li&gt;
&lt;li&gt;mysql_fetch_row() fetches one row of data from the result associated with the specified result identifier. The row is returned as an array. Each result column is stored in an array offset, starting at offset 0.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What are the different types of errors in PHP ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Here are three basic types of runtime errors in PHP:&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script - for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all - although you can change this default behavior.&lt;/li&gt;
&lt;li&gt;2. Warnings: These are more serious errors - for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.&lt;/li&gt;
&lt;li&gt;3. Fatal errors: These are critical errors - for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP&#39;s default behavior is to display them to the user when they take place.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;what is sql injection ?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
SQL injection is a malicious code injection technique.It exploiting SQL vulnerabilities in Web applications&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is x+ mode in fopen() used for?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
Read/Write. Creates a new file. Returns FALSE and an error if file already exists&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;How to find the position of the first occurrence of a substring in a string&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;b&gt;strpos()&lt;/b&gt;&amp;nbsp;is used to find the position of the first occurrence of a substring in a string&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What is PEAR?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
PEAR is a framework and distribution system for reusable PHP components.The project seeks to provide a structured library of code, maintain a system for distributing code and for managing code packages, and promote a standard coding style.PEAR is broken into three classes: PEAR Core Components, PEAR Packages, and PECL Packages. The Core Components include the base classes of PEAR and PEAR_Error, along with database, HTTP, logging, and e-mailing functions. The PEAR Packages include functionality providing for authentication, networking, and file system features, as well as tools for working with XML and HTML templates.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;Distinguish between urlencode and urldecode?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
This method is best when encode a string to used in a query part of a url. it returns a string in which all non-alphanumeric characters except -_. have replece with a percentege(%) sign . the urldecode-&amp;gt;Decodes url to encode string as any %and other symbole are decode by the use of the urldecode() function.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;background-color: white; font-family: Verdana, Arial, Helvetica, sans-serif;&quot;&gt;&lt;strong&gt;What are the different errors in PHP?&lt;/strong&gt;&lt;div style=&quot;line-height: 1.5;&quot;&gt;
In PHP, there are three types of runtime errors, they are:&lt;/div&gt;
&lt;div style=&quot;line-height: 1.5;&quot;&gt;
&lt;strong&gt;Warnings:&lt;/strong&gt;&lt;br /&gt;These are important errors. Example: When we try to include () file which is not available. These errors are showed to the user by default but they will not result in ending the script.&lt;br /&gt;&lt;strong&gt;Notices:&lt;/strong&gt;&lt;br /&gt;These errors are non-critical and trivial errors that come across while executing the script in PHP. Example: trying to gain access the variable which is not defined. These errors are not showed to the users by default even if the default behavior is changed.&lt;br /&gt;&lt;strong&gt;Fatal errors:&lt;/strong&gt;&lt;br /&gt;These are critical errors. Example: instantiating an object of a class which does not exist or a non-existent function is called. These errors results in termination of the script immediately and default behavior of PHP is shown to them when they take place. Twelve different error types are used to represent these variations internally.&lt;/div&gt;
&lt;/li&gt;
&lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2015/05/php-interview.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-5668616769053965875</guid><pubDate>Fri, 20 Dec 2013 11:19:00 +0000</pubDate><atom:updated>2013-12-20T03:23:58.200-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>JSON Tutorial</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1&gt;
JSON Tutorial&lt;/h1&gt;
&lt;div&gt;
JSON or JavaScript Object Notation is a lightweight is a text-based 
open standard designed for human-readable data interchange. The JSON 
format was originally specified by Douglas Crockford, and is described 
in RFC 4627. The official Internet media type for JSON is 
application/json. The JSON filename extension is &lt;b&gt;.json&lt;/b&gt;.&lt;br /&gt;
&lt;br /&gt;
This tutorial will help you in understanding JSON and how to use it 
within various programming languages like PHP, PERL, Python, Ruby, Java 
etc.&lt;br /&gt;
&lt;br /&gt;
JSON or JavaScript Object Notation is a lightweight text-based open 
standard designed for human-readable data interchange. Conventions used 
by JSON are known to programmers which include C, C++, Java, Python, 
Perl etc.&lt;br /&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;JSON stands for JavaScript Object Notation.&lt;/li&gt;
&lt;li&gt;This format was specified by Douglas Crockford.&lt;/li&gt;
&lt;li&gt;This was designed for human-readable data interchange&lt;/li&gt;
&lt;li&gt;It has been extended from the JavaScript scripting language.&lt;/li&gt;
&lt;li&gt;The filename extension is &lt;b&gt;.json&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;JSON Internet Media type is &lt;b&gt;application/json&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;The Uniform Type Identifier is public.json&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Uses of JSON&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;It is used when writing JavaScript based application which includes browser extension and websites.&lt;/li&gt;
&lt;li&gt;JSON format is used for serializing &amp;amp; transmitting structured data over network connection.&lt;/li&gt;
&lt;li&gt;This is primarily used to transmit data between server and web application.&lt;/li&gt;
&lt;li&gt;Web Services and API.s use JSON format to provide public data.&lt;/li&gt;
&lt;li&gt;It can be used with modern programming languages.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Characteristics of JSON&lt;/h2&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Easy to read and write JSON.&lt;/li&gt;
&lt;li&gt;Lightweight text based interchange format&lt;/li&gt;
&lt;li&gt;Language independent.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Simple Example in JSON&lt;/h2&gt;
Example shows Books information stored using JSON considering language of books and there editions:&lt;br /&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;01&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;language&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Java&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;edition&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;third&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Herbert Schildt&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;07&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;language&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;C++&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;edition&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;second&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;E.Balagurusamy&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
After understanding the above program we will try another example, let&#39;s save the below code as &lt;b&gt;json.htm&lt;/b&gt;:&lt;br /&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&lt;html&gt;&lt;/html&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;head&gt;&lt;/head&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;JSON example&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;script span=&quot;&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  
  &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object1 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;language&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Java&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;herbert schildt&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;h1&gt;
JSON with JavaScript example&lt;/h1&gt;
&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;br&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;h3&gt;
Language = &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;/h3&gt;
&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;h3&gt;
Author = &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;/h3&gt;
&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;   

  &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object2 &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;language&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;C++&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;E-Balagurusamy&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;};&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;br&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;h3&gt;
Language = &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;language&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;/h3&gt;
&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;h3&gt;
Author = &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;/h3&gt;
&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;   
  
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;hr /&gt;
&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;object2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;language &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; programming language can be studied &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;from book written by &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; object2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;author&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&lt;hr /&gt;
&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
  
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;
Now let&#39;s try to open &lt;a href=&quot;http://www.tutorialspoint.com/json/json.htm&quot; target=&quot;_blank&quot;&gt;json.htm&lt;/a&gt; using IE or any other javascript enabled browser, this produces the following result:&lt;br /&gt;
&lt;img alt=&quot;json example&quot; src=&quot;http://www.tutorialspoint.com/json/images/json_example_demo.jpg&quot; /&gt;
You can refer to &lt;a href=&quot;http://www.tutorialspoint.com/json/json_objects.htm&quot;&gt;JSON Objects&lt;/a&gt; chapter about more information on JSON objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&#39;s have a quick look on JSON basic syntax. JSON syntax is 
basically considered as subset of JavaScript syntax, it includes the 
following:&lt;br /&gt;

&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Data is represented in name/value pairs&lt;/li&gt;
&lt;li&gt;Curly braces hold objects and each name is followed by &#39;:&#39;(colon), the name/value pairs are separated by , (comma).&lt;/li&gt;
&lt;li&gt;Square brackets hold arrays and values are separated by ,(comma).&lt;/li&gt;
&lt;/ul&gt;
Below is a simple example:&lt;br /&gt;

&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;book&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;01&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;language&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Java&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;edition&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;third&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Herbert Schildt&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;07&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;language&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;C++&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;edition&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;second&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;author&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;E.Balagurusamy&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
JSON supports following two data structures:&lt;br /&gt;

&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;&lt;b&gt;Collection of name/value pairs:&lt;/b&gt; This Data Structure is supported by different programming language.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Ordered list of values:&lt;/b&gt; It includes array, list, vector or sequence etc.&lt;br /&gt;
&lt;h2&gt;
Creating Simple Objects&lt;/h2&gt;
JSON objects can be created with Javascript. Let us see various ways of creating JSON objects using Javascript:&lt;br /&gt;

&lt;/li&gt;
&lt;li&gt;Creation of an empty Object:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;var JSONObj = {};
&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Creation of new Object:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;var JSONObj = new Object();
&lt;/pre&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Creation of an object with attribute &lt;b&gt;bookname&lt;/b&gt; with value in string, attribute &lt;b&gt;price&lt;/b&gt; with numeric value. Attributes is accessed by using &#39;.&#39; Operator:&lt;/li&gt;
&lt;/ul&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;var JSONObj = { &quot;bookname &quot;:&quot;VB BLACK BOOK&quot;, &quot;price&quot;:500 };
&lt;/pre&gt;
This is an example which shows creation of an object in javascript using JSON, save the below code as &lt;b&gt;json_object.htm&lt;/b&gt;:&lt;br /&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Creating Object JSON with JavaScript&lt;/title&gt;
&lt;script language=&quot;javascript&quot;&gt;

  var JSONObj = { &quot;name&quot; : &quot;tutorialspoint.com&quot;, &quot;year&quot;  : 2005 };
  document.write(&quot;&lt;h1&gt;
JSON with JavaScript example&lt;/h1&gt;
&quot;);
  document.write(&quot;&lt;br&gt;&quot;);
  document.write(&quot;&lt;h3&gt;
Website Name=&quot;+JSONObj.name+&quot;&lt;/h3&gt;
&quot;);  
  document.write(&quot;&lt;h3&gt;
Year=&quot;+JSONObj.year+&quot;&lt;/h3&gt;
&quot;);  

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/pre&gt;
Now let&#39;s try to open &lt;a href=&quot;http://www.tutorialspoint.com/json/json_object.htm&quot; target=&quot;_blank&quot;&gt;json_object.htm&lt;/a&gt; using IE or any other javascript enabled browser, this produces the following result:&lt;br /&gt;

&lt;img alt=&quot;json objects&quot; src=&quot;http://www.tutorialspoint.com/json/images/json_objects.jpg&quot; /&gt;
&lt;h2&gt;
Creating Array Objects&lt;/h2&gt;
Below example shows creation of an array object in javascript using JSON, save the below code as &lt;b&gt;json_array_object.htm&lt;/b&gt;:&lt;br /&gt;

&lt;pre class=&quot;prettyprint&quot;&gt;&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Creation of array object in javascript using JSON&lt;/title&gt;
&lt;script language=&quot;javascript&quot;&gt;

document.writeln(&quot;&lt;h2&gt;
JSON array object&lt;/h2&gt;
&quot;);

var books = { &quot;Pascal&quot; : [ 
      { &quot;Name&quot;  : &quot;Pascal Made Simple&quot;, &quot;price&quot; : 700 },
      { &quot;Name&quot;  : &quot;Guide to Pascal&quot;, &quot;price&quot; : 400 }
   ],                       
   &quot;Scala&quot;  : [
      { &quot;Name&quot;  : &quot;Scala for the Impatient&quot;, &quot;price&quot; : 1000 }, 
      { &quot;Name&quot;  : &quot;Scala in Depth&quot;, &quot;price&quot; : 1300 }
   ]    
}    

var i = 0
document.writeln(&quot;&lt;table border=&#39;2&#39;&gt;
&lt;tr&gt;&quot;);
for(i=0;i&lt;books.Pascal.length;i++)
{	
   document.writeln(&quot;&lt;td&gt;&quot;);
   document.writeln(&quot;&lt;table border=&#39;1&#39; width=100 &gt;&quot;);
   document.writeln(&quot;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td width=50&gt;&quot;
   + books.Pascal[i].Name+&quot;&lt;/td&gt;&lt;/tr&gt;
&quot;);
   document.writeln(&quot;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Price&lt;/b&gt;&lt;/td&gt;&lt;td width=50&gt;&quot;
   + books.Pascal[i].price +&quot;&lt;/td&gt;&lt;/tr&gt;
&quot;);
   document.writeln(&quot;&lt;/table&gt;
&quot;);
   document.writeln(&quot;&lt;/td&gt;&quot;);
}

for(i=0;i&lt;books.Scala.length;i++)
{
   document.writeln(&quot;&lt;td&gt;&quot;);
   document.writeln(&quot;&lt;table border=&#39;1&#39; width=100 &gt;&quot;);
   document.writeln(&quot;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Name&lt;/b&gt;&lt;/td&gt;&lt;td width=50&gt;&quot;
   + books.Scala[i].Name+&quot;&lt;/td&gt;&lt;/tr&gt;
&quot;);
   document.writeln(&quot;
&lt;tr&gt;&lt;td&gt;&lt;b&gt;Price&lt;/b&gt;&lt;/td&gt;&lt;td width=50&gt;&quot;
   + books.Scala[i].price+&quot;&lt;/td&gt;&lt;/tr&gt;
&quot;);
   document.writeln(&quot;&lt;/table&gt;
&quot;);
   document.writeln(&quot;&lt;/td&gt;&quot;);
}
document.writeln(&quot;&lt;/tr&gt;
&lt;/table&gt;
&quot;);
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
&lt;/pre&gt;
Now let&#39;s try to open &lt;a href=&quot;http://www.tutorialspoint.com/json/json_array_object.htm&quot; target=&quot;_blank&quot;&gt;json_array_object.htm&lt;/a&gt; using IE or any other javascript enabled browser, this produces the following result:&lt;br /&gt;

&lt;br /&gt;
JSON Schema is a specification for JSON based format for defining 
structure of JSON data. It was written under IETF draft which expired in
 2011. JSON Schema:&lt;br /&gt;

&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Describes your existing data format.&lt;/li&gt;
&lt;li&gt;Clear, human- and machine-readable documentation.&lt;/li&gt;
&lt;li&gt;Complete structural validation, useful for automated testing.&lt;/li&gt;
&lt;li&gt;Complete structural validation, validating client-submitted data.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
JSON Schema Validation Libraries&lt;/h2&gt;
There are several validators currently available for different 
programming languages. Currently the most complete and compliant JSON 
Schema validator available is JSV&lt;br /&gt;

&lt;table class=&quot;src&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th style=&quot;width: 20%;&quot;&gt;Languages&lt;/th&gt;&lt;th&gt;Libraries&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;C&lt;/td&gt;&lt;td&gt;WJElement (LGPLv3)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Java&lt;/td&gt;&lt;td&gt;json-schema-validator (LGPLv3)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;.NET&lt;/td&gt;&lt;td&gt;Json.NET (MIT)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;ActionScript 3&lt;/td&gt;&lt;td&gt;Frigga (MIT)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Haskell&lt;/td&gt;&lt;td&gt;aeson-schema (MIT)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Python&lt;/td&gt;&lt;td&gt;Jsonschema&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;Ruby&lt;/td&gt;&lt;td&gt;autoparse (ASL 2.0); ruby-jsonschema (MIT)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;PHP&lt;/td&gt;&lt;td&gt;php-json-schema (MIT). json-schema (Berkeley)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;JavaScript&lt;/td&gt;&lt;td&gt;Orderly (BSD); JSV; json-schema; Matic (MIT); Dojo; Persevere (modified BSD or AFL 2.0); schema.js.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2&gt;
JSON Schema Example&lt;/h2&gt;
Following is a basic JSON schema which covers a classical product catalog description:&lt;br /&gt;

&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;$schema&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http://json-schema.org/draft-04/schema#&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;title&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Product&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;A product from Acme&#39;s catalog&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;object&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;properties&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;The unique identifier for a product&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;integer&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;description&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Name of the product&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;string&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;number&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;minimum&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;exclusiveMinimum&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;required&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
Let&#39;s check various important keywords which can be used in this schema:&lt;br /&gt;

&lt;table class=&quot;src&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th style=&quot;width: 20%;&quot;&gt;Keywords&lt;/th&gt;&lt;th&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;$schema&lt;/td&gt;&lt;td&gt;The $schema keyword states that this schema is written according to the draft v4 specification.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;title &lt;/td&gt;&lt;td&gt;You will use this to give a title to your schema&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;description&lt;/td&gt;&lt;td&gt;A little description of the schema&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;type&lt;/td&gt;&lt;td&gt;The type keyword defines the first constraint on our JSON data: it has to be a JSON Object.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;properties&lt;/td&gt;&lt;td&gt;Defines various keys and their value types, minimum and maximum values to be used in JSON file.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;required&lt;/td&gt;&lt;td&gt;This keeps a list of required properties.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;minimum&lt;/td&gt;&lt;td&gt;This is the constraint to be put on the value and represents minimum acceptable value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;exclusiveMinimum&lt;/td&gt;&lt;td&gt;If &quot;exclusiveMinimum&quot; is present and 
has boolean value true, the instance is valid if it is strictly greater 
than the value of &quot;minimum&quot;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;maximum&lt;/td&gt;&lt;td&gt;This is the constraint to be put on the value and represents maximum acceptable value.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;exclusiveMaximum&lt;/td&gt;&lt;td&gt;If &quot;exclusiveMaximum&quot; is present and 
has boolean value true, the instance is valid if it is strictly lower 
than the value of &quot;maximum&quot;.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;multipleOf&lt;/td&gt;&lt;td&gt;A numeric instance is valid against 
&quot;multipleOf&quot; if the result of the division of the instance by this 
keyword&#39;s value is an integer.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;maxLength&lt;/td&gt;&lt;td&gt;The length of a string instance is defined as the maximum number of its characters.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;minLength&lt;/td&gt;&lt;td&gt;The length of a string instance is defined as the minimum number of its characters.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;pattern&lt;/td&gt;&lt;td&gt;A string instance is considered valid if the regular expression matches the instance successfully.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
You can check a &lt;a href=&quot;http://json-schema.org/latest/json-schema-validation.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;http://json-schema.org&lt;/a&gt;
 for complete list of keywords which can be used in defining JSON 
schema. Above schema can be used to test the validity of the below given
 JSON code:&lt;br /&gt;

&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;An ice sculpture&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;12.50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;id&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;A blue mouse&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;25.50&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
    &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;/pre&gt;
&lt;hr /&gt;
JSON and XML are human readable formats and are language independent.
 They both have support for creation, reading and decoding in real world
 situations. We can compare JSON with XML based on the following 
factors:&lt;br /&gt;

&lt;h2&gt;
Verbose&lt;/h2&gt;
XML is more verbose than JSON, so it&#39;s faster to write JSON for humans.&lt;br /&gt;

&lt;h2&gt;
Arrays Usage&lt;/h2&gt;
XML is used to describe structured data which doesn&#39;t include arrays whereas JSON include arrays.&lt;br /&gt;

&lt;h2&gt;
Parsing&lt;/h2&gt;
JavaScript&#39;s &lt;i&gt;eval&lt;/i&gt; method parses JSON. When applied to JSON, eval returns the described object.&lt;br /&gt;

&lt;h2&gt;
Example&lt;/h2&gt;
This shows individual examples of XML and JSON:&lt;br /&gt;

&lt;h3&gt;
JSON&lt;/h3&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;company&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Volkswagen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Vento&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;price&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;800000&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h3&gt;
XML&lt;/h3&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&lt;car&gt;&lt;/car&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;company&gt;&lt;/company&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Volkswagen&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;name&gt;&lt;/name&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Vento&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;price&gt;&lt;/price&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;800000&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
This tutorial will teach you how to encode and decode JSON objects 
using PHP programming language. Let&#39;s start with preparing environment 
to start our programming with PHP for JSON.&lt;br /&gt;

&lt;h2&gt;
Environment&lt;/h2&gt;
As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default.&lt;br /&gt;

&lt;h2&gt;
JSON Functions&lt;/h2&gt;
&lt;table class=&quot;src&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th style=&quot;width: 20%;&quot;&gt;Function&lt;/th&gt;&lt;th&gt;Libraries&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;json_encode &lt;/td&gt;&lt;td&gt;Returns the JSON representation of a value&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;json_decode&lt;/td&gt;&lt;td&gt;Decodes a JSON string&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;json_last_error&lt;/td&gt;&lt;td&gt;Returns the last error occurred&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;h2&gt;
Encoding JSON in PHP (json_encode)&lt;/h2&gt;
PHP json_encode() function is used for encoding JSON in PHP. This 
function returns the JSON representation of a value on success or FALSE 
on failure.&lt;br /&gt;

&lt;h3&gt;
Syntax:&lt;/h3&gt;
&lt;span class=&quot;kwd&quot;&gt;string&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; json_encode &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $value &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $options &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;
&lt;h3&gt;
Parameters:&lt;/h3&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;&lt;b&gt;value&lt;/b&gt;: The value being encoded. This function only works with UTF-8 encoded data.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;options&lt;/b&gt;: This optional value is a bitmask consisting of 
JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, 
JSON_NUMERIC_CHECK,JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, 
JSON_FORCE_OBJECT&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
The following example shows how to convert an arrays into JSON with PHP:&lt;br /&gt;

&lt;span class=&quot;pun&quot;&gt;&lt;span class=&quot;pln&quot;&gt;php
   $arr &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; array&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;a&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;1&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;b&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;2&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;c&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;3&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;d&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;e&#39;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;5&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   echo json_encode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$arr&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
While executing, this will produce following result:&lt;br /&gt;

{&quot;a&quot;:1,&quot;b&quot;:2,&quot;c&quot;:3,&quot;d&quot;:4,&quot;e&quot;:5}

The following example shows how PHP objects can be converted into JSON:&lt;br /&gt;

&lt;span class=&quot;pun&quot;&gt;&lt;span class=&quot;pln&quot;&gt;php
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Emp&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $hobbies  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
       &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $birthdate &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $e &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;Emp&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;sachin&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;hobbies  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;sports&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;birthdate &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;m/d/Y h:i:s a&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;8/5/1974 12:20:03 p&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   $e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;birthdate &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; date&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;m/d/Y h:i:s a&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; strtotime&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;8/5/1974 12:20:03&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   echo json_encode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
While executing, this will produce following result:&lt;br /&gt;

{&quot;name&quot;:&quot;sachin&quot;,&quot;hobbies&quot;:&quot;sports&quot;,&quot;birthdate&quot;:&quot;08\/05\/1974 12:20:03 pm&quot;}

&lt;h2&gt;
Decoding JSON in PHP (json_decode)&lt;/h2&gt;
PHP json_decode() function is used for decoding JSON in PHP. This 
function returns the value decoded from json to appropriate PHP type.&lt;br /&gt;

&lt;h3&gt;
Syntax:&lt;/h3&gt;
&lt;span class=&quot;pln&quot;&gt;mixed json_decode &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$json &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$assoc &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $depth &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;512&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;[,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; $options &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;]]])&lt;/span&gt;
&lt;h3&gt;
Paramaters:&lt;/h3&gt;
&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;&lt;b&gt;json_string&lt;/b&gt;: It is encoded string which must be UTF-8 encoded data&lt;/li&gt;
&lt;li&gt;&lt;b&gt;assoc&lt;/b&gt;: It is a boolean type parameter, when set to TRUE, returned objects will be converted into associative arrays.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;depth&lt;/b&gt;: It is an integer type parameter which specifies recursion depth&lt;/li&gt;
&lt;li&gt;&lt;b&gt;options&lt;/b&gt;: It is an integer type bitmask of JSON decode, JSON_BIGINT_AS_STRING is supported.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
Example&lt;/h3&gt;
The following example shows how PHP can be used to decode JSON objects:&lt;br /&gt;

&lt;span class=&quot;pun&quot;&gt;&lt;span class=&quot;pln&quot;&gt;php
   $json &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&#39;{&quot;a&quot;:1,&quot;b&quot;:2,&quot;c&quot;:3,&quot;d&quot;:4,&quot;e&quot;:5}&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

   var_dump&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;json_decode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$json&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   var_dump&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;json_decode&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;$json&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;));&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;?&amp;gt;&lt;/span&gt;
While executing, this will produce following result:&lt;br /&gt;

object(stdClass)#1 (5) {
    [&quot;a&quot;] =&amp;gt; int(1)
    [&quot;b&quot;] =&amp;gt; int(2)
    [&quot;c&quot;] =&amp;gt; int(3)
    [&quot;d&quot;] =&amp;gt; int(4)
    [&quot;e&quot;] =&amp;gt; int(5)
}

array(5) {
    [&quot;a&quot;] =&amp;gt; int(1)
    [&quot;b&quot;] =&amp;gt; int(2)
    [&quot;c&quot;] =&amp;gt; int(3)
    [&quot;d&quot;] =&amp;gt; int(4)
    [&quot;e&quot;] =&amp;gt; int(5)
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Ajax is Asynchronous JavaScript and XML which is used on client side 
as group of interrelated web development techniques in order to create 
asynchronous web applications. According to Ajax model, web applications
 can send data and retrieve data from a server asynchronously without 
interfering with the display, behavior of existing page.&lt;br /&gt;

Many developers use JSON to pass AJAX updates between client and 
server. Websites updating live sports scores can be considered as an 
example of AJAX. If these scores have to be updated on the website, then
 they must be stored on the server so that the webpage can retrieve the 
score when it is required. This is where we can make use of JSON 
formatted data.&lt;br /&gt;

Any data that is updated using AJAX can be stored using the JSON 
format on web server. Ajax is used so that javascript can retrieve these
 JSON files when necessary, they parse them and then does of the two:&lt;br /&gt;

&lt;ul class=&quot;list&quot;&gt;
&lt;li&gt;Store the parsed values in variables for further processing before displaying them on the webpage&lt;/li&gt;
&lt;li&gt;It directly assign the data to the DOM elements in the webpage, so that it gets displayed on the website.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
Example&lt;/h2&gt;
The below code shows JSON with Ajax, save it in &lt;b&gt;ajax.htm&lt;/b&gt; file. Here loading function loadJSON() will be used asynchronously to upload JSON data.&lt;br /&gt;

&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&lt;html&gt;&lt;/html&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;head&gt;&lt;/head&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;text/html; charset=ISO-8859-1&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;content-type&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;script span=&quot;&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;application/javascript&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; loadJSON&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data_file &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http://www.tutorialspoint.com/json/data.json&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http_request &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;XMLHttpRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Opera 8.0+, Firefox, Chrome, Safari&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      http_request &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;XMLHttpRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Internet Explorer Browsers&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         http_request &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ActiveXObject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Msxml2.XMLHTTP&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;try&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            http_request &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;typ&quot;&gt;ActiveXObject&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Microsoft.XMLHTTP&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;catch&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;e&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Something went wrong&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            alert&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Your browser broke!&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
            &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;false&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
         &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   http_request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onreadystatechange  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http_request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;readyState &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// Javascript function JSON.parse to parse JSON data&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jsonObj &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; JSON&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;http_request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;responseText&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

        &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// jsonObj variable now contains the data structure and can&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        &lt;/span&gt;&lt;span class=&quot;com&quot;&gt;// be accessed as jsonObj.name and jsonObj.country.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;innerHTML &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;  jsonObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
        document&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;getElementById&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Country&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;innerHTML &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; jsonObj&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;country&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
      &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   http_request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;GET&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; data_file&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;true&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
   http_request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;send&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/script&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;tutorialspoint.com JSON&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;h1&gt;
&lt;/h1&gt;
&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Cricketer Details&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;table span=&quot;&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;src&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;
&lt;tr&gt;&lt;th&gt;&lt;/th&gt;&lt;/tr&gt;
&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Name&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/table&gt;
&lt;/span&gt;&lt;th&gt;&lt;/th&gt;&lt;span class=&quot;pln&quot;&gt;Country&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;
&lt;tr&gt;&lt;td&gt;&lt;div span=&quot;&quot;&gt;
&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;Name&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Sachin&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;td&gt;&lt;div span=&quot;&quot;&gt;
&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;id&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;Country&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;India&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/td&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;div span=&quot;&quot;&gt;
&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;central&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;button span=&quot;&quot;&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;button&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot;&gt;onclick&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;loadJSON&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;atv&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;Update Details &lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/button&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot;&gt;&lt;/span&gt;
Following is the input file &lt;b&gt;data.json&lt;/b&gt; having data in JSON format which will be uploaded asynchronously when we click &lt;b&gt;Update Detail&lt;/b&gt; button. This file is being kept in http://www.tutorialspoint.com/json/&lt;br /&gt;

&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;name&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;brett&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;country&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Australia&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
Above HTML code will generate following screen, where you can check AJAX in action:&lt;br /&gt;

&lt;div&gt;

&lt;h1&gt;
Cricketer Details&lt;/h1&gt;
&lt;table class=&quot;src&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Country&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;div id=&quot;Name&quot;&gt;
Sachin&lt;/div&gt;
&lt;/td&gt;&lt;td&gt;&lt;div id=&quot;Country&quot;&gt;
India&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;central&quot;&gt;

&lt;/div&gt;
&lt;/div&gt;
When you click on &lt;b&gt;Update Detail&lt;/b&gt; button, you should get a result something as follows, you can try it yourself &lt;a href=&quot;http://www.tutorialspoint.com/json/ajax.htm&quot; target=&quot;_blank&quot;&gt;JSON with AJAX&lt;/a&gt; provided your browser supports Javascript.&lt;br /&gt;


&lt;h1&gt;
Cricketer Details&lt;/h1&gt;
&lt;table class=&quot;src&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th&gt;Name&lt;/th&gt;&lt;th&gt;Country&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;div id=&quot;Name&quot;&gt;
brett&lt;/div&gt;
&lt;/td&gt;&lt;td&gt;&lt;div id=&quot;Country&quot;&gt;
Australia&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class=&quot;prettyprint prettyprinted&quot;&gt;&lt;span class=&quot;tag&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&amp;nbsp; </description><link>http://gurukanagaraj.blogspot.com/2013/12/json-tutorial.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-7518889263952999017</guid><pubDate>Wed, 18 Dec 2013 18:05:00 +0000</pubDate><atom:updated>2013-12-18T10:11:53.546-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interview</category><title>Jquery</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q1. What is jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: jQuery is&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;fast, lightweight and feature-rich&amp;nbsp;&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;client side JavaScript Library/Framework which helps in to traverse HTML DOM, make animations, add Ajax interaction, manipulate the page content, change the style and provide cool UI effect. It is one of the most popular client side library and as per a survey it runs on every second website.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q2. Why do we use jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Due to following advantages.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Easy to use and learn.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Easily expandable.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Cross-browser support (IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+)&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Easy to use for DOM manipulation and traversal.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Large pool of built in methods.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;AJAX Capabilities.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Methods for changing or applying CSS, creating animations.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Event detection and handling.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Tons of plug-ins for all kind of needs.&lt;/li&gt;
&lt;/ul&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q3. How JavaScript and jQuery are different?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: JavaScript is a language While jQuery is a library built in the JavaScript language that helps to use the JavaScript language.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q4. Is jQuery replacement of Java Script?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;No.&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;jQuery is not a replacement of JavaScript. jQuery is a different library which is written on top of JavaScript. jQuery is a lightweight JavaScript library that emphasizes interaction between JavaScript and HTML.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q5. Is jQuery a library for client scripting or server scripting?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans. Client side scripting.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q6. Is jQuery a W3C standard?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: No. jQuery is not a W3C standard.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q7. What is the basic need to start with jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: To start with jQuery, one need to make reference of it&#39;s library. The latest version of jQuery can be downloaded from&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://jquery.com/&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;jQuery.com&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q8. Which is the starting point of code execution in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The starting point of jQuery code execution is $(document).ready() function which is executed when DOM is loaded.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q9. What does dollar sign ($) means in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Dollar Sign is nothing but it&#39;s an alias for JQuery. Take a look at below jQuery code.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain0&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre0&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
});
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Over here $ sign can be replaced with &quot;jQuery&quot; keyword.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain1&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;img height=&quot;9&quot; id=&quot;preimg1&quot; preid=&quot;1&quot; src=&quot;http://www.codeproject.com/images/minus.gif&quot; style=&quot;border: 0px; cursor: pointer; height: auto; margin: 0px; max-width: 100%; overflow: auto; padding: 0px;&quot; width=&quot;9&quot; /&gt;&lt;span id=&quot;precollapse1&quot; preid=&quot;1&quot; style=&quot;border: 0px; cursor: pointer; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;Collapse&lt;/span&gt;&lt;span style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&amp;nbsp;|&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.codeproject.com/Articles/618484/Latest-jQuery-interview-questions-and-answers#&quot; preid=&quot;1&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;Copy Code&lt;/a&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre1&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;jQuery(document).ready(function(){
});
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q10. Can we have multiple document.ready() function on the same page?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;YES&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;. We can have any number of document.ready() function on the same page.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q11. Can we use our own specific character in the place of $ sign in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;Yes.&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;It is possible using jQuery.noConflict().&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q12. Is it possible to use other client side libraries like MooTools, Prototype along with jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;Yes.&lt;/strong&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q13. What is jQuery.noConflict?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: As other client side libraries like MooTools, Prototype can be used with jQuery and they also use $() as their global function and to define variables. This situation creates conflict as&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;is used by jQuery and other library as their global function. To overcome from such situations, jQuery has introduced&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;jQuery.noConflict()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain2&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre2&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;jQuery.noConflict();
&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Use jQuery via jQuery(...)
&lt;/span&gt;jQuery(document).ready(function(){
   jQuery(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;div&quot;&lt;/span&gt;).hide();
});  &lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;You can also use your own specific character in the place of $ sign in jQuery.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain3&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre3&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;var $j = jQuery.noConflict();
&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; Use jQuery via jQuery(...)
&lt;/span&gt;$j(document).ready(function(){
   $j(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;div&quot;&lt;/span&gt;).hide();
});  
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q14. Is there any difference between body onload() and document.ready() function?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;document.ready()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;function is different from body&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;onload()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;function for 2 reasons.&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;We can have more than one&amp;nbsp;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;document.ready()&lt;/code&gt;&amp;nbsp;function in a page where we can have only one body&amp;nbsp;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;onload&lt;/code&gt;function.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;document.ready()&lt;/code&gt;&amp;nbsp;function is called as soon as DOM is loaded where&amp;nbsp;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;body.onload()&lt;/code&gt;&amp;nbsp;function is called when everything gets loaded on the page that includes DOM, images and all associated resources of the page.&lt;/li&gt;
&lt;/ol&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q15. What is the difference between .js and .min.js?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: jQuery library comes in 2 different versions Production and Deployment. The deployment version is also known as minified version. So .min.js is basically the minified version of jQuery library file. Both the files are same as far as functionality is concerned. but .min.js is quite small in size so it loads quickly and saves bandwidth.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q16. Why there are two different version of jQuery library?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: jQuery library comes in 2 different versions.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Production&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Deployment&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;The production version is quite useful at development time as jQuery is open source and if you want to change something then you can make those changes in production version. But the deployment version is minified version or compressed version so it is impossible to make changes in it. Because it is compressed, so its size is very less than the production version which affects the page load time.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q17. What is a CDN?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: A content delivery network or content distribution network (CDN) is a large distributed system of servers deployed in multiple data centers across the Internet. The goal of a CDN is to serve content to end-users with high availability and high performance.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q18. Which are the popular jQuery CDN? and what is the advantage of using CDN?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: There are 3 popular jQuery CDNs.&lt;/span&gt;&lt;br /&gt;
&lt;ol style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;1. Google.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;2. Microsoft&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;3. jQuery.&lt;/li&gt;
&lt;/ol&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Advantage of using CDN.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;It reduces the load from your server.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;It saves bandwidth. jQuery framework will load faster from these CDN.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;The most important benefit is it will be cached, if the user has visited any site which is using jQuery framework from any of these CDN&lt;/li&gt;
&lt;/ul&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q19. How to load jQuery from CDN?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Below is the code to load jQuery from all 3 CDNs.&lt;/span&gt;&lt;br /&gt;
&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;Code to load jQuery Framework from Google CDN&lt;/strong&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain4&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre4&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&quot;&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;Code to load jQuery Framework from Microsoft CDN&lt;/strong&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain5&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre5&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&quot;&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;http://ajax.microsoft.com/ajax/jquery/jquery-1.9.1.min.js&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;Code to load jQuery Framework from jQuery Site(EdgeCast CDN)&lt;/strong&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain6&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre6&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&quot;&lt;/span&gt;
    &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;http://code.jquery.com/jquery-1.9.1.min.js&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q20. How to load jQuery locally when CDN fails?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: It is a good approach to always use CDN but sometimes what if the CDN is down (rare possibility though) but you never know in this world as anything can happen.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Below given jQuery code checks whether jQuery is loaded from Google CDN or not, if not then it references the jQuery.js file from your folder.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain7&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre7&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; (&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;typeof&lt;/span&gt; jQuery == &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;undefined&#39;&lt;/span&gt;)
{
  document.write(unescape(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;%3Cscript src=&#39;Scripts/jquery.1.9.1.min.js&#39; type=&#39;text/javascript&#39;%3E%3C/script%3E&quot;&lt;/span&gt;));
}
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;It first loads the jQuery from Google CDN and then check the jQuery object. If jQuery is not loaded successfully then it will references the jQuery.js file from hard drive location. In this example, the jQuery.js is loaded from Scripts folder.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q21. What are selectors in jQuery and how many types of selectors are there?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: To work with an element on the web page, first we need to find them. To find the html element in jQuery we use selectors. There are many types of selectors but basic selectors are:&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Name: Selects all elements which match with the given element Name.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;#ID: Selects a single element which matches with the given ID&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;.Class: Selects all elements which match with the given Class.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Universal (*): Selects all elements available in a DOM.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Multiple Elements E, F, G: Selects the combined results of all the specified selectors E, F or G.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;Attribute Selector: Select elements based on its attribute value.&lt;/li&gt;
&lt;/ul&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q22. How do you select element by ID in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: To select element use ID selector. We need to prefix the id with &quot;#&quot; (hash symbol). For example, to select element with ID &quot;txtName&quot;, then syntax would be,&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain8&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre8&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#txtName&#39;&lt;/span&gt;)
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q23. What does $(&quot;div&quot;) will select?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: This will select all the div elements on page.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q24. How to select element having a particular class (&quot;.selected&quot;)?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$(&#39;.selected&#39;)&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;. This selector is known as class selector. We need to prefix the class name with &quot;.&quot; (dot).&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q25. What does $(&quot;div.parent&quot;) will select?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: All the div element with parent class.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q26. What are the fastest selectors in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: ID and element selectors are the fastest selectors in jQuery.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q27. What are the slow selectors in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: class selectors are the slow compare to ID and element.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q28. How jQuery selectors are executed?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Your last selectors is always executed first. For example, in below jQuery code, jQuery will first find all the elements with class &quot;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.myCssClass&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot; and after that it will reject all the other elements which are not in &quot;p#elmID&quot;.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain9&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre9&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;p#elmID .myCssClass&quot;&lt;/span&gt;);
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q29. Which is fast document.getElementByID(&#39;txtName&#39;) or $(&#39;#txtName&#39;).?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Native JavaScipt is always fast. jQuery method to select txtName &quot;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$(&#39;#txtName&#39;)&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot; will internally makes a call to&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;document.getElementByID(&#39;txtName&#39;)&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;. As jQuery is written on top of JavaScript and it internally uses JavaScript only So JavaScript is always fast.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q30. Difference between $(this) and &#39;this&#39; in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: this and&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$(this)&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;refers to the same element. The only difference is the way they are used. &#39;this&#39; is used in traditional sense, when &#39;this&#39; is wrapped in&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;then it becomes a jQuery object and you are able to use the power of jQuery.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain10&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre10&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
    $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#spnValue&#39;&lt;/span&gt;).mouseover(function(){
       alert($(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;).text());
  });
});&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;In below example, this is an object but since it is not wrapped in&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;, we can&#39;t use jQuery method and use the native JavaScript to get the value of span element.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain11&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre11&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
    $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#spnValue&#39;&lt;/span&gt;).mouseover(function(){
       alert(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;.innerText);
  });
});&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q31. How do you check if an element is empty?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: There are 2 ways to check if element is empty or not. We can check using &quot;:empty&quot; selector.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain12&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre12&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; ($(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#element&#39;&lt;/span&gt;).is(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;:empty&#39;&lt;/span&gt;)){
       &lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;Element is empty
&lt;/span&gt;  }
});  &lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;And the second way is using the &quot;$.trim()&quot; method.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain13&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre13&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt;($.trim($(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#element&#39;&lt;/span&gt;).html())==&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;) {
       &lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;Element is empty
&lt;/span&gt;  }
});  &lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q32. How do you check if an element exists or not in jQuery?&amp;nbsp;&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using jQuery length property, we can ensure whether element exists or not.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain14&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre14&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
    &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;if&lt;/span&gt; ($(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#element&#39;&lt;/span&gt;).length &amp;gt; &lt;span class=&quot;code-digit&quot; style=&quot;border: 0px; color: navy; margin: 0px; padding: 0px;&quot;&gt;0&lt;/span&gt;){
       &lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;Element exists
&lt;/span&gt;  });
});&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q33. What is the use of jquery .each() function?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.each()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;function is used to iterate over a jQuery object. The&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.each()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;function can be used to iterate over any collection, whether it is an object or an array.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q34. What is the difference between jquery.size() and jquery.length?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: jQuery&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.size()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method returns number of element in the object. But it is not preferred to use the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;size()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;method as jQuery provide&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.length&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;property and which does the same thing. But the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.length&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;property is preferred because it does not have the overhead of a function call.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q35. What is the difference between $(&#39;div&#39;) and $(&#39;&lt;div&gt;
&#39;) in jQuery?&lt;/div&gt;
&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: $(&#39;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&#39;) : This creates a new div element. However this is not added to DOM tree unless you don&#39;t append it to any DOM element.&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;$(&#39;div&#39;) : This selects all the div element present on the page.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q36. What is the difference between parent() and parents() methods in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The basic difference is the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;parent()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;function travels only one level in the DOM tree, where parents() function search through the whole DOM tree.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q37. What is the difference between eq() and get() methods in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;eq()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;returns the element as a jQuery object. This method constructs a new jQuery object from one element within that set and returns it. That means that you can use jQuery functions on it.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;get()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;return a DOM element. The method retrieve the DOM elements matched by the jQuery object. But as it is a DOM element and it is not a jQuery-wrapped object. So jQuery functions can&#39;t be used. Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2013/04/jquery-difference-between-eq-and-get-method.html&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q38. How do you implement animation functionality?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The .animate() method allows us to create animation effects on any numeric CSS property. This method changes an element from one state to another with CSS styles. The CSS property value is changed gradually, to create an animated effect.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Syntax is:&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain15&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre15&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;(selector).animate({styles},speed,easing,callback)&lt;/pre&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;styles: Specifies one or more CSS properties/values to animate.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;duration: Optional. Specifies the speed of the animation.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;easing: Optional. Specifies the speed of the element in different points of the animation. Default value is &quot;swing&quot;.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;callback: Optional. A function to be executed after the animation completes.&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Simple use of animate function is,&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain16&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre16&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;btnClick&quot;&lt;/span&gt;).click(function(){
  $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvBox&quot;&lt;/span&gt;).animate({height:&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;100px&quot;&lt;/span&gt;});
});
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q39. How to disable jQuery animation?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using jQuery property &quot;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;jQuery.fx.off&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot;, which when set to true, disables all the jQuery animation. When this is done, all animation methods will immediately set elements to their final state when called, rather than displaying an effect.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q40. How do you stop the currently-running animation?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using jQuery &quot;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.stop()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot; method.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q41. What is the difference between .empty(), .remove() and .detach() methods in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: All these methods&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.empty()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;,&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.remove()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.detach()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;are used for removing elements from DOM but they all are different.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.empty()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: This method removes all the child element of the matched element where remove() method removes set of matched elements from DOM.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.remove()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: Use&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.remove()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;when you want to remove the element itself, as well as everything inside it. In addition to the elements themselves, all bound events and jQuery data associated with the elements are removed.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.detach()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: This method is the same as&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.remove()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;, except that&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.detach()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;keeps all jQuery data associated with the removed elements. This method is useful when removed elements are to be reinserted into the DOM at a later time.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2012/05/empty-vs-remove-vs-detach-jquery.html&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q42. Explain .bind() vs .live() vs .delegate() vs .on()&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: All these 4 jQuery methods are used for attaching events to selectors or elements. But they all are different from each other.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2010/06/jquery-bind-function-exampledemo.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;.bind()&lt;/a&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: This is the easiest and quick method to bind events. But the issue with bind() is that it doesn&#39;t work for elements added dynamically that matches the same selector.&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;bind()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;only attach events to the current elements not future element. Above that it also has performance issues when dealing with a large selection.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2010/06/jquery-live-function-exampledemo.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;.live()&lt;/a&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: This method overcomes the disadvantage of&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;bind()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;. It works for dynamically added elements or future elements. Because of its poor performance on large pages, this method is deprecated as of jQuery 1.7 and you should stop using it. Chaining is not properly supported using this method.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2010/08/jquery-delegate-function-exampledemo.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;.delegate()&lt;/a&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: The .delegate() method behaves in a similar fashion to the .live() method, but instead of attaching the selector/event information to the document, you can choose where it is anchored and it also supports chaining.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.on()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: Since live was deprecated with 1.7, so new method was introduced named &quot;.on()&quot;. This method provides all the goodness of previous 3 methods and it brings uniformity for attaching event handlers.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.elijahmanor.com/2012/02/differences-between-jquery-bind-vs-live.html&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q43. What is wrong with this code line &quot;$(&#39;#myid.3&#39;).text(&#39;blah blah!!!&#39;);&quot;&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The problem with above statement is that the selectors is having meta characters and to use any of the meta-characters ( such as !&quot;#$%&amp;amp;&#39;()*+,./:;&amp;lt;=&amp;gt;?@[\]^`{|}~ ) as a literal part of a name, it must be escaped with with two backslashes: \\. For example, an element with id=&quot;foo.bar&quot;, can use the selector $(&quot;#foo\\.bar&quot;).&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;So the correct syntax is,&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain17&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre17&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#myid\\.3&#39;&lt;/span&gt;).text(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;blah blah!!!&#39;&lt;/span&gt;);
&lt;/pre&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q44. How to create clone of any object using jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: jQuery provides&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;clone()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method which performs a deep copy of the set of matched elements, meaning that it copies the matched elements as well as all of their descendant elements and text nodes.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain18&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre18&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
  $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#btnClone&#39;&lt;/span&gt;).click(function(){
     $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvText&#39;&lt;/span&gt;).clone().appendTo(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;body&#39;&lt;/span&gt;);
     &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;false&lt;/span&gt;;
  });
});
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q45. Does events are also copied when you clone any element in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: As explained in previous question, using&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;clone()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method, we can create clone of any element but the default implementation of the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;clone()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method doesn&#39;t copy events unless you tell the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;clone()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method to copy the events. The&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;clone()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method takes a parameter, if you pass true then it will copy the events as well.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain19&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre19&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function(){
   $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#btnClone&quot;&lt;/span&gt;).bind(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;click&#39;&lt;/span&gt;, function(){
     $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvClickme&#39;&lt;/span&gt;).clone(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;).appendTo(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;body&#39;&lt;/span&gt;);
  });
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;​&lt;/span&gt;&lt;br /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q46. What is difference between prop and attr?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;attr()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: Get the value of an attribute for the first element in the set of matched elements. Whereas,&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.prop()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: (Introduced in jQuery 1.6) Get the value of a property for the first element in the set of matched elements.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Attributes carry additional information about an HTML element and come in name=&quot;value&quot; pairs. Where Property is a representation of an attribute in the HTML DOM tree. once the browser parse your HTML code ,corresponding DOM node will be created which is an object thus having properties.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;attr()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;gives you the value of element as it was defines in the html on page load. It is always recommended to use&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;prop()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;to get values of elements which is modified via javascript/jquery , as it gives you the original value of an element&#39;s current state. Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://techbrij.com/jquery-attr-vs-prop-difference&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;here&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q47. What is event.PreventDefault?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;event.preventDefault()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method stops the default action of an element from happening. For example, Prevents a link from following the URL.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q48. What is the difference between event.PreventDefault and event.stopPropagation?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;event.preventDefault()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: Stops the default action of an element from happening.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;event.stopPropagation()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;: Prevents the event from bubbling up the DOM tree, preventing any parent handlers from being notified of the event. For example, if there is a link with a click method attached inside of a DIV or FORM that also has a click method attached, it will prevent the DIV or FORM click method from firing.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q49. What is the difference between event.PreventDefault and &quot;return false&quot;?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;e.preventDefault()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;will prevent the default event from occurring,&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;e.stopPropagation()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;will prevent the event from bubbling up and return false will do both.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q50. What is the difference between event.stopPropagation and event.stopImmediatePropagation?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans:&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;event.stopPropagation()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;allows other handlers on the same element to be executed, while&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;event.stopImmediatePropagation()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;prevents every event from running. For example, see below jQuery code block.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain20&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre20&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;p&quot;&lt;/span&gt;).click(function(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;event&lt;/span&gt;){
  &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;event&lt;/span&gt;.stopImmediatePropagation();
});
$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;p&quot;&lt;/span&gt;).click(function(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;event&lt;/span&gt;){
  &lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt; This function won&#39;t be executed
&lt;/span&gt;  $(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;this&lt;/span&gt;).css(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;background-color&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#f00&quot;&lt;/span&gt;);
}); 
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;If&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;event.stopPropagation&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;was used in previous example, then the next click event on p element which changes the css will fire, but in case&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;event.stopImmediatePropagation()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;, the next p click event will not fire.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q51. How to check if number is numeric while using jQuery 1.7+?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using &quot;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2011/11/jqueryisnumeric-in-jquery-17.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;isNumeric()&lt;/a&gt;&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot; function which was introduced with jQuery 1.7.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q52. How to check data type of any variable in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.in/2012/04/common-utility-methods-of-jquery.html&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;$.type(Object)&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;which returns the built-in JavaScript type for the object.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q53. How do you attach a event to element which should be executed only once?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using jQuery&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;one()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method. This attaches a handler to an event for the element. The handler is executed at most once per element. In simple terms, the attached function will be called only once.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain21&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre21&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(document).ready(function() {
    $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#btnDummy&quot;&lt;/span&gt;).one(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;click&quot;&lt;/span&gt;, function() {
        alert(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;This will be displayed only once.&quot;&lt;/span&gt;);
    });
});​
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q54. Can you include multiple version of jQuery? If yes, then how they are executed?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Yes. Multiple versions of jQuery can be included in same page.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q55. In what situation you would use multiple version of jQuery and how would you include them?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Well, it is quite possible that the jQuery plugins which are used are dependent on older version but for your own jQuery code, you would like to use newer version. So because of this dependency, multiple version of jQuery may required sometimes on single page.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Below code shows how to include multiple version of jQuery.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain22&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre22&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&#39;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;js/jquery_1.9.1.min.js&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
 &lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;var&lt;/span&gt; $jq = jQuery.noConflict();
&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;

&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&#39;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;js/jquery_1.7.2.min.js&#39;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;By this way, for your own jQuery code use &quot;$jq&quot;, instead of &quot;$&quot; as &quot;$jq&quot; refers to jQuery 1.9.1, where &quot;$&quot; refers to 1.7.2.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q56. Is it possible to hold or delay document.ready execution for sometime?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Yes, its possible. With Release of jQuery 1.6, a new method &quot;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;jQuery.holdReady(hold)&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot; was introduced. This method allows to delay the execution of&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;document.ready()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;event.&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;document.ready()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;event is called as soon as your DOM is ready but sometimes there is a situation when you want to load additional JavaScript or some plugins which you have referenced.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain23&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre23&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;​
$.holdReady(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;true&lt;/span&gt;);
$.getScript(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;myplugin.js&quot;&lt;/span&gt;, function() {
     $.holdReady(&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;false&lt;/span&gt;);
});
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q57. What is chaining in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Chaining is one of the most powerful feature of jQuery. In jQuery, Chaining means to connect multiple functions, events on selectors. It makes your code short and easy to manage and it gives better performance. The chain starts from left to right. So left most will be called first and so on.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain24&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre24&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;​$(document).ready(function(){
    $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvContent&#39;&lt;/span&gt;).addClass(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;dummy&#39;&lt;/span&gt;);
    $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvContent&#39;&lt;/span&gt;).css(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;color&#39;&lt;/span&gt;, &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;red&#39;&lt;/span&gt;);
    $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvContent&#39;&lt;/span&gt;).fadeIn(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;slow&#39;&lt;/span&gt;);
});​&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;The above jQuery code sample can be re-written using chaining. See below.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain25&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre25&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;​$(document).ready(function(){
    $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvContent&#39;&lt;/span&gt;).addClass(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;dummy&#39;&lt;/span&gt;)
          .css(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;color&#39;&lt;/span&gt;, &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;red&#39;&lt;/span&gt;)
          .fadeIn(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&#39;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;slow&#39;&lt;/span&gt;);     
});​&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Not only functions or methods, chaining also works with events in jQuery. Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2012/06/what-is-chaining-in-jquery.html&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q58. How does caching helps and how to use caching in jQuery?&amp;nbsp;&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Caching is an area which can give you awesome performance, if used properly and at the right place. While using jQuery, you should also think about caching. For example, if you are using any element in jQuery more than one time, then you must cache it. See below code.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain26&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre26&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#myID&quot;&lt;/span&gt;).css(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;color&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;red&quot;&lt;/span&gt;);
&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;Doing some other stuff......
&lt;/span&gt;$(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#myID&quot;&lt;/span&gt;).text(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;Error occurred!&quot;&lt;/span&gt;);
​&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Now in above jQuery code, the element with&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;#myID&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;is used twice but without caching. So both the times jQuery had to traverse through DOM and get the element. But if you have saved this in a variable then you just need to reference the variable. So the better way would be,&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain27&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre27&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;var $myElement = $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#myID&quot;&lt;/span&gt;).css(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;color&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;red&quot;&lt;/span&gt;);
&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;//&lt;/span&gt;&lt;span class=&quot;code-comment&quot; style=&quot;border: 0px; color: green; font-style: italic; margin: 0px; padding: 0px;&quot;&gt;Doing some other stuff......
&lt;/span&gt;$myElement.text(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;Error occurred!&quot;&lt;/span&gt;);
​&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;So now in this case, jQuery won&#39;t need to traverse through the whole DOM tree when it is used second time. So in jQuery, Caching is like saving the jQuery selector in a variable. And using the variable reference when required instead of searching through DOM again.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q59. You get &quot;jquery is not defined&quot; or &quot;$ is not defined&quot; error. What could be the reason?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: There could be many reasons for this.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;You have forgot to include the reference of jQuery library and trying to access jQuery.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;You have include the reference of the jQuery file, but it is after your jQuery code.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;The order of the scripts is not correct. For example, if you are using any jQuery plugin and you have placed the reference of the plugin js before the jQuery library then you will face this error.&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Find out more&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2013/01/jquery-is-not-defined-error-reasons.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q60. How to write browser specific code using jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using jQuery.browser property, we can write browser specific code. This property contains flags for the useragent, read from navigator.userAgent. This property was removed in jQuery 1.9.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q61. Can we use jQuery to make ajax request?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Yes. jQuery can be used for making ajax request.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q62. What are various methods to make ajax request in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Using below jQuery methods, you can make ajax calls.&lt;/span&gt;&lt;br /&gt;
&lt;ul style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 10px 0px; padding: 0px 0px 0px 40px;&quot;&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;load()&lt;/code&gt;&amp;nbsp;: Load a piece of html into a container DOM&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.getJSON()&lt;/code&gt;: Load JSON with GET method.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.getScript()&lt;/code&gt;: Load a JavaScript file.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.get()&lt;/code&gt;: Use to make a GET call and play extensively with the response.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.post()&lt;/code&gt;: Use to make a POST call and don&#39;t want to load the response to some container DOM.&lt;/li&gt;
&lt;li style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;&lt;code style=&quot;border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.ajax()&lt;/code&gt;: Use this to do something on XHR failures, or to specify ajax options (e.g. cache: true) on the fly.&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://net.tutsplus.com/tutorials/javascript-ajax/5-ways-to-make-ajax-calls-with-jquery/&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q63. Is there any advantage of using $.ajax() for ajax call against $.get() or $.post()?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: By using jQuery&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;post()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;/ jQuery&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;get()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;, you always trust the response from the server and you believe it is going to be successful all the time. Well, it is certainly not a good idea to trust the response. As there can be n number of reason which may lead to failure of response.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Where&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;jQuery.ajax()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;is jQuery&#39;s low-level AJAX implementation.&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.get&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;and&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;$.post&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;are higher-level abstractions that are often easier to understand and use, but don&#39;t offer as much functionality (such as error callbacks). Find out more&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2011/11/avoid-jquerypost-use-jqueryajax.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q64. What are deferred and promise object in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Deferred and promise are part of jQuery since version 1.5 and they help in handling asynchronous functions like Ajax. Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://www.bitstorm.org/weblog/2012-1/Deferred_and_promise_in_jQuery.html&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q65. Can we execute/run multiple Ajax request simultaneously in jQuery? If yes, then how?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Yes, it is possible to execute multiple Ajax request simultaneously or in parallel. Instead of waiting for first ajax request to complete and then issue the second request is time consuming. The better approach to speed up things would be to execute multiple ajax request simultaneously.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Using jQuery&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.when()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method which provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. Find out more&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2013/05/jquery-execute-multiple-ajax-request-simultaneously-in-parallel.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q66. Can you call C# code-behind method using jQuery? If yes,then how?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Yes. We can call C# code-behind function via $.ajax. But for do that it is compulsory to mark the method as WebMethod.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q67. Which is the latest version of jQuery library?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The latest version (when this post is written) of jQuery is 1.10.2 or 2.0.3. jQuery 2.x has the same API as jQuery 1.x, but does not support Internet Explorer 6, 7, or 8.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q68. Does jQuery 2.0 supports IE?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: No. jQuery 2.0 has no support for IE 6, IE 7 and IE 8.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q69. What are source maps in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: In case of jQuery, Source Map is nothing but mapping of minified version of jQuery against the un-minified version. Source map allows to debug minified version of jQuery library. Source map feature was release with jQuery 1.9. Find out more&amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: white; border: 0px; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px;&quot;&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2013/01/all-you-need-to-know-about-jquery-source-maps.html&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;here&lt;/a&gt;&lt;/strong&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q70. How to use migrate jQuery plugin?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: with release of 1.9 version of jQuery, many deprecated methods were discarded and they are no longer available. But there are many sites in production which are still using these deprecated features and it&#39;s not possible to replace them overnight. So jQuery team provided with jQuery Migrate plugin that makes code written prior to 1.9 work with it.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;So to use old/deprecated features, all you need to do is to provide reference of jQuery Migrate Plugin. Find out more&lt;/span&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2013/01/migrate-older-jquery-code-to-jquery1-9.html&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q71. Is it possible to get value of multiple CSS properties in single statement?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Well, before jQuery 1.9 release it was not possible but one of the new feature of jQuery 1.9 was&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.css()&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;multi-property getter.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain28&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre28&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;var propCollection = $(&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#dvBox&quot;&lt;/span&gt;).css([ &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;width&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;height&quot;&lt;/span&gt;, &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;backgroundColor&quot;&lt;/span&gt; ]);
&lt;/pre&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;In this case, the&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;propCollection&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;will be an array and it will look something like this.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain29&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre29&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;{ 
  width: &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;100px&quot;&lt;/span&gt;, 
  height: &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;200px&quot;&lt;/span&gt;, 
  backgroundColor: &lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;code-string&quot; style=&quot;border: 0px; color: purple; margin: 0px; padding: 0px;&quot;&gt;#FF00FF&quot;&lt;/span&gt; 
}
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q72. How do you stop the currently-running animation, remove all queued animations, and complete all animations for the matched elements?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: It can be done via calling&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background-color: white; border: 0px; color: #990000; font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 11pt; margin: 0px; padding: 0px;&quot;&gt;.stop([clearQueue ] [, jumpToEnd ])&lt;/code&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&amp;nbsp;method and by passing both the parameters as true.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q73. What is finish method in jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The .finish() method stops all queued animations and places the element(s) in their final state. This method was introduced in jQuery 1.9.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q74. What is the difference between calling stop(true,true) and finish method?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: The .finish() method is similar to .stop(true, true) in that it clears the queue and the current animation jumps to its end value. It differs, however, in that .finish() also causes the CSS property of all queued animations to jump to their end values, as well.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q75. Consider a scenario where things can be done easily with javascript, would you still prefer jQuery?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: No. If things can be done easily via CSS or JavaScript then You should not think about jQuery. Remember, jQuery library always comes with xx kilobyte size and there is no point of wasting bandwidth.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q76. Can we use protocol less URL while referencing jQuery from CDNs?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: Yes. Below code is completely valid.&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;pre-action-link&quot; id=&quot;premain30&quot; style=&quot;background-color: white; border-bottom-color: rgb(204, 204, 204); border-bottom-style: solid; border-width: 0px 0px 1px; color: #005782; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 11px; margin: 0px; padding: 0px; text-align: right;&quot; width=&quot;100%&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class=&quot;brush:javascript&quot; id=&quot;pre30&quot; style=&quot;background-color: #fbedbb; border: 1px solid rgb(251, 237, 187); font-family: Consolas, &#39;Courier New&#39;, Courier, mono; font-size: 9pt; overflow: auto; padding: 6px; white-space: pre-wrap; word-wrap: break-word;&quot;&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;type&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;text/javascript&quot;&lt;/span&gt; &lt;span class=&quot;code-attribute&quot; style=&quot;border: 0px; color: red; margin: 0px; padding: 0px;&quot;&gt;src&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;=&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js&quot;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span class=&quot;code-leadattribute&quot; style=&quot;border: 0px; color: maroon; margin: 0px; padding: 0px;&quot;&gt;script&lt;/span&gt;&lt;span class=&quot;code-keyword&quot; style=&quot;border: 0px; color: blue; margin: 0px; padding: 0px;&quot;&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q77. What is the advantage of using protocol less URL while referencing jQuery from CDNs?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: It is quite useful when you are moving from HTTP to HTTPS url. You need to make sure that correct protocol is used for referencing jQuery library as pages served via SSL should contain no references to content served through unencrypted connections.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;&quot;protocol-less&quot; URL is the best way to reference third party content that’s available via both HTTP and HTTPS. When a URL’s protocol is omitted, the browser uses the underlying document’s protocol instead. Find out more&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://jquerybyexample.blogspot.com/2013/06/use-protocol-less-url-referencing-jquery.html&quot; style=&quot;background-color: white; border: 0px; color: purple; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px; margin: 0px; padding: 0px; text-decoration: none;&quot;&gt;&lt;strong style=&quot;border: 0px; margin: 0px; padding: 0px;&quot;&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q78. What is jQuery plugin and what is the advantage of using plugin?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: A plug-in is piece of code written in a standard JavaScript file. These files provide useful jQuery methods which can be used along with jQuery library methods. jQuery plugins are quite useful as its piece of code which is already written by someone and re-usable, which saves your development time.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q79. What is jQuery UI?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library that can be used to build interactive web applications.&lt;/span&gt;&lt;br /&gt;
&lt;br style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot; /&gt;
&lt;h3 style=&quot;background-color: white; color: #666666; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 18px; font-weight: normal;&quot;&gt;
Q80. What is the difference between jQuery and jQuery UI?&lt;/h3&gt;
&lt;span style=&quot;background-color: white; color: #111111; font-family: &#39;Segoe UI&#39;, Arial, sans-serif; font-size: 14px;&quot;&gt;Ans: jQuery is the core library. jQueryUI is built on top of it. If you use jQueryUI, you must also include jQuery.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2013/12/jquery.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-2531145480348029211</guid><pubDate>Tue, 23 Jul 2013 09:26:00 +0000</pubDate><atom:updated>2013-12-18T10:13:45.324-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>Node JS</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;
About&lt;/h2&gt;
The aim of this document is to get you started with developing
            applications with Node.js, teaching you everything you need to
            know about &quot;advanced&quot; JavaScript along the way. It goes way
            beyond your typical &quot;Hello World&quot; tutorial.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;status&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Status&lt;/h3&gt;
You are reading the final version of this book, i.e., updates
            are only done to correct errors or to reflect changes in new
            versions of Node.js. It was last updated on July 1, 2013.
        &lt;br /&gt;
The code samples in this book are tested to work with Node.js
            version 0.10.12.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;intended-audience&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Intended audience&lt;/h3&gt;
This document will probably fit best for readers that have a
            background similar to my own: experienced with at least one
            object-oriented language like Ruby, Python, PHP or Java, only little
            experience with JavaScript, and completely new to Node.js.
        &lt;br /&gt;
Aiming at developers that already have experience with other
            programming languages means that this document won&#39;t cover
            really basic stuff like data types, variables, control structures
            and the likes. You already need to know about these to understand
            this document.
        &lt;br /&gt;
However, because functions and objects in JavaScript are different
            from their counterparts in most other languages, these will be
            explained in more detail.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;structure&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Structure of this document&lt;/h3&gt;
Upon finishing this document, you will have created a complete web
            application which allows the users of this application to view web
            pages and upload files.
        &lt;br /&gt;
Which, of course, is not exactly
            world-changing, but we will go some extra miles and not only create
            the code that is &quot;just enough&quot; to make these use cases possible,
            but create a simple, yet complete framework to cleanly separate the
            different aspects of our application. You will see what I mean in a
            minute.
        &lt;br /&gt;
We will start with looking at how JavaScript development in Node.js
            is different from JavaScript development in a browser.
        &lt;br /&gt;
Next, we will stay with the good old tradition of writing a &quot;Hello
            World&quot; application, which is a most basic Node.js application that
            &quot;does&quot; something.
        &lt;br /&gt;
Then, we will discuss what kind of &quot;real&quot; application we want to
            build, dissect the different parts which need to be implemented to
            assemble this application, and start working on each of these parts
            step-by-step.
        &lt;br /&gt;
As promised, along the way we will learn about some of the more
            advanced concepts of JavaScript, how to make use of them, and
            look at why it makes sense to use these concepts instead of
            those we know from other programming languages.
        &lt;br /&gt;
The source code of the finished application is available through
            &lt;a href=&quot;https://github.com/ManuelKiessling/NodeBeginnerBook/tree/master/code/application&quot;&gt;the
                NodeBeginnerBook Github repository&lt;/a&gt;.
        &lt;br /&gt;
&lt;div id=&quot;table-of-contents-headline&quot;&gt;
Table of contents&lt;/div&gt;
&lt;div id=&quot;table-of-contents&quot;&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#about&quot;&gt;About&lt;/a&gt;
                    &lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#status&quot;&gt;Status&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#intended-audience&quot;&gt;Intended audience&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#structure&quot;&gt;Structure of this document&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#javascript-and-nodejs&quot;&gt;JavaScript and Node.js&lt;/a&gt;
                    &lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#javascript-and-you&quot;&gt;JavaScript and You&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#a-word-of-warning&quot;&gt;A word of warning&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#server-side-javascript&quot;&gt;Server-side JavaScript&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#hello-world&quot;&gt;&quot;Hello World&quot;&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#a-full-blown-web-application-with-nodejs&quot;&gt;A full blown web application with Node.js&lt;/a&gt;
                    &lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#the-use-cases&quot;&gt;The use cases&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#the-application-stack&quot;&gt;The application stack&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#building-the-application-stack&quot;&gt;Building the application stack&lt;/a&gt;
                    &lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#a-basic-http-server&quot;&gt;A basic HTTP server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#analyzing-our-http-server&quot;&gt;Analyzing our HTTP server&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#passing-functions-around&quot;&gt;Passing functions around&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#how-function-passing-makes-our-http-server-work&quot;&gt;How function passing makes our
                            HTTP server work&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#event-driven-callbacks&quot;&gt;Event-driven asynchronous callbacks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#how-our-server-handles-requests&quot;&gt;How our server handles requests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#finding-a-place-for-our-server-module&quot;&gt;Finding a place for our server module&lt;/a&gt;
                        &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#whats-needed-to-route-requests&quot;&gt;What&#39;s needed to &quot;route&quot; requests?&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#execution-in-the-kongdom-of-verbs&quot;&gt;Execution in the kingdom of verbs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#routing-to-real-request-handlers&quot;&gt;Routing to real request handlers&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#making-the-request-handlers-respond&quot;&gt;Making the request handlers respond&lt;/a&gt;
                            &lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#how-to-not-do-it&quot;&gt;How to not do it&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#blocking-and-non-blocking&quot;&gt;Blocking and non-blocking&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#responding-request-handlers-with-non-blocking-operations&quot;&gt;Responding
                                    request handlers with non-blocking operations&lt;/a&gt;
                                &lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#serving-something-useful&quot;&gt;Serving something useful&lt;/a&gt;
                            &lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#handling-post-requests&quot;&gt;Handling POST requests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#handling-file-uploads&quot;&gt;Handling file uploads&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://www.nodebeginner.org/#conclusion-and-outlook&quot;&gt;Conclusion and outlook&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;javascript-and-nodejs&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h2&gt;
JavaScript and Node.js&lt;/h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;javascript-and-you&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
JavaScript and You&lt;/h3&gt;
Before we talk about all the technical stuff, let&#39;s take a
            moment and talk about you and your relationship with
            JavaScript. This chapter is here to allow you to estimate
            if reading this document any further makes sense for you.
        &lt;br /&gt;
If you are like me, you started with HTML &quot;development&quot;
            long ago, by writing HTML documents. You came along this
            funny thing called JavaScript, but you only used it in a
            very basic way, adding interactivity to your web pages
            every now and then.
        &lt;br /&gt;
What you really wanted was &quot;the real thing&quot;, you wanted to
            know how to build complex web sites - you learned a
            programming language like PHP, Ruby, Java, and started
            writing &quot;backend&quot; code.
        &lt;br /&gt;
Nevertheless, you kept an eye on JavaScript, you saw that
            with the introduction of jQuery, Prototype and the likes,
            things got more advanced in JavaScript land, and that this
            language really was about more than &lt;em&gt;window.open()&lt;/em&gt;.
        &lt;br /&gt;
However, this was all still frontend stuff, and although it
            was nice to have jQuery at your disposal whenever you felt
            like spicing up a web page, at the end of the day you were,
            at best, a JavaScript &lt;em&gt;user&lt;/em&gt;, but not a JavaScript
            &lt;em&gt;developer&lt;/em&gt;.
        &lt;br /&gt;
And then came Node.js. JavaScript on the server, how cool
            is that?
        &lt;br /&gt;
You decided that it&#39;s about time to check out the old, new
            JavaScript. But wait, writing Node.js applications is the
            one thing; understanding why they need to be written the
            way they are written means - understanding JavaScript.
            And this time for real.
        &lt;br /&gt;
Here is the problem: Because JavaScript really lives two,
            maybe even three lives (the funny little DHTML helper from
            the mid-90&#39;s, the more serious frontend stuff like jQuery
            and the likes, and now server-side), it&#39;s not that easy to
            find information that helps you to learn JavaScript the
            &quot;right&quot; way, in order to write Node.js applications in a
            fashion that makes you feel you are not just using
            JavaScript, you are actually developing it.
        &lt;br /&gt;
Because that&#39;s the catch: you already are an experienced
            developer, you don&#39;t want to learn a new technique by just
            hacking around and mis-using it; you want to be sure that
            you are approaching it from the right angle.
        &lt;br /&gt;
There is, of course, excellent documentation out there.
            But documentation alone sometimes isn&#39;t enough. What is
            needed is guidance.
        &lt;br /&gt;
My goal is to provide a guide for you.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;a-word-of-warning&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
A word of warning&lt;/h3&gt;
There are some really excellent JavaScript people out
            there. I&#39;m not one of them.
        &lt;br /&gt;
I&#39;m really just the guy I talked about in the previous
            paragraph. I know a thing or two about developing backend
            web applications, but I&#39;m still new to &quot;real&quot; JavaScript
            and still new to Node.js. I learned some of the more
            advanced aspects of JavaScript just recently.
            I&#39;m not experienced.
        &lt;br /&gt;
Which is why this is no &quot;from novice to expert&quot; book. It&#39;s
            more like &quot;from novice to advanced novice&quot;.
        &lt;br /&gt;
If I don&#39;t fail, then this will be the kind of
            document I wish I had when starting with Node.js.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;server-side-javascript&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Server-side JavaScript&lt;/h3&gt;
The first incarnations of JavaScript lived in browsers.
            But this is just the context. It defines what you can
            do with the language, but it doesn&#39;t say much about what
            the language itself can do. JavaScript is a &quot;complete&quot;
            language: you can use it in many contexts and achieve
            everything with it you can achieve with any other
            &quot;complete&quot; language.
        &lt;br /&gt;
Node.js really is just another context: it allows you to run
            JavaScript code in the backend, outside a browser.
        &lt;br /&gt;
In order to execute the JavaScript you intend to run in the
            backend, it needs to be interpreted and, well, executed.
            This is what Node.js does, by making use of Google&#39;s V8 VM, the
            same runtime environment for JavaScript that Google
            Chrome uses.
        &lt;br /&gt;
Plus, Node.js ships with a lot of useful modules, so you don&#39;t
            have to write everything from scratch, like for example
            something that outputs a string on the console.
        &lt;br /&gt;
Thus, Node.js is really two things: a runtime environment and a
            library.
        &lt;br /&gt;
In order to make use of these, you need to install Node.js.
            Instead of repeating the process here, I kindly ask you to
            visit
            &lt;a href=&quot;https://github.com/joyent/node/wiki/Installation&quot; title=&quot;Building and Installing Node.js&quot;&gt;the
                official
                installation instructions&lt;/a&gt;. Please come back once you
            are up and running.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;hello-world&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
&quot;Hello World&quot;&lt;/h3&gt;
Ok, let&#39;s just jump in the cold water and write our first
            Node.js application: &quot;Hello World&quot;.
        &lt;br /&gt;
Open your favorite editor and create a file called
            &lt;em&gt;helloworld.js&lt;/em&gt;. We want it to write &quot;Hello World&quot;
            to STDOUT, and here is the code needed to do that:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;pln&quot;&gt;console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
Save the file, and execute it through Node.js:
        &lt;br /&gt;
&lt;pre&gt;node helloworld.js&lt;/pre&gt;
This should output &lt;em&gt;Hello World&lt;/em&gt; on your terminal.
        &lt;br /&gt;
Ok, this stuff is boring, right? Let&#39;s write some real
            stuff.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;a-full-blown-web-application-with-nodejs&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h2&gt;
A full blown web application with Node.js&lt;/h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;the-use-cases&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
The use cases&lt;/h3&gt;
Let&#39;s keep it simple, but realistic:
        &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;
                The user should be able to use our application with
                a web browser
            &lt;/li&gt;
&lt;li&gt;
                The user should see a welcome page when
                requesting http://&lt;em&gt;domain&lt;/em&gt;/start which displays a
                file upload form
            &lt;/li&gt;
&lt;li&gt;
                By choosing an image file to upload and submitting the
                form, this image should then be uploaded to
                http://&lt;em&gt;domain&lt;/em&gt;/upload, where it is displayed once
                the upload is finished
            &lt;/li&gt;
&lt;/ul&gt;
Fair enough. Now, you could achieve this goal by googling
            and hacking together &lt;em&gt;something&lt;/em&gt;. But that&#39;s not
            what we want to do here.
        &lt;br /&gt;
Furthermore, we don&#39;t want to write only the most basic
            code to achieve the goal, however elegant and correct this code
            might be. We will intentionally add more abstraction than
            necessary in order to get a feeling for building more
            complex Node.js applications.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;the-application-stack&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
The application stack&lt;/h3&gt;
Let&#39;s dissect our application. Which parts need to be
            implemented in order to fulfill the use cases?
        &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;
                We want to serve web pages, therefore we need an
                &lt;strong&gt;HTTP server&lt;/strong&gt;
            &lt;/li&gt;
&lt;li&gt;
                Our server will need to answer differently to
                requests, depending on which URL the request was
                asking for, thus we need some kind of
                &lt;strong&gt;router&lt;/strong&gt; in order to map requests
                to request handlers
            &lt;/li&gt;
&lt;li&gt;
                To fullfill the requests that arrived at the server
                and have been routed using the router, we need
                actual &lt;strong&gt;request handlers&lt;/strong&gt;
            &lt;/li&gt;
&lt;li&gt;

                The router probably should also treat any incoming
                POST data and give it to the request handlers in
                a convenient form, thus we need &lt;strong&gt;request
                data handling&lt;/strong&gt;
            &lt;/li&gt;
&lt;li&gt;
                We not only want to handle requests for URLs, we
                also want to display content when these URLs are
                requested, which means we need some kind of
                &lt;strong&gt;view logic&lt;/strong&gt; the request handlers
                can use in order to send content to the user&#39;s
                browser
            &lt;/li&gt;
&lt;li&gt;
                Last but not least, the user will be able to upload
                images, so we are going to need some kind of
                &lt;strong&gt;upload handling&lt;/strong&gt; which takes care of
                the details
            &lt;/li&gt;
&lt;/ul&gt;
Let&#39;s think a moment about how we would build this stack
            with PHP. It&#39;s not exactly a secret that the typical setup
            would be an Apache HTTP server with mod_php5 installed.
            &lt;br /&gt;
Which in turn means that the whole &quot;we need to be able to
            serve web pages and receive HTTP requests&quot; stuff doesn&#39;t
            happen within PHP itself.
        &lt;br /&gt;
Well, with node, things are a bit different. Because with
            Node.js, we not only implement our application, we also
            implement the whole HTTP server. In fact, our web
            application and its web server are basically the same.
        &lt;br /&gt;
This might sound like a lot of work, but we will see in a
            moment that with Node.js, it&#39;s not.
        &lt;br /&gt;
Let&#39;s just start at the beginning and implement the first
            part of our stack, the HTTP server.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;building-the-application-stack&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h2&gt;
Building the application stack&lt;/h2&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;a-basic-http-server&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
A basic HTTP server&lt;/h3&gt;
When I arrived at the point where I wanted to start with my
            first &quot;real&quot; Node.js application, I wondered not only how to
            actually code it, but also how to organize my code.
            &lt;br /&gt;
Do I need to have everything in one file? Most tutorials on
            the web that teach you how to write a basic HTTP server in
            Node.js have all the logic in one place. What if I want to
            make sure that my code stays readable the more stuff I
            implement?
        &lt;br /&gt;
Turns out, it&#39;s relatively easy to keep the different
            concerns of your code separated, by putting them in
            modules.
        &lt;br /&gt;
This allows you to have a clean main file, which you
            execute with Node.js, and clean modules that can be used by
            the main file and among each other.
        &lt;br /&gt;
So, let&#39;s create a main file which we use to start our
            application, and a module file where our HTTP server code
            lives.
        &lt;br /&gt;
My impression is that it&#39;s more or less a standard to name
            your main file &lt;em&gt;index.js&lt;/em&gt;. It makes sense to put our
            server module into a file named &lt;em&gt;server.js&lt;/em&gt;.
        &lt;br /&gt;
Let&#39;s start with the server module. Create the file
            &lt;em&gt;server.js&lt;/em&gt; in the root directory of your project,
            and fill it with the following code:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
That&#39;s it! You just wrote a working HTTP server. Let&#39;s
            prove it by running and testing it. First, execute your
            script with Node.js:
        &lt;br /&gt;
&lt;pre&gt;node server.js&lt;/pre&gt;
Now, open your browser and point it at
            &lt;a href=&quot;http://localhost:8888/&quot; rel=&quot;nofollow&quot;&gt;http://localhost:8888/&lt;/a&gt;.
            This should display a web page that says &quot;Hello World&quot;.
        &lt;br /&gt;
That&#39;s quite interesting, isn&#39;t it. How about talking about
            what&#39;s going on here and leaving the question of how to
            organize our project for later? I promise we&#39;ll get back to
            it.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;analyzing-our-http-server&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Analyzing our HTTP server&lt;/h3&gt;
Well, then, let&#39;s analyze what&#39;s actually going on here.
        &lt;br /&gt;
The first line &lt;em&gt;require&lt;/em&gt;s the &lt;em&gt;http&lt;/em&gt; module
            that ships with Node.js and makes it accessible through the
            variable &lt;em&gt;http&lt;/em&gt;.
        &lt;br /&gt;
We then call one of the functions the http module offers:
            &lt;em&gt;createServer&lt;/em&gt;. This function returns an object, and
            this object has a method named &lt;em&gt;listen&lt;/em&gt;, and takes
            a numeric value which indicates the port number our HTTP
            server is going to listen on.
        &lt;br /&gt;
Please ignore for a second the function definition that
            follows the opening bracket of &lt;em&gt;http.createServer&lt;/em&gt;.
        &lt;br /&gt;
We could have written the code that starts our server and
            makes it listen at port 8888 like this:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; server &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
server&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
That would start an HTTP server listening at port 8888
            and doing nothing else (not even answering any incoming
            requests).
        &lt;br /&gt;
The really interesting (and, if your background is a more
            conservative language like PHP, odd looking) part is the
            function definition right there where you would expect the
            first parameter of the &lt;em&gt;createServer()&lt;/em&gt; call.
        &lt;br /&gt;
Turns out, this function definition IS the first (and only)
            parameter we are giving to the &lt;em&gt;createServer()&lt;/em&gt;

            call. Because in JavaScript, functions can be passed around
            like any other value.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;passing-functions-around&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Passing functions around&lt;/h3&gt;
You can, for example, do something like this:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; say&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; execute&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;someFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; someFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

execute&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;say&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
Read this carefully! What we are doing here is, we pass the
            function &lt;em&gt;say&lt;/em&gt; as the first parameter to the
            &lt;em&gt;execute&lt;/em&gt; function. Not the return value of
            &lt;em&gt;say&lt;/em&gt;, but &lt;em&gt;say&lt;/em&gt; itself!
        &lt;br /&gt;
Thus, &lt;em&gt;say&lt;/em&gt; becomes the local variable
            &lt;em&gt;someFunction&lt;/em&gt; within &lt;em&gt;execute&lt;/em&gt;, and execute
            can call the function in this variable by issuing
            &lt;em&gt;someFunction()&lt;/em&gt; (adding brackets).
        &lt;br /&gt;
Of course, because &lt;em&gt;say&lt;/em&gt; takes one parameter,
            &lt;em&gt;execute&lt;/em&gt; can pass such a parameter when calling
            &lt;em&gt;someFunction&lt;/em&gt;.
        &lt;br /&gt;
We can, as we just did, pass a function as a parameter to
            another function by its name. But we don&#39;t have to take this
            indirection of first defining, then passing it - we can
            define and pass a function as a parameter to another
            function in-place:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; execute&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;someFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; someFunction&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;value&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

execute&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;word&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;},&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
We define the function we want to pass to &lt;em&gt;execute&lt;/em&gt;
            right there at the place where &lt;em&gt;execute&lt;/em&gt; expects its
            first parameter.
        &lt;br /&gt;
This way, we don&#39;t even need to give the function a name,
            which is why this is called an &lt;em&gt;anonymous function&lt;/em&gt;.
        &lt;br /&gt;
This is a first glimpse at what I like to call &quot;advanced&quot;
            JavaScript, but let&#39;s take it step by step. For now, let&#39;s
            just accept that in JavaScript, we can pass a function as
            a parameter when calling another function. We can do this
            by assigning our function to a variable, which we then
            pass, or by defining the function to pass in-place.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;how-function-passing-makes-our-http-server-work&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
How function passing makes our HTTP server work&lt;/h3&gt;
With this knowledge, let&#39;s get back to our minimalistic
            HTTP server:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
By now it should be clear what we are actually doing here:
            we pass the &lt;em&gt;createServer&lt;/em&gt; function an anonymous
            function.
        &lt;br /&gt;
We could achieve the same by refactoring our code to:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
Maybe now is a good moment to ask: Why are we doing it
            that way?
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;event-driven-callbacks&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Event-driven asynchronous callbacks&lt;/h3&gt;
To understand why Node.js applications have to be written this way,
            we need to understand how Node.js executes our code. Node&#39;s
            approach isn&#39;t unique, but the underlying execution model is
            different from runtime environments like Python, Ruby, PHP or Java.
        &lt;br /&gt;
Let&#39;s take a very simple piece of code like this:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;var result = database.query(&quot;SELECT * FROM hugetable&quot;);
console.log(&quot;Hello World&quot;);&lt;/pre&gt;
Please ignore for now that we haven&#39;t actually talked about
            connecting to databases before - it&#39;s just an example. The
            first line queries a database for lots of rows, the second
            line puts &quot;Hello World&quot; to the console.
        &lt;br /&gt;
Let&#39;s assume that the database query is really slow, that it has
            to read an awful lot of rows, which takes several seconds.
        &lt;br /&gt;
The way we have written this code, the JavaScript interpreter of
            Node.js first has to read the complete result set from the
            database, and then it can execute the &lt;em&gt;console.log()&lt;/em&gt;
            function.
        &lt;br /&gt;
If this piece of code actually was, say, PHP, it would work the
            same way: read all the results at once, then execute the next line
            of code. If this code would be part of a web page script, the user
            would have to wait several seconds for the page to load.
        &lt;br /&gt;
However, in the execution model of PHP, this would not become a
            &quot;global&quot; problem: the web server starts its own PHP process for
            every HTTP request it receives. If one of these requests results
            in the execution of a slow piece of code, it results in a slow
            page load for this particular user, but other users requesting
            other pages would not be affected.
        &lt;br /&gt;
The execution model of Node.js is different - there is only one
            single process. If there is a slow database query somewhere in
            this process, this affects the whole process - everything comes
            to a halt until the slow query has finished.
        &lt;br /&gt;
To avoid this, JavaScript, and therefore Node.js, introduces the
            concept of event-driven, asynchronous callbacks, by utilizing an
            event loop.
        &lt;br /&gt;
We can understand this concept by analyzing a rewritten version
            of our problematic code:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;database.query(&quot;SELECT * FROM hugetable&quot;, function(rows) {
  var result = rows;
});
console.log(&quot;Hello World&quot;);&lt;/pre&gt;
Here, instead of expecting &lt;em&gt;database.query()&lt;/em&gt; to directly
            return a result to us, we pass it a second parameter, an anonymous
            function.
        &lt;br /&gt;
In its previous form, our code was synchronous: &lt;em&gt;first&lt;/em&gt;
            do the database query, and only when this is done, &lt;em&gt;then&lt;/em&gt;
            write to the console.
        &lt;br /&gt;
Now, Node.js can handle the database request asynchronously.
            Provided that &lt;em&gt;database.query()&lt;/em&gt; is part of an asynchronous
            library, this is what Node.js does: just as before, it takes the
            query and sends it to the database. But instead of waiting for it
            to be finished, it makes a mental note that says &quot;When at some
            point in the future the database server is done and sends the
            result of the query, then I have to execute the anonymous function
            that was passed to &lt;em&gt;database.query()&lt;/em&gt;.&quot;
        &lt;br /&gt;
Then, it immediately executes &lt;em&gt;console.log()&lt;/em&gt;, and
            afterwards, it enters the event loop. Node.js continuously cycles
            through this loop again and again whenever there is nothing else
            to do, waiting for events. Events like, e.g., a slow database
            query finally delivering its results.
        &lt;br /&gt;
This also explains why our HTTP server needs a function it can
            call upon incoming requests - if Node.js would start the server
            and then just pause, waiting for the next request, continuing
            only when it arrives, that would be highly inefficent. If a second
            user requests the server while it is still serving the first
            request, that second request could only be answered after the first
            one is done - as soon as you have more than a handful of HTTP
            requests per second, this wouldn&#39;t work at all.
        &lt;br /&gt;
It&#39;s important to note that this asynchronous, single-threaded,
            event-driven execution model isn&#39;t an infinitely scalable
            performance unicorn with silver bullets attached. It is just one
            of several models, and it has its limitations, one being that as
            of now, Node.js is just one single process, and it can run on only
            one single CPU core. Personally, I find this model quite
            approachable, because it allows to write applications that have to
            deal with concurrency in an efficient and relatively
            straightforward manner.
        &lt;br /&gt;
You might want to take the time to read Felix
            Geisendörfer&#39;s excellent post
            &lt;a href=&quot;http://debuggable.com/posts/understanding-node-js:4bd98440-45e4-4a9a-8ef7-0f7ecbdd56cb&quot;&gt;Understanding
                node.js&lt;/a&gt;
            for additional background explanation.
        &lt;br /&gt;
Let&#39;s play around a bit with this new concept. Can we prove
            that our code continues after creating the server, even if
            no HTTP request happened and the callback function we
            passed isn&#39;t called? Let&#39;s try it:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Request received.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Server has started.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
Note that I use &lt;em&gt;console.log&lt;/em&gt; to output a text whenever
            the &lt;em&gt;onRequest&lt;/em&gt; function (our callback) is triggered,
            and another text right &lt;em&gt;after&lt;/em&gt; starting the HTTP server.
        &lt;br /&gt;
When we start this (&lt;em&gt;node server.js&lt;/em&gt;, as always), it
            will immediately output &quot;Server has started.&quot; on the
            command line. Whenever we request our server (by opening
            &lt;a href=&quot;http://localhost:8888/&quot; rel=&quot;nofollow&quot;&gt;http://localhost:8888/&lt;/a&gt;

            in our browser), the message &quot;Request received.&quot; is printed
            on the command line.
        &lt;br /&gt;
Event-driven asynchronous server-side JavaScript with
            callbacks in action :-)
        &lt;br /&gt;
(Note that our server will probably write &quot;Request received.&quot;
            to STDOUT two times upon opening the page in a browser. That&#39;s
            because most browsers will try to load the favicon by requesting
            http://localhost:8888/favicon.ico whenever you open
            http://localhost:8888/).
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;how-our-server-handles-requests&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
How our server handles requests&lt;/h3&gt;
Ok, let&#39;s quickly analyze the rest of our server code, that
            is, the body of our callback function &lt;em&gt;onRequest()&lt;/em&gt;.
        &lt;br /&gt;
When the callback fires and our &lt;em&gt;onRequest()&lt;/em&gt; function
            gets triggered, two parameters are passed into it:
            &lt;em&gt;request&lt;/em&gt; and &lt;em&gt;response&lt;/em&gt;.
        &lt;br /&gt;
Those are objects, and you can use their methods to handle
            the details of the HTTP request that occured and to respond
            to the request (i.e., to actually send something over
            the wire back to the browser that requested your server).
        &lt;br /&gt;
And our code does just that: Whenever a request is
            received, it uses the &lt;em&gt;response.writeHead()&lt;/em&gt;
            function to send an HTTP status 200 and content-type in the
            HTTP response header, and the &lt;em&gt;response.write()&lt;/em&gt;
            function to send the text &quot;Hello World&quot; in the HTTP
            response body.
        &lt;br /&gt;
At last, we call &lt;em&gt;response.end()&lt;/em&gt; to actually finish
            our response.
        &lt;br /&gt;
At this point, we don&#39;t care for the details of the
            request, which is why we don&#39;t use the &lt;em&gt;request&lt;/em&gt;
            object at all.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;finding-a-place-for-our-server-module&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Finding a place for our server module&lt;/h3&gt;
Ok, I promised we will get back to how to organize our
            application. We have the code for a very basic HTTP server in
            the file &lt;em&gt;server.js&lt;/em&gt;, and I mentioned that it&#39;s common
            to have a main file called &lt;em&gt;index.js&lt;/em&gt; which is used
            to bootstrap and start our application by making use of the
            other modules of the application (like the HTTP server module
            that lives in &lt;em&gt;server.js&lt;/em&gt;).
        &lt;br /&gt;
Let&#39;s talk about how to make server.js a real Node.js module
            that can be used by our yet-to-be-written &lt;em&gt;index.js&lt;/em&gt;
            main file.
        &lt;br /&gt;
As you may have noticed, we already used modules in our code,
            like this:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(...);&lt;/span&gt;&lt;/pre&gt;
Somewhere within Node.js lives a module called &quot;http&quot;, and we can
            make use of it in our own code by requiring it and assigning
            the result of the require to a local variable.
        &lt;br /&gt;
This makes our local variable an object that carries all the
            public methods the &lt;em&gt;http&lt;/em&gt; module provides.
        &lt;br /&gt;
It&#39;s common practice to choose the name of the module for the
            name of the local variable, but we are free to choose whatever
            we like:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; foo &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;...&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

foo&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(...);&lt;/span&gt;&lt;/pre&gt;
Fine, it&#39;s clear how to make use of internal Node.js modules. How
            do we create our own modules, and how do we use them?
        &lt;br /&gt;
Let&#39;s find out by turning our &lt;em&gt;server.js&lt;/em&gt; script into a
            real module.
        &lt;br /&gt;
Turns out, we don&#39;t have to change that much. Making some code
            a module means we need to &lt;em&gt;export&lt;/em&gt; those parts of its
            functionality that we want to provide to scripts that require
            our module.
        &lt;br /&gt;
For now, the functionality our HTTP server needs to export is
            simple: scripts requiring our server module simply need to
            start the server.
        &lt;br /&gt;
To make this possible, we will put our server code into a
            function named &lt;em&gt;start&lt;/em&gt;, and we will export this
            function:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Request received.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Server has started.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

exports&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;start &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
This way, we can now create our main file &lt;em&gt;index.js&lt;/em&gt;,
            and start our HTTP there, although the code for the server is
            still in our &lt;em&gt;server.js&lt;/em&gt; file.
        &lt;br /&gt;
Create a file &lt;em&gt;index.js&lt;/em&gt; with the following content:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; server &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;./server&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

server&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;/pre&gt;
As you can see, we can use our server module just like any
            internal module: by requiring its file and assigning it to
            a variable, its exported functions become available to us.
        &lt;br /&gt;
That&#39;s it. We can now start our app via our main script, and it
            still does exactly the same:
        &lt;br /&gt;
&lt;pre&gt;node index.js&lt;/pre&gt;
Great, we now can put the different parts of our application
            into different files and wire them together by making them
            modules.
        &lt;br /&gt;
We still have only the very first part of our application in
            place: we can receive HTTP requests. But we need to do
            something with them - depending on which URL the browser
            requested from our server, we need to react differently.
        &lt;br /&gt;
For a very simple application, you could do this directly
            within the callback function &lt;em&gt;onRequest()&lt;/em&gt;. But as I said,
            let&#39;s add a bit more abstraction in order to make our example
            application a bit more interesting.
        &lt;br /&gt;
Making different HTTP requests point at different parts of our
            code is called &quot;routing&quot; - well, then, let&#39;s create a module
            called &lt;em&gt;router&lt;/em&gt;.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;whats-needed-to-route-requests&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
What&#39;s needed to &quot;route&quot; requests?&lt;/h3&gt;
We need to be able to feed the requested URL and possible
            additional GET and POST parameters into our router, and based
            on these the router then needs to be able to decide which code
            to execute (this &quot;code to execute&quot; is the third part of our
            application: a collection of request handlers that do the
            actual work when a request is received).
        &lt;br /&gt;
So, we need to look into the HTTP requests and extract the
            requested URL as well as the GET/POST parameters from them.
            It could be argued if that should be part of the router or
            part of the server (or even a module of its own), but let&#39;s
            just agree on making it part of our HTTP server for now.
        &lt;br /&gt;
All the information we need is available through the
            &lt;em&gt;request&lt;/em&gt; object which is passed as the first parameter
            to our callback function &lt;em&gt;onRequest()&lt;/em&gt;. But to interpret
            this information, we need some additional Node.js modules, namely
            &lt;em&gt;url&lt;/em&gt; and &lt;em&gt;querystring&lt;/em&gt;.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;head20&quot;&gt;&lt;/a&gt;
        
            The &lt;em&gt;url&lt;/em&gt; module provides methods which allow us to
            extract the different parts of a URL (like e.g. the requested
            path and query string), and &lt;em&gt;querystring&lt;/em&gt; can in turn be
            used to parse the query string for request parameters:
        &lt;br /&gt;
&lt;pre&gt;                               url.parse(string).query
                                           |
           url.parse(string).pathname      |
                       |                   |
                       |                   |
                     ------ -------------------
http://localhost:8888/start?foo=bar&amp;amp;hello=world
                                ---       -----
                                 |          |
                                 |          |
              querystring(string)[&quot;foo&quot;]    |
                                            |
                         querystring(string)[&quot;hello&quot;]
&lt;/pre&gt;
We can, of course, also use &lt;em&gt;querystring&lt;/em&gt; to parse the
            body of a POST request for parameters, as we will see
            later.
        &lt;br /&gt;
Let&#39;s now add to our &lt;em&gt;onRequest()&lt;/em&gt; function the logic
            needed to find out which URL path the browser requested:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;url&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; pathname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pathname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Request for &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; pathname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; received.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Server has started.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

exports&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;start &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
Fine. Our application can now distinguish requests based on the
            URL path requested - this allows us to map requests to our
            request handlers based on the URL path using our (yet to be
            written) router.
        &lt;br /&gt;
In the context of our application, it simply means that we will
            be able to have requests for the &lt;em&gt;/start&lt;/em&gt; and
            &lt;em&gt;/upload&lt;/em&gt; URLs handled by different parts of our
            code. We will see how everything fits together soon.
        &lt;br /&gt;
Ok, it&#39;s time to actually write our router. Create a new file
            called &lt;em&gt;router.js&lt;/em&gt;, with the following content:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; route&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pathname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;About to route a request for &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; pathname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

exports&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;route &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; route&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
Of course, this code basically does nothing, but that&#39;s ok for
            now. Let&#39;s first see how to wire together this router with our
            server before putting more logic into the router.
        &lt;br /&gt;
Our HTTP server needs to know about and make use of our router.
            We could hard-wire this dependency into the server, but because
            we learned the hard way from our experience with other
            programming languages, we are going to loosely couple server
            and router by injecting this dependency (you may want to read
            &lt;a href=&quot;http://martinfowler.com/articles/injection.html&quot;&gt;Martin Fowlers excellent post on Dependency Injection&lt;/a&gt;
            for background information).
        &lt;br /&gt;
Let&#39;s first extend our server&#39;s &lt;em&gt;start()&lt;/em&gt; function in
            order to enable us to pass the route function to be used by
            parameter:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; http &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;http&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;url&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; pathname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;parse&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;request&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;url&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pathname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Request for &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; pathname &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;+&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot; received.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; route&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;pathname&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;writeHead&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;200&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;,&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;:&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;text/plain&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;});&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;write&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Hello World&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &amp;nbsp; response&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;end&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

&amp;nbsp; http&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;createServer&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;onRequest&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;).&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;listen&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;lit&quot;&gt;8888&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&amp;nbsp; console&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;log&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;Server has started.&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

exports&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;start &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
And let&#39;s extend our &lt;em&gt;index.js&lt;/em&gt; accordingly, that is,
            injecting the route function of our router into the server:
        &lt;br /&gt;
&lt;pre class=&quot;prettyprint lang-js&quot;&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; server &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;./server&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; router &lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt; require&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot;&gt;&quot;./router&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;

server&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;start&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;router&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;route&lt;/span&gt;&lt;span class=&quot;pun&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot;&gt;
&lt;/span&gt;&lt;/pre&gt;
Again, we are passing a function, which by now isn&#39;t any news
            for us.
        &lt;br /&gt;
If we start our application now (&lt;em&gt;node index.js,
            as always&lt;/em&gt;), and request an URL, you can now see from the
            application&#39;s output that our HTTP server makes use of our
            router and passes it the requested pathname:
        &lt;br /&gt;
&lt;pre&gt;bash$ node index.js
Request for /foo received.
About to route a request for /foo&lt;/pre&gt;
(I omitted the rather annoying output for the /favicon.ico
            request).
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;execution-in-the-kongdom-of-verbs&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Execution in the kingdom of verbs&lt;/h3&gt;
May I once again stray away for a while and talk about
            functional programming again?
        &lt;br /&gt;
Passing functions is not only a technical consideration.
            With regard to software design, it&#39;s almost philosophical.
            Just think about it: in our index file, we could have passed
            the &lt;em&gt;router&lt;/em&gt; object into the server, and the server
            could have called this object&#39;s &lt;em&gt;route&lt;/em&gt; function.
        &lt;br /&gt;
This way, we would have passed a &lt;em&gt;thing&lt;/em&gt;, and the server
            would have used this thing to &lt;em&gt;do&lt;/em&gt; something. Hey,
            router thing, could you please route this for me?
        &lt;br /&gt;
But the server doesn&#39;t need the thing. It only needs to get
            something &lt;em&gt;done&lt;/em&gt;, and to get something done, you don&#39;t
            need things at all, you need &lt;em&gt;actions&lt;/em&gt;. You don&#39;t need
            &lt;em&gt;nouns&lt;/em&gt;, you need &lt;em&gt;verbs&lt;/em&gt;.
        &lt;br /&gt;
Understanding the fundamental mind-shift that&#39;s at the core of
            this idea is what made me really understand functional
            programming.
        &lt;br /&gt;
And I did understand it when reading Steve Yegge&#39;s masterpiece
            &lt;a href=&quot;http://steve-yegge.blogspot.com/2006/03/execution-in-kingdom-of-nouns.html&quot;&gt;Execution in the Kingdom of Nouns&lt;/a&gt;.
            Go read it now, really. It&#39;s one of the best writings related
            to software I ever had the pleasure to encounter.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;routing-to-real-request-handlers&quot;&gt;&lt;/a&gt;

        &lt;br /&gt;
&lt;h3&gt;
Routing to real request handlers&lt;/h3&gt;
Back to business. Our HTTP server and our request router are
            now best friends and talk to each other as we intended.
        &lt;br /&gt;
Of course, that&#39;s not enough. &quot;Routing&quot; means, we want to
            handle requests to different URLs differently. We would like to
            have the &quot;business logic&quot; for requests to &lt;em&gt;/start&lt;/em&gt;
            handled in another function than requests to &lt;em&gt;/upload&lt;/em&gt;.
        &lt;br /&gt;
Right now, the routing &quot;ends&quot; in the router, and the router is
            not the place to actually &quot;do&quot; something with the requests,
            because that wouldn&#39;t scale well once our application becomes
            more complex.
        &lt;br /&gt;
&lt;a href=&quot;https://www.blogger.com/null&quot; name=&quot;continuereading&quot;&gt;&lt;/a&gt;
        
            Let&#39;s call these functions, where requests are routed to,
            &lt;em&gt;request handlers&lt;/em&gt;. And let&#39;s tackle those next, because
            unless we have these in place there isn&#39;t much sense in doing
            anything with the router for now.
        &lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2013/07/node-js.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>10</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-4404898385701219345</guid><pubDate>Mon, 10 Dec 2012 18:51:00 +0000</pubDate><atom:updated>2013-12-18T10:15:29.275-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>PHP OOPS</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The hardest thing to learn (and teach btw,) in object oriented PHP is the basics. But once you understand them, the rest will come much, much easier.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
But don&#39;t be discouraged! You just found the easiest to understand tutorial	out there on OOP and PHP. It may sound like a boastful claim, I know, but that&#39;s what the nerd zeitgeist is saying.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
… Or so I&#39;ve been told.&lt;/div&gt;
&lt;h2 style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, sans-serif; font-size: 1.384em; font-weight: normal; line-height: 1.3em; margin: 0px 0px 16px; padding: 16px 0px 0px; vertical-align: baseline;&quot;&gt;
About This Tutorial&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
This tutorial is designed to teach total beginners object oriented	PHP.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin: 0px; padding: 0px; text-align: center; vertical-align: baseline;&quot;&gt;
&lt;img alt=&quot;&quot; src=&quot;http://www.killerphp.com/ks-images/oop-php.png&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot; /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
This is not a long-winded theoretical blathering that you see all too often; instead, we actually start writing OO code very quickly. I believe that this &#39;hands-on&#39; style of learning, makes understanding OO (object oriented) PHP much easier... and less boring too!&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
So before you begin, get out your favorite PHP code editor and be ready	to write and run some object oriented PHP code.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
PS: scroll to the bottom of the page for the supporting videos.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Thanks for reading,&lt;br /&gt;
Stefan Mischook&lt;/div&gt;
&lt;h2 id=&quot;introduction&quot; style=&quot;background-color: white; border: 0px; clear: both; font-family: Arial, sans-serif; font-size: 1.384em; font-weight: normal; line-height: 1.3em; margin: 0px 0px 16px; padding: 16px 0px 0px; vertical-align: baseline;&quot;&gt;
Introduction&lt;/h2&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
With the release of php5 in 2004, php programmers finally had the power	to code with the &#39;big boys&#39;. Like Java and C#, php finally had a complete OOP infrastructure.&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
In this tutorial, you will be guided (step-by-step) through the	process of building and working with objects using php&#39;s built-in OOP capabilities. At the same time you will learn:&lt;/div&gt;
&lt;ul style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; list-style: none; margin: 0px; padding: 0px 0px 14px 20px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;The difference between building a php application the old fashioned (procedural) way, versus the OOP way.&lt;/li&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;What the basic OOP principles are, and how to use them in PHP.&lt;/li&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;When you would want to use OOP in your PHP scripts.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
People run into confusion when programming because of some lack of understanding	of the basics. The basics are really important!&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
With this in mind, we are going to slowly go over key OOP principles while creating our own PHP objects.&amp;nbsp; With this knowledge, you will be able to explore OOP further.&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style=&quot;border: 0px; clear: both; font-size: 1.384em; font-weight: normal; line-height: 1.3em; margin: 0px 0px 16px; padding: 16px 0px 0px; vertical-align: baseline;&quot;&gt;
Object Oriented PHP for Beginners: Steps 1 - 5&lt;/h2&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
For this tutorial, you should understand a few PHP basics: functions, variables, conditionals and loops.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
To make things easy, the tutorial is divided into 22 steps.&lt;/div&gt;
&lt;h3 id=&quot;step1&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 1:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
First thing we need to do is create two PHP pages:&lt;/div&gt;
&lt;ul style=&quot;border: 0px; list-style: none; margin: 0px; padding: 0px 0px 14px 20px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;index.php&lt;/li&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;class_lib.php&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
OOP is all about creating modular code, so our object oriented PHP code will be contained in dedicated files that we will then insert into our normal PHP page using php &#39;includes&#39;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
In this case, all our OO PHP code will be in the PHP file:&lt;/div&gt;
&lt;ul style=&quot;border: 0px; list-style: none; margin: 0px; padding: 0px 0px 14px 20px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;class_lib.php&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
OOP revolves around a construct called a &#39;class&#39;.&amp;nbsp; Classes are the cookie-cutters / templates that are used to define objects.&lt;/div&gt;
&lt;h3 id=&quot;step2&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 2:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Create a simple PHP class (in class_lib.php)&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Instead of having a bunch of functions, variables and code floating around willy-nilly, to design your php scripts or code libraries the OOP way, you&#39;ll need to define/create your own classes.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
You define your own class by starting with the keyword &#39;class&#39; followed by the name you want to give your new class.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp;You enclose a class using curly braces ( { } ) ... just like you do with functions .&lt;/div&gt;
&lt;h3 id=&quot;step3&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 3:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Add data to your class&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Classes are the blueprints for php objects - more on that later. One of the big differences between functions and classes is that a class contains both data (variables) and functions that form a package called an: &#39;object&#39;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you create a variable inside a class, it is called a &#39;property&#39;.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp;The data/variables inside a class (ex:&amp;nbsp;&lt;em style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var $name;&lt;/em&gt;) are called &#39;properties&#39;.&lt;/div&gt;
&lt;h3 id=&quot;step4&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 4:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Add functions/methods to your class&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
In the same way that variables get a different name when created inside a class (they are called: properties,) functions also referred to (by nerds) by a different name when created inside a class - they are called &#39;methods&#39;.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
A class&#39;s methods are used to manipulate its own data / properties.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp;Don&#39;t forget that in a class, variables are called &#39;properties&#39; and functions are called &#39;methods&#39;.&lt;/div&gt;
&lt;h3 id=&quot;step5&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 5:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Getter and setter functions&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
We&#39;ve created two interesting functions/methods: get_name() and set_name().&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
These methods follow a common OOP convention that you see in many languages (including Java and Ruby) - where you create methods to &#39;set&#39; and &#39;get&#39; properties in a class.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Another convention is that getter and setter names should match the property names.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp;Notice that the getter and setter names, match the associated property name.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
This way, when other PHP programmers want to use your objects, they will know that if you have a method/function called &#39;set_name()&#39;, there will be a property/variable called &#39;name&#39;.&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: white; border: 0px; font-family: Arial, sans-serif; font-size: 13px; line-height: 17px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;br /&gt;
&lt;h2 style=&quot;border: 0px; clear: both; font-size: 1.384em; font-weight: normal; line-height: 1.3em; margin: 0px 0px 16px; padding: 16px 0px 0px; vertical-align: baseline;&quot;&gt;
Object Oriented PHP for Beginners: Steps 6 - 11&lt;/h2&gt;
&lt;h3 id=&quot;step6&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 6:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The &#39;$this&#39; variable&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
You probably noticed this line of code:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The $this is a built-in variable (built into all objects) which points to the current object. Or in other words, $this is a special self-referencing variable. You use $this to access properties and to call other methods of the current class.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&amp;nbsp;&lt;/strong&gt;This may be a bit confusing for some of you … that&#39;s because you are seeing for the first time, one of those built in OO capabilities (built into PHP5 itself) that automatically does stuff for us.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
For now, just think of $this as a special OO PHP keyword. When PHP comes across $this, the PHP engine knows what to do.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
… Hopefully soon, you will too!&lt;/div&gt;
&lt;h3 id=&quot;step7&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/h3&gt;
&lt;h3 id=&quot;step7&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/h3&gt;
&lt;h3 id=&quot;step7&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/h3&gt;
&lt;h3 id=&quot;step7&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 7:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Use your class in your main PHP page. (index.php)&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
You would never create your PHP classes directly inside your main php pages - that would help defeat the purposes of object oriented PHP in the first place!&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Instead, it is always best practice to create separate php pages that only contain your classes. Then you would access your php objects/classes by including them in your main php pages with either a php &#39;include&#39; or &#39;require&#39;.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); font-weight: normal; margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;dec&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #660066; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;html span=&quot;span&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #660066; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;xmlns&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;http://www.w3.org/1999/xhtml&quot;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;head&gt;&lt;/head&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #660066; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;http-equiv&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Content-Type&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;atn&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #660066; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;content&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;atv&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;text/html;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; charset=iso-8859-1&quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;&quot;&gt;OOP in PHP&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 136); background-position: initial initial; background-repeat: initial initial;&quot;&gt;&lt;/title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/html&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&amp;nbsp;&lt;/strong&gt;Notice how we haven&#39;t done anything with our class yet. We will do that next.&lt;/div&gt;
&lt;h3 id=&quot;step8&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 8:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Instantiate/create your object&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Classes are the blueprints/templates of php objects. Classes don&#39;t actually become objects until you do something called: instantiation.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you instantiate a class, you create an instance of it ... thus creating the object.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
In other words, instantiation is the process of creating an&amp;nbsp;&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;instance&lt;/strong&gt;&amp;nbsp;of an object in memory. What memory? The server&#39;s memory of course!&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); font-weight: normal; margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&amp;nbsp;&amp;nbsp;&lt;/strong&gt;The variable $stefan becomes a handle/reference to our newly created person object. I call $stefan a &#39;handle&#39;, because we will use $stefan to control and use the person object.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you run the PHP code now, you will not see anything displayed on your pages. The reason for this, is because we have not told PHP to do anything with the object we just created …&amp;nbsp;&lt;/div&gt;
&lt;h4 id=&quot;step9&quot; style=&quot;border: 0px; font-size: 13px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 9:&lt;/h4&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The &#39;new&#39; keyword&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
To create an object out of a class, you need to use the &#39;new&#39; keyword. &amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
When creating/instantiating a class, you can optionally add brackets to the class name, as I did in the example below. To be clear, you can see in the code below how I can create multiple objects from the same class.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
… From the PHP&#39;s engine point of view, each object is its own entity.&amp;nbsp; Does that make sense?&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); font-weight: normal; margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $jimmy &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp; When creating an object, be sure not to quote the class name.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
For example:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); font-weight: normal; margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;person&#39;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
… will give you an error.&lt;/div&gt;
&lt;h3 id=&quot;step10&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 10:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Set an objects properties&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Now that we&#39;ve created/instantiated our two separate &#39;person&#39; objects, we can set their properties using the methods (the setters) we created.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Please keep in mind that though both our person objects ($stefan and $jimmy) are based on the same &#39;person&#39; class, as far as php is concerned, they are totally different objects.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); font-weight: normal; margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $jimmy &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Mischook&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $jimmy&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Nick Waddles&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;h3 id=&quot;step11&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 11:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Accessing an object&#39;s data&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Now we use the getter methods to access the data held in our objects … this is the same data we inserted into our objects using the setter methods.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
When accessing methods and properties of a class, you use the arrow&amp;nbsp; (-&amp;gt;) operator.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); font-weight: normal; margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$jimmy &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Mischook&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$jimmy&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Nick Waddles&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan&#39;s full name: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Nick&#39;s full name: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $jimmy&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp;The arrow operator (-&amp;gt;) is not the same operator used with associative arrays: =&amp;gt;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Congratulations&lt;/strong&gt;, you&#39;ve made it half way through the tutorial! Time to take a little break and have some tea … OK, maybe some beer.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
In a short period of time, you&#39;ve:&lt;/div&gt;
&lt;ul style=&quot;border: 0px; font-size: 13px; font-weight: normal; list-style: none; margin: 0px; padding: 0px 0px 14px 20px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;Designed a PHP class.&lt;/li&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;Generate/created a couple of objects based on your class.&lt;/li&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;Inserted data into your objects.&lt;/li&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;Retrieved data from your objects.&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Not bad for your first day on the OO PHP job.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
If you haven&#39;t already, now is a great time to write out the code and watch it in action in your own PHP pages.&lt;/div&gt;
&lt;div style=&quot;border: 0px; font-size: 13px; font-weight: normal; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;h3 id=&quot;step12&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 12:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Directly accessing properties - don&#39;t do it!&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
You don&#39;t have to use methods to access objects properties; you can directly get to them using the arrow operator (-&amp;gt;) and the name of the variable.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
For example: with the property $name (in object $stefan) you could get its value like so:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Though doable, it is considered bad practice to do it because it can lead to trouble down the road. You should use getter methods instead - more on that later.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $jimmy &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Mischook&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $jimmy&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Nick Waddles&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// directly accessing properties in a class is a no-no.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan&#39;s full name: &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;h3 id=&quot;step13&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 13:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Constructors&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
All objects can have a special built-in method called a &#39;constructor&#39;. Constructors allow you to initialise your object&#39;s properties (translation: give your properties values,) when you instantiate (create) an object.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp;If you create a __construct() function (it is your choice,) PHP will automatically call the __construct() method/function when you create an object from your class.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The &#39;construct&#39; method starts with two underscores (__) and the word &#39;construct&#39;.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
For the rest of this tutorial, I&#39;m going to stop reminding you that:&lt;/div&gt;
&lt;ul style=&quot;border: 0px; list-style: none; margin: 0px; padding: 0px 0px 14px 20px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;Functions = methods&lt;/li&gt;
&lt;li style=&quot;background-image: url(http://www.killerphp.com/ks-images/bullet-black.gif); background-position: 0% 6px; background-repeat: no-repeat no-repeat; border: 0px; margin: 0px 0px 1px; padding: 0px 0px 0px 12px; vertical-align: baseline;&quot;&gt;Variables = properties&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Since this is an OO PHP tutorial, I will now use the OO terminology.&lt;/div&gt;
&lt;h3 id=&quot;step14&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 14:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Create an object with a constructor&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Now that we&#39;ve created a constructor method, we can provide a value for the $name property when we create our person objects.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
You &#39;feed&#39; the constructor method by providing a list of arguments (like you do with a function) after the class name.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;For example:&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Mischook&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
This saves us from having to call the set_name() method reducing the amount of code. Constructors are common and are used often in PHP, Java etc.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Mischook&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan&#39;s full name: &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
This is just a tiny example of how the mechanisms built into OO PHP can save you time and reduce the amount of code you need to write. Less code means less bugs.&lt;/div&gt;
&lt;h3 id=&quot;step15&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 15:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Restricting access to properties using &#39; access modifiers &#39;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
One of the fundamental principles in OOP is &#39;encapsulation&#39;. The idea is that you create cleaner better code, if you restrict access to the data structures (properties) in your objects.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
You restrict access to class properties using something called &#39;access modifiers&#39;. There are 3 access modifiers:&lt;/div&gt;
&lt;ol style=&quot;border: 0px; list-style: none; margin: 0px; padding: 0px 0px 14px 32px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;private&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&#39;Public&#39; is the default modifier.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $social_insurance&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $pinn_number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&lt;/strong&gt;&amp;nbsp;When you declare a property with the &#39;var&#39; keyword, it is considered &#39;public&#39;.&lt;/div&gt;
&lt;h3 id=&quot;step16&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 16:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Restricting access to properties: part 2&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
When you declare a property as &#39;private&#39;, only the same class can access the property.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
When a property is declared &#39;protected&#39;, only the same class and classes derived from that class can access the property - this has to do with inheritance …more on that later.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Properties declared as &#39;public&#39; have no access restrictions, meaning anyone can access them.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
To help you understand this (probably) foggy aspect of OOP, try out the following code and watch how PHP reacts. Tip: read the comments in the code for more information:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Mischook&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan&#39;s full name: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;$stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;br /&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;/* &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Since $pinn_number was declared private, this line of code &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; will generate an error. Try it out! &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; */&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Tell me private stuff: &quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pinn_number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &lt;/span&gt;&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Note:&amp;nbsp;&lt;/strong&gt;If you try to access a private property/variable outside of the class, you will get this:&lt;/div&gt;
&lt;pre style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&#39;&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Fatal error&lt;/strong&gt;: Cannot access private property person::$pinn_number
in ...&#39; 
&lt;/pre&gt;
&lt;h3 id=&quot;step17&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 17:&lt;/h3&gt;
Restricting access to methods&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Like properties, you can control access to methods using one of the three access modifiers:&lt;/div&gt;
&lt;ol style=&quot;border: 0px; list-style: none; margin: 0px; padding: 0px 0px 14px 32px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;private&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Why do we have access modifiers?&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;In a nutshell:&lt;/strong&gt;&amp;nbsp;it comes down to control -it is makes sense to control how people use classes.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The reasons for access modifiers and other OO constructs, can be tricky to understand … especially since we are just beginners here. So give yourself a chance!&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
That said, we can (summarize and) say that many OOP constructs exist with idea the many programmers may be working together on a project.&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $height&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $social_insurance&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $pinn_number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;$this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; get_pinn_number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;pinn_number&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Notes:&lt;/strong&gt;&amp;nbsp;Since the method get_pinn_number() is &#39;private&#39;, the only place you can use this method is in the same class - typically in another method. If you wanted to call/use this method directly in your PHP pages, you would need to declare it &#39;public&#39;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
&lt;h3 id=&quot;step18&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 18:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Inheritance - reusing code the OOP way&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Inheritance is a fundamental capability/construct in OOP where you can use one class, as the base/basis for another class … or many other classes.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Why do it?&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Doing this allows you to efficiently reuse the code found in your base class.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Say, you wanted to create a new &#39;employee&#39; class … since we can say that &#39;employee&#39; is a type/kind of &#39;person&#39;, they will share common properties and methods.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
… Making some sense?&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
In this type of situation, inheritance can make your code lighter … because you are reusing the same code in two different classes. But unlike &#39;old-school&#39; PHP:&lt;/div&gt;
&lt;ol style=&quot;border: 0px; list-style: none; margin: 0px; padding: 0px 0px 14px 32px; vertical-align: baseline;&quot;&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;You only have to type the code out once.&lt;/li&gt;
&lt;li style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; list-style-type: decimal; margin: 0px 0px 1px; padding: 0px; vertical-align: baseline;&quot;&gt;The actual code being reused, can be reused in many (unlimited) classes but it is only typed out in one place … conceptually, this is sort-of like PHP includes().&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Take a look at the sample PHP code:&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// &#39;extends&#39; is the keyword that enables inheritance&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; employee &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$employee_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$employee_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h3 id=&quot;step19&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 19:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Reusing code with inheritance: part 2&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Because the class &#39;employee&#39; is based on the class &#39;person&#39;, &#39;employee&#39; automatically has all the public and protected properties and methods of &#39;person&#39;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Nerd note:&lt;/strong&gt;&amp;nbsp;Nerds would say that &#39;employee&#39; is a&amp;nbsp;&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;type&lt;/strong&gt;&amp;nbsp;of person.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The code:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; employee &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$employee_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;){&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$employee_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Notice how we are able to use set_name() in &#39;employee&#39;, even though we did not declare that method in the &#39;employee&#39; class. That&#39;s because we already created set_name() in the class &#39;person&#39;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Nerd Note:&lt;/strong&gt;&amp;nbsp;the &#39;person&#39; class is called (by nerds,) the &#39;base&#39; class or the &#39;parent&#39; class because it&#39;s the class that the &#39;employee&#39; is&amp;nbsp;&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;based&lt;/strong&gt;&amp;nbsp;on. This class hierarchy can become important down the road when your projects become more complex.&lt;/div&gt;
&lt;h3 id=&quot;step20&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 20:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Reusing code with inheritance: part 3&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
As you can see in the code snippet below, we can call get_name on our &#39;employee&#39; object, courtesy of &#39;person&#39;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The code:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent;&quot;&gt;OOP in PHP&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; background-color: transparent; color: rgb(0, 0, 136); background-position: initial initial; background-repeat: initial initial;&quot;&gt;&lt;/title&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php include&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;class_lib.php&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;body&gt;&lt;/body&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// Using our PHP objects in our PHP pages. &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $stefan &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Mischook&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan&#39;s full name: &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $stefan&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $james &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;new&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; employee&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Johnny Fingers&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; echo &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;---&amp;gt; &quot;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $james&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;();&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span class=&quot;tag&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
This is a classic example of how OOP can reduce the number of lines of code (don&#39;t have to write the same methods twice) while still keeping your code modular and much easier to maintain.&amp;nbsp;&lt;/div&gt;
&lt;h3 id=&quot;step21&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 21:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Overriding methods&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Sometimes (when using inheritance,) you may need to change how a method works from the base class.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
For example, let&#39;s say set_name() method in the &#39;employee&#39; class, had to do something different than what it does in the &#39;person&#39; class.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
You &#39;override&#39; the &#39;person&#39; classes version of set_name(), by declaring the same method in &#39;employee&#39;.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The code snippet:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Jimmy Two Guns&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; strtoupper&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; 

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; employee &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Sucks&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Notice how set_name() is different in the &#39;employee&#39; class from the version found in the parent class: &#39;person&#39;.&lt;/div&gt;
&lt;h3 id=&quot;step22&quot; style=&quot;border: 0px; font-size: 15px; margin: 0px 0px 2px; padding: 0px; vertical-align: baseline;&quot;&gt;
Step 22:&lt;/h3&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Overriding methods: part 2&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Sometimes you may need to access your base class&#39;s version of a method you overrode in the derived (sometimes called &#39;child&#39;) class.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
In our example, we overrode the set_name() method in the &#39;employee&#39; class. Now I&#39;ve used this code:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
… to access the parent class&#39; (person) version of the set_name() method.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;The code:&lt;/strong&gt;&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;php 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// explicitly adding class properties are optional - but &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// is good practice&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;var&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $persons_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;public&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; get_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// protected methods and properties restrict access to &lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// those elements.&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;!=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Jimmy Two Guns&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; strtoupper&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; 

&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;com&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #880000; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;// &#39;extends&#39; is the keyword that enables inheritance&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;class&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; employee &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;extends&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; person &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Sucks&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Johnny Fingers&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; person&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; __construct&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$employee_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$employee_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;Notes:&lt;/strong&gt;&amp;nbsp;Using the symbol:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
... allows you to specifically name the class where you want PHP to search for a method:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&#39;person::set_name()&#39;&lt;/span&gt;&lt;/pre&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
... tells PHP to search for set_name() in the &#39;person&#39; class.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
There is also a shortcut if you just want refer to current class&#39;s parent - by using the &#39;parent&#39; keyword.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
The code:&lt;/div&gt;
&lt;pre class=&quot;prettyprint&quot; style=&quot;background-color: #eeeeee; border: 1px solid rgb(204, 204, 204); margin-bottom: 16px; padding: 10px 12px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;protected&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;function&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Stefan Sucks&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; $this&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; $new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;strong style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;else&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #000088; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;==&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;str&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #008800; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&quot;Johnny Fingers&quot;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;)&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;{&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; parent&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;set_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;$new_name&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;);&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt; &amp;nbsp; &amp;nbsp;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;/strong&gt;&lt;span class=&quot;pln&quot; style=&quot;background-color: transparent; border: 0px; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;background-color: transparent; background-position: initial initial; background-repeat: initial initial; border: 0px; color: #666600; margin: 0px; padding: 0px; vertical-align: baseline;&quot;&gt;}&lt;/span&gt;&lt;/pre&gt;
&lt;h2 style=&quot;border: 0px; clear: both; font-size: 1.384em; font-weight: normal; line-height: 1.3em; margin: 0px 0px 16px; padding: 16px 0px 0px; vertical-align: baseline;&quot;&gt;
Conclusion&lt;/h2&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
We&#39;ve only touched on the basics of OO PHP. But you should have enough information to feel comfortable moving forward.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
Remember that the best way to really have this stuff sink in, is by actually writing code.&lt;/div&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
I would suggest creating say 10 simple objects that do simple things, and then use those objects in actual PHP pages. Once you&#39;ve done that, you will feel very comfortable with objects.&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;border: 0px; margin-bottom: 16px; padding: 0px; vertical-align: baseline;&quot;&gt;
&lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2012/12/php-oops.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-3056653714664978427</guid><pubDate>Sat, 21 May 2011 09:56:00 +0000</pubDate><atom:updated>2017-11-09T02:16:31.614-08:00</atom:updated><title>About Me</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCPuwcKD5btAMv-KmGLsJvsbXLvLp23rBnAzdgyhBAtAD-6wQRSURW9EDM1T88SWt4WbBOuTDCkfyheDlMdZlcXYWNuYx0n4AHJ-bIhyChi96SPSgXTHUSvPly9jUG1qgTPV_Oc266PjE/s1600/myphoto.jpg&quot; onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5609106866704340578&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCPuwcKD5btAMv-KmGLsJvsbXLvLp23rBnAzdgyhBAtAD-6wQRSURW9EDM1T88SWt4WbBOuTDCkfyheDlMdZlcXYWNuYx0n4AHJ-bIhyChi96SPSgXTHUSvPly9jUG1qgTPV_Oc266PjE/s320/myphoto.jpg&quot; style=&quot;cursor: pointer; float: left; height: 200px; margin: 0pt 10px 10px 0pt; width: 152px;&quot; /&gt;&lt;/a&gt;I’m G Kanagaraj. 33 years old. I was born in Seithur and lived in Rajapalayam before join MCA. Much of that time was spent at school/UGcollege boys; I was there from 1995 to 2003. Now I am a full-time web developer who specializes in creating dynamic and beautiful web pages. I have been in the field for nearly 9 years, and have been loving every minute of it. I am a blogger, entrepreneur, designer, developer, and overall thinker.&lt;br /&gt;
&lt;br /&gt;
I’m passionate about the things that interest me. I read voraciously and collect books as well, but only in specific genres. Detective fiction, as in Nero Wolfe. Caper fiction, as in Donald E Westlake. The Raj and Empire, as in Warren Hastings or Robert Clive. Mathematics as in Hardy or Ramanujan. Management as in Peter Drucker or Max de Pree. Information and Technology as in John Seely Brown. Humour as in Ogden Nash or PG Wodehouse.&lt;br /&gt;
&lt;br /&gt;
I’m passionate about my profession(s), both planned and accidental. A Fellow of the Royal Society of the Arts and a Fellow of the British Computer Society. More and more my interests have moved towards education, I keep thinking of setting up a school from scratch. Which is partly why I’m chairman of The School Of Everything.&lt;br /&gt;
&lt;br /&gt;
I’m passionate about work (!) , particularly with reference to how work is changing: the paradigms created by globalisation, disintermediation and the web; the implications of virtualisation, service orientation and commoditisation; why publishing and search and fulfilment and conversation are the only &quot;applications&quot; we may need; how telephony becoming software and the wireless internet interact with mobile devices; the terrors of poorly thought out IPR and DRM; the need to avoid walled gardens of my own making; how children now teach me about work; the socialising of information, how it creates value by being shared, how it is enriched, how it is corrupted. How information behaves and what I can learn from it.&lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2011/05/about-me.html</link><author>noreply@blogger.com (Kanagaraj)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCPuwcKD5btAMv-KmGLsJvsbXLvLp23rBnAzdgyhBAtAD-6wQRSURW9EDM1T88SWt4WbBOuTDCkfyheDlMdZlcXYWNuYx0n4AHJ-bIhyChi96SPSgXTHUSvPly9jUG1qgTPV_Oc266PjE/s72-c/myphoto.jpg" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-1588791385295669187</guid><pubDate>Wed, 17 Mar 2010 18:24:00 +0000</pubDate><atom:updated>2013-12-18T10:16:23.063-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">php</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>PHP</title><description>&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Register_globals&lt;/span&gt;&lt;/span&gt;:&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;What is Register Globals?&lt;/span&gt;&lt;br /&gt;A common security problem with PHP is the register_globals setting in PHP&#39;s configuration file (php.ini). This setting (which can be either On or Off) tells whether or not to register the contents of the EGPCS (Environment, GET, POST, Cookie, Server) variables as global variables. For example, if register_globals is on, the url http://www.example.com/test.php?id=3 will declare $id as a global variable with no code required. Similarly, $DOCUMENT_ROOT would also be defined, since it is part of the $_SERVER &#39;superglobal&#39; array. These two examples are the equivalent of placing the following code at the beginning of a script:&lt;br /&gt;$id = $_GET[&#39;id&#39;];&lt;br /&gt;$DOCUMENT_ROOT = $_SERVER[&#39;DOCUMENT_ROOT&#39;];&lt;br /&gt;This feature is a great security risk, and you should ensure that register_globals is Off for all scripts (as of PHP 4.2.0 this is the default). It&#39;s preferred to go through PHP Predefined Variables instead, such as the superglobal $_REQUEST. Even more secure is to further specify by using: $_ENV, $_GET, $_POST, $_COOKIE, or $_SERVER instead of using the more general superglobal $_REQUEST.&lt;br /&gt;&lt;br /&gt;The register_globals setting controls how you access form,&lt;br /&gt;server, and environment variables. By default this variable&lt;br /&gt;is set to Off, requiring you to use special arrays to&lt;br /&gt;access these variables.&lt;br /&gt;Warning&lt;br /&gt;In PHP 4.2.0 and later, the default value for the PHP directive register_globals is off. This is a major change in PHP. Having register_globals off affects the set of predefined variables available in the global scope. For example, to get DOCUMENT_ROOT you&#39;ll use $_SERVER[&#39;DOCUMENT_ROOT&#39;] instead of $DOCUMENT_ROOT, or $_GET[&#39;id&#39;] from the URL http://www.example.com/test.php?id=3 instead of $id, or $_ENV[&#39;HOME&#39;] instead of $HOME.&lt;br /&gt;……………………………………………………….&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Constants&lt;/span&gt;&lt;br /&gt;A constant is an identifier (name) for a simple value. As the name suggests, that value cannot change during the execution of the script (except for magic constants, which aren&#39;t actually constants). A constant is case-sensitive by default. By convention, constant identifiers are always uppercase.&lt;br /&gt;……………………………………………………….&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Operators&lt;/span&gt;&lt;br /&gt;• Assignment Operators  (= += -= *= /= .= %= &amp;amp;= |= ^= &amp;lt;&amp;lt;= &amp;gt;&amp;gt;=)&lt;br /&gt;• Bitwise Operators (&amp;lt;&amp;lt; &amp;gt;&amp;gt;)&lt;br /&gt;• Comparison Operators (&amp;lt; &amp;lt;= &amp;gt; &amp;gt;= &amp;lt;&amp;gt; == != === !==)&lt;br /&gt;• Error Control Operators (@)&lt;br /&gt;• Execution Operators (backticks (``). Note that these are not single-quotes!)&lt;br /&gt;• Incrementing/Decrementing Operators (++ --)&lt;br /&gt;• Logical Operators (&amp;amp;&amp;amp; || and or xor)&lt;br /&gt;• String Operators (concatenation operator (&#39;.&#39;))&lt;br /&gt;• Array Operators ()&lt;br /&gt;$a + $b Union Union of $a and $b.&lt;br /&gt;$a == $b Equality TRUE if $a and $b have the same key/value pairs.&lt;br /&gt;$a === $b Identity TRUE if $a and $b have the same key/value pairs in the same order and of the same types.&lt;br /&gt;$a != $b Inequality TRUE if $a is not equal to $b. $a &amp;lt;&amp;gt; $b Inequality TRUE if $a is not equal to $b.&lt;br /&gt;$a !== $b Non-identity TRUE if $a is not identical to $b.&lt;br /&gt;• Type Operators (~ - (int) (float) (string) (array) (object) (bool) @ instanceof)&lt;br /&gt;……………………………………………………….&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Namespaces overview&lt;/span&gt;&lt;br /&gt;What are namespaces? In the broadest definition namespaces are a way of encapsulating items. This can be seen as an abstract concept in many places. For example, in any operating system directories serve to group related files, and act as a namespace for the files within them. As a concrete example, the file foo.txt can exist in both directory /home/greg and in /home/other, but two copies of foo.txt cannot co-exist in the same directory. In addition, to access the foo.txt file outside of the /home/greg directory, we must prepend the directory name to the file name using the directory separator to get /home/greg/foo.txt. This same principle extends to namespaces in the programming world.&lt;br /&gt;In the PHP world, namespaces are designed to solve two problems that authors of libraries and applications encounter when creating re-usable code elements such as classes or functions:&lt;br /&gt;1. Name collisions between code you create, and internal PHP classes/functions/constants or third-party classes/functions/constants.&lt;br /&gt;2. Ability to alias (or shorten) Extra_Long_Names designed to alleviate the first problem, improving readability of source code.&lt;br /&gt;PHP Namespaces provide a way in which to group related classes, functions and constants. Here is an example of namespace syntax in PHP:&lt;br /&gt;Example #1 Namespace syntax example&lt;br /&gt;&lt;br /&gt;Namespaces are available in PHP as of PHP 5.3.0.&lt;br /&gt;……………………………………………………….&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Exceptions&lt;/span&gt;&lt;br /&gt;PHP 5 has an exception model similar to that of other programming languages. An exception can be thrown, and caught (&quot;catched&quot;) within PHP. Code may be surrounded in a try block, to facilitate the catching of potential exceptions. Each try must have at least one corresponding catch block. Multiple catch blocks can be used to catch different classes of exeptions. Normal execution (when no exception is thrown within the try block, or when a catch matching the thrown exception&#39;s class is not present) will continue after that last catch block defined in sequence. Exceptions can be thrown (or re-thrown) within a catch block.&lt;br /&gt;When an exception is thrown, code following the statement will not be executed, and PHP will attempt to find the first matching catch block. If an exception is not caught, a PHP Fatal Error will be issued with an &quot;Uncaught Exception ...&quot; message, unless a handler has been defined with set_exception_handler().&lt;br /&gt;Note: Internal PHP functions mainly use Error reporting, only modern Object oriented extensions use exceptions. However, errors can be simply translated to exceptions with ErrorException.&lt;br /&gt;Tip&lt;br /&gt;The Standard PHP Library (SPL) provides a good number of built-in exceptions.&lt;br /&gt;Example #1 Throwing an Exception&lt;br /&gt;getMessage(), &quot;\n&quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Continue execution&lt;br /&gt;echo &#39;Hello World&#39;;&lt;br /&gt;?&amp;gt;&lt;br /&gt;The above example will output:&lt;br /&gt;0.2&lt;br /&gt;Caught exception: Division by zero.&lt;br /&gt;Hello World&lt;br /&gt;……………………………………………………….&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Predefined Variables&lt;/span&gt;&lt;br /&gt;PHP provides a large number of predefined variables to all scripts. The variables represent everything from external variables to built-in environment variables, last error messages to last retrieved headers.&lt;br /&gt;Table of Contents&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Superglobals - Superglobals are built-in variables that are always available in all scopes&lt;/li&gt;&lt;li&gt;$GLOBALS - References all variables available in global scope&lt;/li&gt;&lt;li&gt;$_SERVER - Server and execution environment information&lt;/li&gt;&lt;li&gt;$_GET - HTTP GET variables&lt;/li&gt;&lt;li&gt;$_POST - HTTP POST variables&lt;/li&gt;&lt;li&gt;$_FILES - HTTP File Upload variables&lt;/li&gt;&lt;li&gt;$_REQUEST - HTTP Request variables&lt;/li&gt;&lt;li&gt;$_SESSION - Session variables&lt;/li&gt;&lt;li&gt;$_ENV - Environment variables&lt;/li&gt;&lt;li&gt;$_COOKIE - HTTP Cookies&lt;/li&gt;&lt;li&gt;$php_errormsg - The previous error message&lt;/li&gt;&lt;li&gt;$HTTP_RAW_POST_DATA - Raw POST data&lt;/li&gt;&lt;li&gt;$http_response_header - HTTP response headers&lt;/li&gt;&lt;li&gt;$argc - The number of arguments passed to script&lt;/li&gt;&lt;li&gt;$argv - Array of arguments passed to script&lt;/li&gt;&lt;/ul&gt;……………………………………………………….&lt;br /&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Context options and parameters&lt;/span&gt;&lt;br /&gt;PHP offers various context options and parameters which can be used with all filesystem and stream wrappers. The context is created with stream_context_create(). Options are set with stream_context_set_option() and parameters with stream_context_set_params().&lt;br /&gt;Table of Contents&lt;br /&gt;&lt;ul&gt;&lt;li&gt;context options - Socket context option listing&lt;/li&gt;&lt;li&gt;HTTP context options - HTTP context option listing&lt;/li&gt;&lt;li&gt;FTP context options - FTP context option listing&lt;/li&gt;&lt;li&gt;SSL context options - SSL context option listing&lt;/li&gt;&lt;li&gt;CURL context options - CURL context option listing&lt;/li&gt;&lt;li&gt;Phar context options - Phar context option listing&lt;/li&gt;&lt;li&gt;Context parameters - Context parameter listing&lt;/li&gt;&lt;/ul&gt;……………………………………………………….</description><link>http://gurukanagaraj.blogspot.com/2010/03/php.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-1722128711722549338</guid><pubDate>Thu, 21 May 2009 17:54:00 +0000</pubDate><atom:updated>2013-12-18T10:16:23.066-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">MVC</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>MVC</title><description>The main aim of the MVC architecture  is to separate the business logic and application data from the presentation data to the user.&lt;br /&gt;&lt;br /&gt;Here are the reasons why we should use the MVC design pattern.&lt;br /&gt;They are resuable : When the problems recurs, there is no need to invent a new solution, we just have to follow the pattern and adapt it as necessary.&lt;br /&gt;They are expressive: By using the MVC design pattern our application becomes more expressive.&lt;br /&gt;&lt;br /&gt;1)  Model: The model object knows about all the data that need to be displayed. It is model who is aware about all the operations that can be applied to transform that object. It only represents the data of an application. The model represents enterprise data and the business rules that govern access to and updates of this data. Model is not aware about the presentation data and how that data will be displayed to the browser.  &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2) View : The view represents the presentation of the application. The view object refers to the model. It uses the query methods of the model to obtain the contents and renders it. The view is not dependent on the application logic. It remains same if there is any modification in the business logic. In other words, we can say that it is the responsibility of the of the view&#39;s to maintain the consistency in its presentation when the model changes.&lt;br /&gt;&lt;br /&gt;3) Controller:  Whenever the user sends a request for something then it always go through the controller. The controller is responsible for intercepting the requests from view and passes it to the model for the appropriate action. After the action has been taken on the data, the controller is responsible for directing the appropriate view to the user. In  GUIs, the views and the controllers often work very closely together.</description><link>http://gurukanagaraj.blogspot.com/2009/05/mvc.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-8858624948133169660</guid><pubDate>Mon, 02 Feb 2009 19:13:00 +0000</pubDate><atom:updated>2009-02-02T11:14:36.101-08:00</atom:updated><title>Slideshow</title><description>&lt;iframe src=&quot;http://www.flickr.com/slideShow/index.gne?&quot; align=&quot;middle&quot; frameborder=&quot;0&quot; height=&quot;500&quot; scrolling=&quot;no&quot; width=&quot;500&quot;&gt;&lt;/iframe&gt;</description><link>http://gurukanagaraj.blogspot.com/2009/02/slideshow.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-8083138823048577009</guid><pubDate>Sat, 29 Nov 2008 14:45:00 +0000</pubDate><atom:updated>2008-11-29T06:49:04.856-08:00</atom:updated><title>Developing the Joomla! Component</title><description>Joomla!&#39;s Component StructureJoomla! employs a specific naming scheme,  which is used by all components. Each component in the system has a unique name  with no spaces. The code is split into two folders, each bearing the component  name prefixed by &lt;span style=&quot;font-family:Courier New;&quot;&gt;com_&lt;/span&gt;. The component used here  will be called &lt;span style=&quot;font-family:Courier New;&quot;&gt;reviews&lt;/span&gt;. Therefore, you will have  to create two folders named &lt;span style=&quot;font-family:Courier New;&quot;&gt;com_reviews&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Create one in the folder named &lt;span style=&quot;font-family:Courier New;&quot;&gt;components&lt;/span&gt;  for the front end.  &lt;/li&gt;&lt;li&gt;Create one in the folder named &lt;span style=&quot;font-family:Courier New;&quot;&gt;components within  the &lt;span style=&quot;font-family:Courier New;&quot;&gt;administrator&lt;/span&gt; folder for the back  end.&lt;/font &gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;When the component is loaded from the front end, Joomla! will look for a file  with the component&#39;s unique name ending in a &lt;span style=&quot;font-family:Courier New;&quot;&gt;.php&lt;/span&gt; extension. Within the &lt;span style=&quot;font-family:Courier New;&quot;&gt;components/com_reviews&lt;/span&gt; folder, create the &lt;span style=&quot;font-family:Courier New;&quot;&gt;reviews.php&lt;/span&gt; file. Similarly, running it in the back  end assumes the presence of a file prefaced with &lt;span style=&quot;font-family:Courier New;&quot;&gt;admin&lt;/span&gt;. followed by the component name and ending in  &lt;span style=&quot;font-family:Courier New;&quot;&gt;.php&lt;/span&gt;. Add the file &lt;span style=&quot;font-family:Courier New;&quot;&gt;admin.reviews.php&lt;/span&gt; in &lt;span style=&quot;font-family:Courier New;&quot;&gt;administrator/components/com_reviews&lt;/span&gt;. Leave both the  files empty for the moment.&lt;/p&gt; &lt;h1&gt;Executing the Component&lt;/h1&gt; &lt;p&gt;All front-end requests in Joomla! go through &lt;span style=&quot;font-family:Courier New;&quot;&gt;index.php&lt;/span&gt; in the root directory. Different components  can be loaded by setting the &lt;span style=&quot;font-family:Courier New;&quot;&gt;option&lt;/span&gt; variable in  the URL GET string. If you install Joomla! on a local web server in a directory  titled &lt;span style=&quot;font-family:Courier New;&quot;&gt;joomla&lt;/span&gt;, the URL for accessing the site  will be &lt;span style=&quot;font-family:Courier New;&quot;&gt;http://localhost/joomla/index.php&lt;/span&gt; or  something similar. Assuming this is the case, you can load the component&#39;s front  end by opening &lt;span style=&quot;font-family:Courier New;&quot;&gt;http://localhost/joomla/index.php?option=com_reviews&lt;/span&gt;  in your browser. At this point, the screen should be essentially blank, apart  from the common template elements and modules. To make this component slightly  more useful, open &lt;span style=&quot;font-family:Courier New;&quot;&gt;reviews.php&lt;/span&gt; and add the  following code, then refresh the browser:&lt;/p&gt; &lt;pre style=&quot;margin-left: 40px;&quot;&gt;&lt;?php&lt;br /&gt;defined( &#39;_JEXEC&#39; ) or die( &#39;Restricted access&#39; );&lt;br /&gt;echo &#39;&lt;div class=&quot;componentheading&quot;&gt;Restaurant Reviews&lt;/div&gt;&#39;;&lt;br /&gt;?&gt;&lt;/pre&gt; &lt;p&gt;Your screen will look similar to the following:&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image1.png&quot; /&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 40px;&quot;&gt;&lt;i&gt;You may be wondering why we called&lt;/i&gt; &lt;span style=&quot;font-family:Courier New;&quot;&gt;defined()&lt;/span&gt; &lt;i&gt;at the beginning of the file. This is a  check to ensure that the code is called through Joomla! instead of being  accessed directly at&lt;/i&gt; &lt;span style=&quot;font-family:Courier New;&quot;&gt;components/com_reviews/reviews.php&lt;/span&gt;. &lt;i&gt;Joomla!  automaticallyconfigures the environment with some security safeguards that can  be defeated ifsomeone is able to directly execute the code for your  component.&lt;/i&gt;&lt;/p&gt; &lt;p&gt;For the back end, drop this code into&lt;/p&gt; &lt;p&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;administrator/components/com_reviews/admin.reviews.php:&lt;/span&gt;  &lt;/p&gt; &lt;pre style=&quot;margin-left: 40px;&quot;&gt;&lt;?php&lt;br /&gt;defined( &#39;_JEXEC&#39; ) or die( &#39;Restricted access&#39; );&lt;br /&gt;echo &#39;Restaurant Reviews&#39;;&lt;br /&gt;?&gt;&lt;/pre&gt; &lt;p&gt;Go to &lt;span style=&quot;font-family:Courier New;&quot;&gt;http://localhost/joomla/administrator/index.php?option=com_reviews  &lt;/span&gt;and compare your result to this:&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image2.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;h1&gt;Joomla!&#39;s Division between Front End and Back End&lt;/h1&gt;For all Joomla!  components, code empowering the back-end portion is kept away from the front-end  code. In some instances, such as the database table class, the back end will use  certain files from the front end, but otherwise the two are separate. Security  is enhanced as you are less likely to slip the administrative functions into the  front-end code. This is an important distinction as the front end and back end  are similar in structure.       &lt;p&gt;The following folder diagram shows the Joomla! root with the &lt;span style=&quot;font-family:Courier New;&quot;&gt;administrator&lt;/span&gt; folder expanded:&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image3.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Notice that the &lt;span style=&quot;font-family:Courier New;&quot;&gt;administrator&lt;/span&gt; folder has a  structure similar to the root folder. It is important to differentiate between  the two, else you may place your code in the wrong folder and it will fail to  execute until youmove it.&lt;/p&gt; &lt;h1&gt;Registering Your Component in the Database&lt;/h1&gt;You now know how to access  both the front end and back end of the component. Although you could keep typing  in the URLs each time you wanted to execute a piece of code, this will not be  acceptable to your users. Navigation can be provided if you register the  component in the database by adding a row to the components table.     &lt;p&gt;We will perform this registration using the following query. It is assumed  that your database prefix is &lt;span style=&quot;font-family:Courier New;&quot;&gt;jos_&lt;/span&gt;. If not,  replace &lt;span style=&quot;font-family:Courier New;&quot;&gt;jos_&lt;/span&gt; with the prefix you chose. If you  prefer to work with direct SQL statements on a command-line interface, enter the  following query in your console:&lt;/p&gt; &lt;pre style=&quot;margin-left: 40px;&quot;&gt;INSERT INTO jos_components (name, link, admin_menu_link,&lt;br /&gt;  admin_menu_alt, &#39;option&#39;, admin_menu_img, params)&lt;br /&gt;VALUES (&#39;Restaurant Reviews&#39;, &#39;option=com_reviews&#39;,&lt;br /&gt; &#39;option=com_reviews&#39;, &#39;Manage Reviews&#39;, &#39;com_reviews&#39;,&lt;br /&gt; &#39;js/ThemeOffice/component.png&#39;, &#39;&#39;);&lt;/pre&gt; &lt;p&gt;If you prefer to use a GUI or web-based database manager such as phpMyAdmin,  enter &lt;em&gt;Restaurant Reviews&lt;/em&gt; for &lt;em&gt;name&lt;/em&gt;, &lt;em&gt;option=com_reviews&lt;/em&gt;  for &lt;em&gt;link&lt;/em&gt; and &lt;em&gt;admin_menu_link, Manage Reviews&lt;/em&gt; for  &lt;em&gt;admin_menu_alt&lt;/em&gt;, &lt;em&gt;com_reviews&lt;/em&gt; for &lt;em&gt;option&lt;/em&gt;, and  &lt;em&gt;js/ThemeOffice/component.png&lt;/em&gt; for &lt;em&gt;admin_menu_img&lt;/em&gt;. Leave all of  the other fields blank. The fields &lt;em&gt;menuid&lt;/em&gt;, &lt;em&gt;parent&lt;/em&gt;,  &lt;em&gt;ordering&lt;/em&gt;, and &lt;em&gt;iscore&lt;/em&gt; will default to &lt;em&gt;0&lt;/em&gt;, while  &lt;em&gt;enabled&lt;/em&gt; will default to &lt;em&gt;1&lt;/em&gt;.   &lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image4.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Adding this record gives the system some basic information about your  component. It states the name you want to use for the component, which can  contain spaces and punctuation. You can put in specific links to go to both the  front end and back end. The image to be used on the &lt;em&gt;Components&lt;/em&gt; menu can  be specified. Also as thedescription in the browser status bar can be made  available. It is not necessary to addthis query while developing the component;  once you create the basic directories andfiles, your component is ready to be  executed. However, it does add a menu itemin the back end and makes it possible  to add an appropriate link in the front endwithout hard coding a URL.&lt;/p&gt;&lt;br /&gt;&lt;table id=&quot;table4&quot; border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td bg style=&quot;color:#ffff99;&quot;&gt; &lt;p align=&quot;left&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;This article has been extracted from:  Learning Joomla! 1.5 Extension Development: Creating Modules, Components, and  Plugins with PHP&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;table id=&quot;table3&quot; border=&quot;0&quot; cellpadding=&quot;4&quot; cellspacing=&quot;0&quot;&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td width=&quot;48&quot;&gt;&lt;img src=&quot;http://images.packtpub.com/images/114x140/1847191304.png&quot; border=&quot;1&quot; height=&quot;90&quot; width=&quot;70&quot; /&gt;&lt;/td&gt; &lt;td valign=&quot;top&quot;&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;Create you own PHP-based Joomla!  Extensions like modules, components, and plugins.&lt;/span&gt;  &lt;p&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;For more information, please visit:&lt;br /&gt;&lt;a href=&quot;http://www.packtpub.com/Joomla-Extensions/book/article&quot;&gt;www.PacktPub.com/Joomla-Extensions/book&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;After the record is successfully entered, go to any page in the back end and  refresh it. When you move the mouse cursor over the &lt;em&gt;Components&lt;/em&gt;  menu  you should see the new option:&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image5.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Now that the component is registered, you can also create a link for the  front end. Go to &lt;em&gt;Menus&lt;/em&gt; | &lt;em&gt;Main Menu&lt;/em&gt; and click &lt;em&gt;New&lt;/em&gt;.  From this screen, select &lt;em&gt;Restaurant Reviews&lt;/em&gt;. Enter &lt;em&gt;Reviews&lt;/em&gt; as  the &lt;em&gt;Name&lt;/em&gt;. The following screen will be observed:&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image6.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Now click &lt;em&gt;Save&lt;/em&gt; and go to the front end. You should now see  &lt;em&gt;Reviews&lt;/em&gt; listed as an option.&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image7.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;You could just break out your PHP skills and start coding the component,  ensuring all front-end requests go through &lt;span style=&quot;font-family:Courier New;&quot;&gt;http://localhost/joomla/index.php?option=com_reviews&lt;/span&gt;  and all back-end requests go though &lt;span style=&quot;font-family:Courier New;&quot;&gt;http://localhost/  joomla/administrator/index.php?option=com_reviews&lt;/span&gt;. Joomla! is flexible  enough to let you do as you please. In some cases, you will have existing code  that you may want to use and you will need to split it into appropriate files.  But for the restaurant reviews, you will start a new Joomla! component from  scratch. You have the opportunity to design everything with Joomla&#39;s toolbars,  users, database classes, and libraries in mind. These elements will save you a  lotof time once you understand how theywork.      &lt;/p&gt; &lt;h1&gt;Creating Toolbars&lt;/h1&gt; &lt;p&gt;Throughout the back end, all the core components implement toolbars with  similarbuttons for saving, deleting, editing, and publishing items. You can use  these buttons in your component so that frequent administrators will have a  seamless experience.&lt;/p&gt; &lt;p&gt;To start, create the &lt;span style=&quot;font-family:Courier New;&quot;&gt;toolbar.reviews.html.php&lt;/span&gt;  file in the &lt;span style=&quot;font-family:Courier New;&quot;&gt;administrator/components/com_reviews&lt;/span&gt;  folder and enter in the following code:&lt;/p&gt; &lt;pre style=&quot;margin-left: 40px;&quot;&gt;&lt;?php&lt;br /&gt;defined( &#39;_JEXEC&#39; ) or die( &#39;Restricted access&#39; );&lt;br /&gt;class TOOLBAR_reviews {&lt;br /&gt; function _NEW() {&lt;br /&gt;  JToolBarHelper::save();&lt;br /&gt;  JToolBarHelper::apply();&lt;br /&gt;  JToolBarHelper::cancel();&lt;br /&gt; }&lt;br /&gt; function _DEFAULT() {&lt;br /&gt;  JToolBarHelper::title( JText::_( &#39;Restaurant Reviews&#39; ),&lt;br /&gt;       &#39;generic.png&#39; );&lt;br /&gt;  JToolBarHelper::publishList();&lt;br /&gt;  JToolBarHelper::unpublishList();&lt;br /&gt;  JToolBarHelper::editList();&lt;br /&gt;  JToolBarHelper::deleteList();&lt;br /&gt;  JToolBarHelper::addNew();&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;/pre&gt; &lt;p&gt;Files containing output codes are usually organized into classes, like the  code here with &lt;span style=&quot;font-family:Courier New;&quot;&gt;TOOLBAR_&lt;/span&gt;reviews. Each member  function here represents a different toolbar. The class &lt;span style=&quot;font-family:Courier New;&quot;&gt;JToolBarHelper&lt;/span&gt; contains functions that generate all  the HTML necessary to build toolbars. When desired, you can also add custom HTML  output from within these functions. Be aware that the toolbars lie within HTML  tables; you will probably want to add &lt;span style=&quot;font-family:Courier New;&quot;&gt;&lt;td&gt;&lt;/span&gt;  tags along with your custom navigation.&lt;/p&gt; &lt;p&gt;The toolbars are now defined, but you need to add some code that will decide  which one to display. In the back end, Joomla! automatically loads the file  beginning with the component name and ending in &lt;span style=&quot;font-family:Courier New;&quot;&gt;.reviews.php&lt;/span&gt; in the upper right-hand portion of the  screen. Add the following code into &lt;span style=&quot;font-family:Courier New;&quot;&gt;toolbar.reviews.php&lt;/span&gt; in the &lt;span style=&quot;font-family:Courier New;&quot;&gt;administrator/components/com_reviews&lt;/span&gt; folder:&lt;/p&gt; &lt;pre style=&quot;margin-left: 40px;&quot;&gt;&lt;?php&lt;br /&gt;defined( &#39;_JEXEC&#39; ) or die( &#39;Restricted access&#39; );&lt;br /&gt;require_once( JApplicationHelper::getPath( &#39;toolbar_html&#39; ) );&lt;br /&gt;switch($task)&lt;br /&gt;{&lt;br /&gt; case &#39;edit&#39;:&lt;br /&gt; case &#39;add&#39;:&lt;br /&gt;  TOOLBAR_reviews::_NEW();&lt;br /&gt;  break;&lt;br /&gt; default:&lt;br /&gt;  TOOLBAR_reviews::_DEFAULT();&lt;br /&gt;  break;&lt;br /&gt;}&lt;br /&gt;?&gt;&lt;/pre&gt; &lt;p&gt;The line containing &lt;span style=&quot;font-family:Courier New;&quot;&gt;require_once(...)&lt;/span&gt; uses  the &lt;span style=&quot;font-family:Courier New;&quot;&gt;getPath()&lt;/span&gt; member function of the &lt;span style=&quot;font-family:Courier New;&quot;&gt;JApplicationHelper&lt;/span&gt; class. The call to &lt;span style=&quot;font-family:Courier New;&quot;&gt;getPath()&lt;/span&gt; allows you to call up the &lt;span style=&quot;font-family:Courier New;&quot;&gt;toolbar.reviews.html.php&lt;/span&gt; file without committing to a  component name. Later, even if you change the name to &#39;Restaurants&#39; and also  change the filenames, this line of code will still load the output code for the  toolbar with no modification. &lt;/p&gt; &lt;p dir=&quot;ltr&quot; style=&quot;margin-left: 40px; margin-right: 0px;&quot;&gt;&lt;em&gt;You may be wondering  why we are creating two files to begin with, &lt;/em&gt;&lt;span style=&quot;font-family:Courier New;&quot;&gt;toolbar.reviews.php&lt;/span&gt;&lt;em&gt; and&lt;/em&gt; &lt;span style=&quot;font-family:Courier New;&quot;&gt;toolbar.reviews.html.php&lt;/span&gt;&lt;em&gt;. The preferred coding  style among component developers is to keep the processing logic in a file  completely separate from where the actual output takes place. This makes it  easier to add features later and to potentially share the code with  others.&lt;/em&gt;           &lt;/p&gt; &lt;p&gt;After &lt;span style=&quot;font-family:Courier New;&quot;&gt;toolbar.reviews.php&lt;/span&gt; loads the file with  the output class, you need to decide which toolbar should be displayed. The  request variable &lt;span style=&quot;font-family:Courier New;&quot;&gt;$task&lt;/span&gt; is automatically  registered in global scope by Joomla! and is used to direct the logic flow  within the component. With your toolbar code in place, refresh the browser in  the back end and go to &lt;em&gt;Restaurant Reviews&lt;/em&gt; under &lt;em&gt;Components&lt;/em&gt; and  you should see thefollowing screen:&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image8.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;To see the other toolbar, add &lt;span style=&quot;font-family:Courier New;&quot;&gt;&amp;amp;task=add&lt;/span&gt;  to the end of the URL in your browser, then load it. The toolbar should appear  like this:&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image9.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p&gt;Your users will certainly not want to add the task variable at the end of the  URL as they navigate through your component. How will they be able to use the  second toolbar then? Each button on the toolbar represents a different task.  When one is clicked, the associated task is added to your form and it is  automatically submitted. Once the appropriate form is in place, a click on the  &lt;em&gt;New&lt;/em&gt;     button from the first screen will pull up the toolbar seen in  the second. Since we do not yet have any forms in the back end, these toolbar  buttons will not function. These will start working in the next chapter when we  build out the rest of the back end.&lt;/p&gt; &lt;h2&gt;Available Toolbar Buttons&lt;/h2&gt; &lt;p&gt;Joomla! allows you to override any button with your own task and label,  passing them as the first and second parameters respectively. The following  buttons areavailable with the standard distribution of Joomla!:&lt;/p&gt; &lt;p style=&quot;text-align: center;&quot;&gt;&lt;img src=&quot;http://www.packtpub.com/files/images/Joomla_extension_article_image11.png&quot; /&gt;&lt;br /&gt;&lt;/p&gt; &lt;p style=&quot;margin-left: 40px;&quot;&gt;&lt;em&gt;If you would like to create a custom button  that looks and behaves like the core ones, use the&lt;/em&gt; &lt;span style=&quot;font-family:Courier New;&quot;&gt;custom()&lt;/span&gt;&lt;em&gt; member function of JToolBarHelper,  passing in the task, icon, mouse-over image, and text description as the  respective parameters.&lt;/em&gt;   &lt;/p&gt; &lt;h1&gt;Summary&lt;/h1&gt; &lt;p&gt;The basic files necessary to build the component are now in place. The rest  of the Joomla! installation now knows that this component is available for front  end and back end use. By using standard HTML and CSS classes, the component has  a look and feel similar to the other components in the system, making it easy to  use with different templates. Basic toolbars are available to the component and  can be assigned to different screens by using the &lt;span style=&quot;font-family:Courier New;&quot;&gt;$task&lt;/span&gt; variable.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr  noshade=&quot;noshade&quot;  style=&quot;font-size:78%;color:#ff9933;&quot;&gt;&lt;br /&gt;&lt;p style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;img title=&quot;Joomla! Extensions&quot; alt=&quot;Joomla! Extensions&quot; src=&quot;http://images.packtpub.com/images/100x123/1847191304.png&quot; img=&quot;&quot; align=&quot;left&quot; border=&quot;1&quot; height=&quot;123&quot; hspace=&quot;10&quot; vspace=&quot;2&quot; width=&quot;100&quot; /&gt;You can continue to learn more about  creating and developing your own Joomla! extensions in the book &lt;a href=&quot;http://www.packtpub.com/Joomla-Extensions/book/article&quot;&gt;Learning Joomla!  1.5 Extension Development: Creating Modules, Components, and Plugins with  PHP.&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;A rapid and easy-to-follow  introductory tutorial to help you use PHP code to create your first Joomla!  Extensions: modules, components, and plugins.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-family:Verdana;font-size:85%;&quot;&gt;For more information, please visit: &lt;a href=&quot;http://www.packtpub.com/Joomla-Extensions/book/article&quot;&gt;www.PacktPub.com/Joomla-Extensions/book&lt;/a&gt;&lt;/span&gt;       &lt;p style=&quot;font-family: Verdana,Arial,Helvetica,sans-serif;&quot;&gt;&lt;span style=&quot;font-size:85%;&quot;&gt;&lt;a href=&quot;http://www.packtpub.com/Joomla-Extensions/book/article&quot;&gt;&lt;br /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/p&gt; &lt;hr color=&quot;#ff9933&quot; noshade=&quot;noshade&quot; size=&quot;1&quot;&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/11/developing-joomla-component.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-1021419150894347547</guid><pubDate>Thu, 16 Oct 2008 20:28:00 +0000</pubDate><atom:updated>2008-10-16T13:39:04.257-07:00</atom:updated><title>MY PHOTOS</title><description>&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyTwwjNJYvi_IEPIDNxa8yR3pbcAxF6G1bv1GuPtxCPX6mL-QDTLswihX2ABbMQ8mhTZKkOQ2kURn-oaHSZA3C9sJXGhVjx-73Z00huBT93PTA-RRT1swE3HtoKG8ew8MPI_6-GDiCMzw/s1600-h/DSC00917.JPG&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyTwwjNJYvi_IEPIDNxa8yR3pbcAxF6G1bv1GuPtxCPX6mL-QDTLswihX2ABbMQ8mhTZKkOQ2kURn-oaHSZA3C9sJXGhVjx-73Z00huBT93PTA-RRT1swE3HtoKG8ew8MPI_6-GDiCMzw/s320/DSC00917.JPG&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5257853984932201314&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/10/my-photos.html</link><author>noreply@blogger.com (Kanagaraj)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhyTwwjNJYvi_IEPIDNxa8yR3pbcAxF6G1bv1GuPtxCPX6mL-QDTLswihX2ABbMQ8mhTZKkOQ2kURn-oaHSZA3C9sJXGhVjx-73Z00huBT93PTA-RRT1swE3HtoKG8ew8MPI_6-GDiCMzw/s72-c/DSC00917.JPG" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-8629750964116409691</guid><pubDate>Thu, 16 Oct 2008 20:26:00 +0000</pubDate><atom:updated>2013-12-18T10:18:52.985-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>Building a simple MVC system with PHP5</title><description></description><link>http://gurukanagaraj.blogspot.com/2008/10/building-simple-mvc-system-with-php5.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-5839987932012979443</guid><pubDate>Thu, 16 Oct 2008 20:00:00 +0000</pubDate><atom:updated>2016-06-20T11:56:22.822-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Model control view</category><category domain="http://www.blogger.com/atom/ns#">MVC</category><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>The Model View Controller Framework for PHP Web Applications</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;table style=&quot;width: 100%px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;docHeader&quot;&gt;php.MVC is an open source framework for PHP Web applications.   &lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td class=&quot;subHeading02&quot;&gt;&lt;br /&gt;
Introduction   &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Model view controller (MVC) is a very useful and popular design pattern. If you&#39;re writing software, you should know it. Unfortunately it&#39;s also one of the hardest to truly understand. In this article I will provide what I think is the simplest explanation of MVC, and why you should use it.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 34px; font-style: normal; font-variant: normal; font-weight: 700; letter-spacing: normal; line-height: 1.1; margin-bottom: 11px; margin-top: 1em; orphans: auto; text-align: start; text-indent: 0px; text-shadow: rgb(170, 170, 170) 1px 1px 3px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
What is Model View Controller (MVC)?&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
In a typical application you will find these three fundamental parts:&lt;/div&gt;
&lt;ul style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin-bottom: 11px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Data (Model)&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;An interface to view and modify the data (View)&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;Operations that can be performed on the data (Controller)&lt;/li&gt;
&lt;/ul&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The MVC pattern, in a nutshell, is this:&lt;/div&gt;
&lt;ol style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin-bottom: 11px; margin-top: 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin: 0px 0px 11px;&quot;&gt;
The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;model&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;represents the data, and does nothing else. The model does NOT depend on the controller or the view.&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin: 0px 0px 11px;&quot;&gt;
The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;view&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;displays the model data, and sends user actions (e.g. button clicks) to the controller. The view can:&lt;/div&gt;
&lt;ul style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin: 0px 0px 11px;&quot;&gt;
be independent of both the model and the controller; or&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;ul style=&quot;box-sizing: border-box; margin-bottom: 0px; margin-top: 0px;&quot;&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin: 0px 0px 11px;&quot;&gt;
actually&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;be&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;the controller, and therefore depend on the model.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li style=&quot;box-sizing: border-box;&quot;&gt;&lt;div style=&quot;box-sizing: border-box; margin: 0px 0px 11px;&quot;&gt;
The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;controller&lt;/b&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;provides model data to the view, and interprets user actions such as button clicks. The controller depends on the view and the model. In some cases, the controller and the view are the same object.&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Rule 1 is the golden rule of MVC so I&#39;ll repeat it:&lt;/div&gt;
&lt;blockquote style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-left-color: rgb(238, 238, 238); border-left-style: solid; border-left-width: 5px; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 20px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin: 0px 0px 22px; orphans: auto; padding: 11px 22px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; margin: 0px;&quot;&gt;
&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;The model represents the data, and does nothing else. The model does NOT depend on the controller or the view.&lt;/b&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Let&#39;s take an address book application as an example. The model is a list of&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;objects, the view is a GUI window that displays the list of people, and the controller handles actions such as &quot;Delete person&quot;, &quot;Add person&quot;, &quot;Email person&quot;, etc. The following example does not use MVC because the model depends on the view.&lt;/div&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #002b36; border-radius: 6px; box-sizing: border-box; color: #93a1a1; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 1em 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: transparent; border-radius: 5px; border: none; box-sizing: border-box; color: inherit; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 15px; line-height: 1.42857; margin: 0px 0px 11px; overflow: auto; padding: 10.5px; white-space: pre; word-break: break-all; word-wrap: normal;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//Example 1:&lt;/span&gt;
&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #dc322f;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;setPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Picture&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_picture&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//set the member variable&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;reloadData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the view&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The following example uses MVC:&lt;/div&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #002b36; border-radius: 6px; box-sizing: border-box; color: #93a1a1; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 1em 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: transparent; border-radius: 5px; border: none; box-sizing: border-box; color: inherit; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 15px; line-height: 1.42857; margin: 0px 0px 11px; overflow: auto; padding: 10.5px; white-space: pre; word-break: break-all; word-wrap: normal;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//Example 2:&lt;/span&gt;
&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #dc322f;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;setPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Picture&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_picture&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//set the member variable&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #dc322f;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;PersonListController&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;changePictureAtIndex&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Picture&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;newPict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #dc322f;&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;personIndex&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_personList&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;personIndex&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;].&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;setPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;newPict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;);&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//modify the model&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;reloadData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the view&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
In the above example, the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;class knows nothing about the view. The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonListController&lt;/code&gt;handles both changing the model, and updating the view. The view window tells the controller about user actions (in this case, it tells the controller that the user changed the picture of a person).&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 34px; font-style: normal; font-variant: normal; font-weight: 700; letter-spacing: normal; line-height: 1.1; margin-bottom: 11px; margin-top: 1em; orphans: auto; text-align: start; text-indent: 0px; text-shadow: rgb(170, 170, 170) 1px 1px 3px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
What is the advantage of MVC?&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Unnecessary complexity is the devil of software development. Complexity leads to software that is buggy, and expensive to maintain. The easiest way to make code overly complex is to put dependencies everywhere. Conversely, removing unnecessary dependencies makes delightful code that is less buggy and easier to maintain because it is&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;reusable without modification&lt;/b&gt;. You can happily reuse old, stable code without introducing new bugs into it.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The primary advantage of the MVC design pattern is this:&lt;/div&gt;
&lt;blockquote style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-left-color: rgb(238, 238, 238); border-left-style: solid; border-left-width: 5px; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 20px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin: 0px 0px 22px; orphans: auto; padding: 11px 22px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; margin: 0px;&quot;&gt;
&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MVC makes model classes reusable without modification.&lt;/b&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The purpose of the controller is to remove the view dependency from the model. By removing the view dependency from the model, the model code becomes delightful.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Why is the model code so delightful? Let&#39;s continue with the address book application example. The project manager approaches the developer and says&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;box-sizing: border-box;&quot;&gt;&quot;We love the contact list window, but we need a second window that displays all the contacts by their photos only. The photos should be in a table layout, with five photos per row.&quot;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
If the application uses MVC, this task is pretty straight forward. Currently there are three classes:&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;,&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonListController&lt;/code&gt;, and&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonListView&lt;/code&gt;. Two classes need to be created:&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonPhotoGridView&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;and&amp;nbsp;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonPhotoGridController&lt;/code&gt;. The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;class remains the same, and is easily plugged into the two different views. How delightful.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
If the application is structured badly like in Example 1, then things get more complicated. Currently there are two classes&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;, and&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonListView&lt;/code&gt;. The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;class can not be plugged into another view, because it contains code specific to&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonListView&lt;/code&gt;. The developer must modify the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;class to accommodate the new&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;PersonPhotoGridView&lt;/code&gt;, and ends up complicating the model like so:&lt;/div&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #002b36; border-radius: 6px; box-sizing: border-box; color: #93a1a1; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 1em 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: transparent; border-radius: 5px; border: none; box-sizing: border-box; color: inherit; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 15px; line-height: 1.42857; margin: 0px 0px 11px; overflow: auto; padding: 10.5px; white-space: pre; word-break: break-all; word-wrap: normal;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//Example 3:&lt;/span&gt;
&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #dc322f;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;setPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Picture&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_picture&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//set the member variable&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//check if it&#39;s in a list view&lt;/span&gt;
        &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;reloadData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the list view&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_gridView&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//check if it&#39;s in a grid view&lt;/span&gt;
        &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_gridView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;reloadData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the grid view&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
As you can see, the model code is starting to turn nasty. If the project manager then says&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;box-sizing: border-box;&quot;&gt;&quot;we&#39;re porting the app to a platform with a different GUI toolkit&quot;&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;the delightfulness is even more prominent. With MVC, the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;class can be displayed by different GUI toolkits without any modification. Just make a controller and a view with the new toolkit, just as you would with the old toolkit. Without MVC, it is a nightmare to support multiple GUI toolkits. The code may end up looking like this:&lt;/div&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #002b36; border-radius: 6px; box-sizing: border-box; color: #93a1a1; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 1em 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: transparent; border-radius: 5px; border: none; box-sizing: border-box; color: inherit; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 15px; line-height: 1.42857; margin: 0px 0px 11px; overflow: auto; padding: 10.5px; white-space: pre; word-break: break-all; word-wrap: normal;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//Example 4:&lt;/span&gt;
&lt;span class=&quot;kt&quot; style=&quot;box-sizing: border-box; color: #dc322f;&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Person&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;setPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Picture&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_picture&lt;/span&gt; &lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;pict&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;#ifdef ORIGINAL_GUI_TOOLKIT&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//check if it&#39;s in a list view&lt;/span&gt;
        &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;reloadData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the list view&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_gridView&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//check if it&#39;s in a grid view&lt;/span&gt;
        &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_gridView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;reloadData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the grid view&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;#endif&lt;/span&gt;
&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;#ifdef NEW_GUI_TOOLKIT&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//check if it&#39;s in a list view&lt;/span&gt;
        &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_listView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;redisplayData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the list view&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;if&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_gridView&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//check if it&#39;s in a grid view&lt;/span&gt;
        &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_gridView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;redisplayData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//update the grid view&lt;/span&gt;
    &lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;cp&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;#endif&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;setPicture&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;method is basically spaghetti code at this point.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 34px; font-style: normal; font-variant: normal; font-weight: 700; letter-spacing: normal; line-height: 1.1; margin-bottom: 11px; margin-top: 1em; orphans: auto; text-align: start; text-indent: 0px; text-shadow: rgb(170, 170, 170) 1px 1px 3px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Why not put the controller code in the view?&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
One solution to the spaghetti code problem in Example 4 is to move the controller code from the model to the view like so:&lt;/div&gt;
&lt;div class=&quot;highlight&quot; style=&quot;-webkit-text-stroke-width: 0px; background-color: #002b36; border-radius: 6px; box-sizing: border-box; color: #93a1a1; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 1em 0px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;pre style=&quot;background-color: transparent; border-radius: 5px; border: none; box-sizing: border-box; color: inherit; display: block; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 15px; line-height: 1.42857; margin: 0px 0px 11px; overflow: auto; padding: 10.5px; white-space: pre; word-break: break-all; word-wrap: normal;&quot;&gt;&lt;span class=&quot;c1&quot; style=&quot;box-sizing: border-box; color: #586e75;&quot;&gt;//Example 5:&lt;/span&gt;
&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;PersonListView&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;newPictureClicked&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;Picture&lt;/span&gt; &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;clickedPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;){&lt;/span&gt;
    &lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;m_selectedPerson&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;setPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;clickedPicture&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;k&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;this&lt;/span&gt;&lt;span class=&quot;o&quot; style=&quot;box-sizing: border-box; color: #859900;&quot;&gt;-&amp;gt;&lt;/span&gt;&lt;span class=&quot;n&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;reloadData&lt;/span&gt;&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;p&quot; style=&quot;box-sizing: border-box; color: #93a1a1;&quot;&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The above example also makes the model reusable, which is the main advantage of MVC. When the view will only ever display one type of model object, then combining the view and the controller is fine. For example, a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;SinglePersonView&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;will only ever display a&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;object, so the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;SinglePersonView&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;can double as the controller.&lt;/div&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
However, if the controller is separate from the view then MVC has a second advantage:&lt;/div&gt;
&lt;blockquote style=&quot;-webkit-text-stroke-width: 0px; background-color: white; border-left-color: rgb(238, 238, 238); border-left-style: solid; border-left-width: 5px; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 20px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; margin: 0px 0px 22px; orphans: auto; padding: 11px 22px; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
&lt;div style=&quot;box-sizing: border-box; margin: 0px;&quot;&gt;
&lt;b style=&quot;box-sizing: border-box; font-weight: 700;&quot;&gt;MVC can also make the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;box-sizing: border-box;&quot;&gt;view&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;reusable without modification.&lt;/b&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Not only does MVC make the model delightful, it can also make the view delightful. Ideally, a list view should be able to display lists of anything, not just&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;objects. The code in Example 5 can&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;box-sizing: border-box;&quot;&gt;not&lt;/i&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;be a generic list view, because it is tied to the model (the&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;code style=&quot;background: rgba(0, 0, 0, 0.0980392); border-radius: 5px; box-sizing: border-box; color: inherit; font-family: &amp;quot;Source Code Pro&amp;quot;, monospace; font-size: 14.4px; padding: 2px 5px; white-space: nowrap;&quot;&gt;Person&lt;/code&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;&amp;nbsp;&lt;/span&gt;class). In the situation where the view should be reusable (e.g. a list view, or a table view) and the model should be reusable, MVC is the only thing that will work. The controller removes the dependencies from both the model and the view, which allows them to be reused elsewhere.&lt;/div&gt;
&lt;h2 style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; clear: both; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 34px; font-style: normal; font-variant: normal; font-weight: 700; letter-spacing: normal; line-height: 1.1; margin-bottom: 11px; margin-top: 1em; orphans: auto; text-align: start; text-indent: 0px; text-shadow: rgb(170, 170, 170) 1px 1px 3px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
Conclusion&lt;/h2&gt;
&lt;div style=&quot;-webkit-text-stroke-width: 0px; background-color: white; box-sizing: border-box; color: #333333; font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: 27.2px; margin: 0px 0px 11px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 1; word-spacing: 0px;&quot;&gt;
The MVC design pattern inserts a controller class between the view and the model to remove the model-view dependencies. With the dependencies removed, the model, and possibly the view, can be made reusable without modification.&amp;nbsp; This makes implementing new features and maintenance a breeze. The users get stable software quickly, the company saves money, and the developers don&#39;t go insane. How good is that?&lt;/div&gt;
&lt;br /&gt;
&lt;hr /&gt;
php.MVC implements the Model-View-Controller (MVC) design pattern, and encourages application design based on the Model 2 paradigm. This design model allows the Web page or other contents (View) to be mostly separated from the internal application code (Controller/Model), making it easier for designers and programmers to focus on their respective areas of expertise. &lt;br /&gt;
The framework provides a single entry point Controller. The Controller is responsible for allocating HTTP requests to the appropriate Action handler (Model) based on configuration mappings. &lt;br /&gt;
The Model contains the business logic for the application. The Controller then forwards the request to the appropriate View component, which is usually implemented using a combination of HTML with PHP tags in the form of templates. The resulting contents are returned to the client browser, or via another protocol such as SMTP. &lt;br /&gt;
php.MVC is a PHP port of Jakarta Struts. It currently supports many features of Struts, including declarative application configuration via the XML digester. For example, mappings from the various Action business logic components to appropriate results pages can be specified declaratively in the XML configuration file. &lt;br /&gt;
&lt;center&gt;
 &lt;table style=&quot;width: 100%px;&quot;&gt;  &lt;tbody&gt;
&lt;tr&gt;   &lt;td class=&quot;docHeader&quot;&gt;Release News.   &lt;/td&gt;  &lt;/tr&gt;
&lt;tr&gt;   &lt;td class=&quot;subHeading02&quot;&gt;&lt;br /&gt;
Release News: 28 February 2006 - php.MVC Web Application Framework Dev v. 1.0 Released   &lt;/td&gt;  &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/center&gt;
This is a development release of the php.MVC framework. A full production version will  be released after any issues with this release are addressed. &lt;br /&gt;
This release contains bug fixes and enhancements to the framework, and also includes  a compressed performance version for use in more demanding hosting environments. Please  refer to the test application described below for an example of how to use the compressed  performance version in an application. &lt;br /&gt;
&lt;b&gt;Downloads:&lt;/b&gt;&lt;br /&gt;
This package is available for download from:&lt;br /&gt;
&lt;a href=&quot;http://sourceforge.net/project/showfiles.php?group_id=68207&quot;&gt;  http://sourceforge.net/project/showfiles.php?group_id=68207&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
• The core php.MVC framework and supporting classes are included in the    &lt;i&gt;phpmvc-base-dev-1.0.0-release_2006_02_24_1730&lt;/i&gt; file available as tgz or zip.&lt;br /&gt;
&lt;br /&gt;
• The compressed performance version of the framework is available in the    &lt;i&gt;phpmvc-base-dev-perform-1.0.0-release_2006_02_24_1730&lt;/i&gt; file available as tgz or zip.&lt;br /&gt;
&lt;br /&gt;
The framework packages listed above are also available here:&lt;br /&gt;
&lt;a href=&quot;http://phpmvc.net/download/cvsIdx.php?doc=cvs-snaps&quot;&gt;  http://phpmvc.net/download/cvsIdx.php?doc=cvs-snaps&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
• A test application for this version of the php.MVC framework is available in the    &lt;i&gt;phpmvc-latest-release-test-app&lt;/i&gt; file available as tgz or zip. The compressed performance    version of the framework is bundled with this test application, and may be the quickest    way for new users to give php.MVC a try. Just download the test application, unzip it    to the Web root of a PHP enabled Web server and browse to the included index file.&lt;br /&gt;
&lt;br /&gt;
The test application is also available here:&lt;br /&gt;
&lt;a href=&quot;http://phpmvc.net/download/rel/phpmvc-latest-release-test-app.tgz&quot;&gt;  http://phpmvc.net/download/rel/phpmvc-latest-release-test-app.tgz&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://phpmvc.net/download/rel/phpmvc-latest-release-test-app.zip&quot;&gt;  http://phpmvc.net/download/rel/phpmvc-latest-release-test-app.zip&lt;/a&gt; &lt;br /&gt;
&lt;b&gt;Documentation:&lt;/b&gt;&lt;br /&gt;
Index of general project documentation: &lt;a href=&quot;http://phpmvc.net/docs/docsIdx.php&quot;&gt;  http://phpmvc.net/docs/docsIdx.php&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Index of php.MVC User Guides: &lt;a href=&quot;http://phpmvc.net/docs/guides/guidesIdx.php&quot;&gt;  http://phpmvc.net/docs/guides/guidesIdx.php&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Introductory Guide 101 to php.MVC: &lt;a href=&quot;http://phpmvc.net/docs/guides/guidesIdx.php?doc=phpmvc-101&quot;&gt;  http://phpmvc.net/docs/guides/guidesIdx.php?doc=phpmvc-101&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Discussion Forums:- php.MVC: &lt;a href=&quot;http://sourceforge.net/forum/forum.php?forum_id=231942&quot;&gt;  http://sourceforge.net/forum/forum.php?forum_id=231942&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Some documents are available for download in other formats and languages. (currently English and French): &lt;a href=&quot;http://phpmvc.net/download/downloadIdx.php?doc=phpmvc-docs&quot;&gt;  http://phpmvc.net/download/downloadIdx.php?doc=phpmvc-docs&lt;/a&gt; &lt;br /&gt;
&lt;b&gt;Other Resources:&lt;/b&gt;&lt;br /&gt;
Latest php.MVC library release:  &lt;a href=&quot;http://phpmvc.net/download/cvsIdx.php?doc=cvs-snaps&quot;&gt;  http://phpmvc.net/download/cvsIdx.php?doc=cvs-snaps&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Many working examples demonstrating the use of php.MVC:  &lt;a href=&quot;http://phpmvc.net/download/downloadIdx.php?doc=other-releases&quot;&gt;  http://phpmvc.net/download/downloadIdx.php?doc=other-releases&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
SleeK Action Builder:- A Program for Building php.MVC Web Applications:  &lt;a href=&quot;http://www.phpmvc.net/builder/builderIdx.php?doc=wiz-intro&quot;&gt;  http://www.phpmvc.net/builder/builderIdx.php?doc=wiz-intro&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
SleeK Action Wizard for php.MVC Users Guide (176Kb):&lt;br /&gt;
&lt;a href=&quot;http://www.phpmvc.net/docs/guides/guidesIdx.php?doc=action-wiz&quot;&gt;  http://www.phpmvc.net/docs/guides/guidesIdx.php?doc=action-wiz&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://www.phpmvc.net/download/builder/ProjectWizardGuide_1.0.zip&quot;&gt;  http://www.phpmvc.net/download/builder/ProjectWizardGuide_1.0.zip&lt;/a&gt; &lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2008/10/model-view-controller-framework-for-php.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-8689784229433113699</guid><pubDate>Thu, 16 Oct 2008 19:49:00 +0000</pubDate><atom:updated>2013-12-18T10:18:52.988-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Tutorial</category><title>MVC Pattern in php</title><description>&lt;span id=&quot;intelliTxt&quot;&gt;&lt;h2&gt; Understanding MVC in PHP&lt;/h2&gt;&lt;!-- sidebar begins --&gt; &lt;!-- don&#39;t move sidebars --&gt; &lt;!-- sidebar ends --&gt;  &lt;!-- sidebar begins --&gt; &lt;a href=&quot;http://www.oreilly.com/catalog/tagclouds/index.html?CMP=ILC-91PU22493344&amp;amp;ATT=http://www.onlamp.com/pub/a/php/2005/09/15/mvc_intro.html?page=1&quot;&gt;&lt;img src=&quot;http://www.oreillynet.com/images/ads/tagclouds_336x196.gif&quot; alt=&quot;Add Tag Clouds to Your Site&quot; style=&quot;margin: 0pt 0pt 1em 1em; float: right;&quot; border=&quot;0&quot; /&gt;&lt;/a&gt; &lt;!-- sidebar ends --&gt;  &lt;p&gt;This article series (continued in &lt;a href=&quot;http://www.onlamp.com/pub/a/php/2005/11/03/mvc_controller.html&quot;&gt;Implementing  MVC in PHP: The Controller&lt;/a&gt;, &lt;a href=&quot;http://www.onlamp.com/pub/a/php/2006/01/26/mvc_view.html&quot;&gt;Implementing  MVC in PHP: The View&lt;/a&gt;, and &lt;a href=&quot;http://www.onlamp.com/pub/a/php/2006/03/02/mvc_model.html&quot;&gt;Implementing  MVC in PHP: The Model&lt;/a&gt;) demonstrates how to build an MVC web framework using PHP 5. This article covers the basics of MVC web frameworks, building the foundation classes for a framework that the other three articles in this series will build.&lt;/p&gt;  &lt;p&gt;With the introduction of PHP 5 and its new &lt;code&gt;OOP&lt;/code&gt; features developers can now seriously talk about building solid APIs and more complex &lt;code&gt;MVC&lt;/code&gt; frameworks for the web in PHP. This was possible before, but the new features in PHP 5 make it easier to integrate more advanced features into MVC frameworks, such as SOAP and WSDL.&lt;/p&gt;  &lt;p&gt;In this article I assume that you have a solid understanding of object-oriented programming and that you have at least scanned the upcoming changes to the OOP structure of PHP in PHP5.&lt;/p&gt;  &lt;h4&gt;What is MVC?&lt;/h4&gt;  &lt;p&gt;MVC is the idea that you have three different pieces that work in unison to form a complex application. A car is a good real-world example of MVC. With a car you have two views: the interior and the exterior. Both take input from the controller: the driver. The brakes, steering wheel and other controls represent the model: they take input from the controller (driver) and hand them off to the views (interior/exterior) for presentation.&lt;/p&gt;  &lt;h4&gt;MVC on the Web&lt;/h4&gt;  &lt;p&gt;The ideas behind MVC frameworks are quite simple and extremely flexible. The idea is that you have a single controller (such as &lt;em&gt;index.php&lt;/em&gt;) that controls the launch of applications within the framework based on arguments in the request. This usually includes, at a minimum, an argument defining which model to invoke, an event, and the usual &lt;code&gt;GET&lt;/code&gt; arguments. From there the controller validates the request (authentication, valid model, request sanitization, etc.) and runs the requested event.&lt;/p&gt;  &lt;p&gt;For instance, a request for &lt;code&gt;/index.php?module=foo&amp;amp;event=bar&lt;/code&gt; might load a class called &lt;code&gt;foo&lt;/code&gt; and run &lt;code&gt;foo::bar()&lt;/code&gt;. The advantages of this method include:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;A single entry point for all applications.&lt;/li&gt;&lt;li&gt;Removing the headaches involved with maintaining numerous scripts, each with their own relative paths, database connections, authentication, etc.&lt;/li&gt;&lt;li&gt;Allowing the consolidation and reuse of code.&lt;/li&gt;&lt;/ul&gt;  &lt;h4&gt;Why Create My Own MVC Framework?&lt;/h4&gt;  &lt;p&gt;This article doesn&#39;t really advocate &quot;You should write your own MVC web framework!&quot; as is tries to explain &quot;This is how MVC web frameworks work in theory, and why they are so great.&quot;&lt;/p&gt;  &lt;p&gt;As of this writing, there are very few true MVC frameworks written in PHP. In fact, there is only one that I know of, &lt;a href=&quot;http://solarphp.com/home/&quot;&gt;Solar&lt;/a&gt;, that is entirely pure PHP 5 code. Another one out there is &lt;a href=&quot;http://www.cakephp.org/&quot;&gt;Cake&lt;/a&gt;, which is trying to be the &quot;Ruby on Rails of PHP.&quot; I, personally, have a few problems with both of these frameworks. Both Solar and Cake fail to leverage existing code in PEAR, Smarty, etc. Cake appears a bit disorganized at the moment. Finally, Solar is the work of mostly a single person (not that Paul isn&#39;t a great coder or person, but there is only a single gatekeeper at the time of this writing). These may not be issues that concern you, and if they don&#39;t concern you, by all means check these two out.&lt;/p&gt;  &lt;h4&gt;The Old Way&lt;/h4&gt;  &lt;p&gt;If I could go back in time and look at code I wrote in early 2001, I would find a file called &lt;em&gt;template.txt&lt;/em&gt; that looked something like:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;setFetchMode(DB_FETCHMODE_ASSOC);&lt;br /&gt;} else {&lt;br /&gt;  die($db-&gt;getMessage());&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Put your logic here&lt;br /&gt;&lt;br /&gt;// Output the template&lt;br /&gt;include_once(APP_TEMPLATE_PATH.&#39;/header.php&#39;);&lt;br /&gt;include_once(APP_TEMPLATE_PATH.&#39;/&#39;.$APP_TEMPLATE_FILE);&lt;br /&gt;include_once(APP_TEMPLATE_PATH.&#39;/footer.php&#39;);&lt;br /&gt;&lt;br /&gt;?&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Oh man, just looking at this code makes me cringe now. The idea with this approach was that every application fit into this set approach and I could just copy &lt;em&gt;template.txt&lt;/em&gt; to &lt;em&gt;myapp.php&lt;/em&gt;, change some of the variables, and then voila, it would work. However, this top-down approach has some serious flaws.&lt;/p&gt;  &lt;ol&gt;&lt;li&gt;What if my boss wanted me to change &lt;em&gt;myapp.php&lt;/em&gt; to output a PDF in some cases, HTML in others, and SOAP if the request posted XML directly?&lt;/li&gt;&lt;li&gt;What if this app required IMAP or LDAP authentication?&lt;/li&gt;&lt;li&gt;How would I go about handling various modes in the script (including edit, update, and delete)?&lt;/li&gt;&lt;li&gt;How would I handle multi-level authentication (admin versus non-admin)?&lt;/li&gt;&lt;li&gt;How would I turn on output caching?&lt;/li&gt;&lt;/ol&gt;&lt;/span&gt;&lt;span id=&quot;intelliTxt&quot;&gt;&lt;h4&gt;The New Way&lt;/h4&gt;  &lt;p&gt;By bringing everything into an MVC framework, I could make my life a lot easier. Compare the following code:&lt;/p&gt;  &lt;pre&gt;&lt;code&gt;&lt;?php&lt;br /&gt;&lt;br /&gt;class myapp extends FR_Auth_User&lt;br /&gt;{&lt;br /&gt;   public function __construct()&lt;br /&gt;   {&lt;br /&gt;       parent::__construct();&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public function __default()&lt;br /&gt;   {&lt;br /&gt;       // Do something here&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public function delete()&lt;br /&gt;   {&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   public function __destruct()&lt;br /&gt;   {&lt;br /&gt;       parent::__destruct();&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;span id=&quot;intelliTxt&quot;&gt;&lt;h4&gt;Coding Standards&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Before you start coding a cohesive framework, you might want to sit&lt;br /&gt;down with your team (or yourself) and talk about coding standards. The&lt;br /&gt;whole idea of MVC programming revolves around reusable and standardized&lt;br /&gt;code. I recommend talking about, at least:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;What are your coding standards regarding variable naming and&lt;br /&gt;indentation? Don&#39;t start a holy war, but hammer out the basics and&lt;br /&gt;stick to them, especially when it comes to your foundation classes.&lt;/li&gt;&lt;li&gt;Decide on a standard prefix for your functions, classes, and global&lt;br /&gt;variables. Unfortunately, PHP does not support namespaces. As a result,&lt;br /&gt;it might be a good idea to prepend your variables to avoid name&lt;br /&gt;collisions and confusion. Throughout this article, I&#39;ve prepended my&lt;br /&gt;global variables, functions and classes with &lt;code&gt;FR_&lt;/code&gt;, so as to distinguish core foundation code from simple application code.&lt;/li&gt;&lt;li&gt;I highly recommend using phpDocumentor to document your code as you&lt;br /&gt;actually code it. I will document all of the core foundation classes as&lt;br /&gt;well as my initial applications in this article. At my own place of&lt;br /&gt;employment, I run phpDocumentor via a &lt;code&gt;cron&lt;/code&gt; job to compile documentation frequently from my code repository.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Coding the Foundation&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;With all of that theory out of the way, here are the foundation&lt;br /&gt;classes. Be sure to read the comments for my reasonings, ideas, and&lt;br /&gt;implementation details. I&#39;m presenting a combination of things I&#39;ve&lt;br /&gt;done in the past that work for me, and the results of a few years of&lt;br /&gt;trial and error. By no means is this the only way to program an MVC&lt;br /&gt;framework, but I think it provides a good overview of how things should&lt;br /&gt;work.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5&gt;Filesystem Layout&lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The basic layout is simple and somewhat strictly defined. There is a&lt;br /&gt;directory for includes, which will follow a specific pattern to make it&lt;br /&gt;easy to use PHP&#39;s new &lt;code&gt;__autoload()&lt;/code&gt; function. Another directory is for modules, which will have their own layout. The hierarchy looks like:&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;/&lt;/em&gt;&lt;br /&gt; &lt;ul&gt;&lt;li&gt;&lt;em&gt;config.php&lt;/em&gt;&lt;br /&gt;   &lt;/li&gt;&lt;li&gt;&lt;em&gt;index.php&lt;/em&gt;&lt;br /&gt;   &lt;/li&gt;&lt;li&gt;&lt;em&gt;includes/&lt;/em&gt;&lt;br /&gt;       &lt;ul&gt;&lt;li&gt;&lt;em&gt;Auth.php&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;Auth/&lt;/em&gt;&lt;br /&gt;             &lt;ul&gt;&lt;li&gt;&lt;em&gt;No.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;li&gt;&lt;em&gt;User.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;Module.php&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;Object.php&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;Object/&lt;/em&gt;&lt;br /&gt;             &lt;ul&gt;&lt;li&gt;&lt;em&gt;DB.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;Presenter.php&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;Presenter/&lt;/em&gt;&lt;br /&gt;             &lt;ul&gt;&lt;li&gt;&lt;em&gt;common.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;li&gt;&lt;em&gt;debug.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;li&gt;&lt;em&gt;smarty.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;Smarty/&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;   &lt;/li&gt;&lt;li&gt;&lt;em&gt;modules/&lt;/em&gt;&lt;br /&gt;       &lt;ul&gt;&lt;li&gt;&lt;em&gt;example/&lt;/em&gt;&lt;br /&gt;             &lt;ul&gt;&lt;li&gt;&lt;em&gt;config.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;li&gt;&lt;em&gt;example.php&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;li&gt;&lt;em&gt;tpl/&lt;/em&gt;&lt;br /&gt;                   &lt;ul&gt;&lt;li&gt;&lt;em&gt;example.tpl&lt;/em&gt;&lt;br /&gt;                     &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;               &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;         &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;   &lt;/li&gt;&lt;li&gt;&lt;em&gt;tpl/&lt;/em&gt;&lt;br /&gt;       &lt;ul&gt;&lt;li&gt;&lt;em&gt;default/&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;cache/&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;config/&lt;/em&gt;&lt;br /&gt;         &lt;/li&gt;&lt;li&gt;&lt;em&gt;templates/&lt;/em&gt;&lt;br /&gt;             &lt;ul&gt;&lt;li&gt;&lt;em&gt;templates_c/&lt;/em&gt;&lt;br /&gt;               &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;         &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;   &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;You&#39;re probably thinking that&#39;s a lot of code! It is, but you&#39;ll get&lt;br /&gt;through it. At the end of this article and the series, you&#39;ll see that&lt;br /&gt;MVC programming will make your life a lot easier and speed up&lt;br /&gt;development time.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;In the filesystem structure, all of the foundation classes live inside of &lt;em&gt;includes/&lt;/em&gt;.&lt;br /&gt;The example laid out a sample module, as well. Each module has its own&lt;br /&gt;configuration file, at least one module file, and one template file.&lt;/p&gt;&lt;p&gt;All modules reside in &lt;em&gt;modules/&lt;/em&gt;. I&#39;ve become accustomed to wrapping my modules in an outer-page template, which is what the &lt;em&gt;tpl/&lt;/em&gt; directory is for. Each &quot;theme&quot; or template group has its own template directory. For now, I&#39;m going to use &lt;em&gt;default/&lt;/em&gt; as my outer-page template. Later I&#39;ll show how to create a presentation layer for modules that want to render themselves.&lt;/p&gt;&lt;br /&gt;&lt;/span&gt;&lt;span id=&quot;intelliTxt&quot;&gt;&lt;h5&gt;&lt;em&gt;config.php&lt;/em&gt; &lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;em&gt;config.php&lt;/em&gt; provides a centralized location for global configuration variables, such as the &lt;code&gt;DSN&lt;/code&gt;&lt;br /&gt;and log file location. Also, notice that I dynamically figure out the&lt;br /&gt;installation location on the file system. This will make installing and&lt;br /&gt;migrating your code simple if you use &lt;code&gt;FR_BASE_PATH&lt;/code&gt; in your own code.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5&gt;&lt;em&gt;index.php&lt;/em&gt; &lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is the controller. I will cover this in depth in the next article.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5&gt;&lt;em&gt;Object.php&lt;/em&gt; &lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is the base class for all of the foundation classes. It&lt;br /&gt;provides some basic features that most, if not all, classes will need.&lt;br /&gt;Additionally, the child class &lt;code&gt;FR_Object_DB&lt;/code&gt; extends this object and provides a database connection.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The idea is that, by having all children extend from a central&lt;br /&gt;object, all of the foundation classes will share certain&lt;br /&gt;characteristics. You could put the database connection directly into &lt;code&gt;FR_Object&lt;/code&gt;, but not all classes need a database connection. I will talk about &lt;code&gt;FR_Object_DB&lt;/code&gt; later.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt; require_once(&#39;Log.php&#39;);&lt;br /&gt;&lt;br /&gt; /**&lt;br /&gt; * FR_Object&lt;br /&gt; *&lt;br /&gt; * The base object class for most of the classes that we use in our framework.&lt;br /&gt; * Provides basic logging and set/get functionality.&lt;br /&gt; *&lt;br /&gt; * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt; * @package Framework&lt;br /&gt; */&lt;br /&gt; abstract class FR_Object&lt;br /&gt; {&lt;br /&gt;     /**&lt;br /&gt;     * $log&lt;br /&gt;     *&lt;br /&gt;     * @var mixed $log Instance of PEAR Log&lt;br /&gt;     */&lt;br /&gt;     protected $log;&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * $me&lt;br /&gt;     *&lt;br /&gt;     * @var mixed $me Instance of ReflectionClass&lt;br /&gt;     */&lt;br /&gt;     protected $me;&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * __construct&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @access public&lt;br /&gt;     */&lt;br /&gt;     public function __construct()&lt;br /&gt;     {&lt;br /&gt;         $this-&gt;log = Log::factory(&#39;file&#39;,FR_LOG_FILE);&lt;br /&gt;         $this-&gt;me = new ReflectionClass($this);&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * setFrom&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @access public&lt;br /&gt;     * @param mixed $data Array of variables to assign to instance&lt;br /&gt;     * @return void&lt;br /&gt;     */&lt;br /&gt;     public function setFrom($data)&lt;br /&gt;     {&lt;br /&gt;         if (is_array($data) &amp;amp;&amp;amp; count($data)) {&lt;br /&gt;             $valid = get_class_vars(get_class($this));&lt;br /&gt;             foreach ($valid as $var =&gt; $val) {&lt;br /&gt;                 if (isset($data[$var])) {&lt;br /&gt;                     $this-&gt;$var = $data[$var];&lt;br /&gt;                 }&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * toArray&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @access public&lt;br /&gt;     * @return mixed Array of member variables keyed by variable name&lt;br /&gt;     */&lt;br /&gt;     public function toArray()&lt;br /&gt;     {&lt;br /&gt;         $defaults = $this-&gt;me-&gt;getDefaultProperties();&lt;br /&gt;         $return = array();&lt;br /&gt;         foreach ($defaults as $var =&gt; $val) {&lt;br /&gt;             if ($this-&gt;$var instanceof FR_Object) {&lt;br /&gt;                 $return[$var] = $this-&gt;$var-&gt;toArray();&lt;br /&gt;             } else {&lt;br /&gt;                 $return[$var] = $this-&gt;$var;&lt;br /&gt;             }&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         return $return;&lt;br /&gt;     }&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * __destruct&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @access public&lt;br /&gt;     * @return void&lt;br /&gt;     */&lt;br /&gt;     public function __destruct()&lt;br /&gt;     {&lt;br /&gt;         if ($this-&gt;log instanceof Log) {&lt;br /&gt;             $this-&gt;log-&gt;close();&lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;span id=&quot;intelliTxt&quot;&gt;&lt;h5&gt;&lt;em&gt;Auth.php&lt;/em&gt; &lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is the base class for authentication. It extends from the &lt;code&gt;FR_Module&lt;/code&gt; class from &lt;em&gt;Module.php&lt;/em&gt;. Its major function is to define how a basic authentication class should behave.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;An alternate approach is to define this as a variable in the module&lt;br /&gt;and then have the controller create the authentication module through a&lt;br /&gt;factory pattern. However, this way works too (and is simpler to&lt;br /&gt;explain).&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Child classes should override the &lt;code&gt;authenticate()&lt;/code&gt; method. The controller will use this method when determining if a user has access to the given module. For instance, the &lt;code&gt;FR_Auth_No&lt;/code&gt; class simply returns &lt;code&gt;true&lt;/code&gt;, which allows you to create modules that require no authentication.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt; abstract class FR_Auth extends FR_Module&lt;br /&gt; {&lt;br /&gt;     // {{{ __construct()&lt;br /&gt;     function __construct()&lt;br /&gt;     {&lt;br /&gt;         parent::__construct();&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ authenticate()&lt;br /&gt;     abstract function authenticate();&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ __destruct()&lt;br /&gt;     function __destruct()&lt;br /&gt;     {&lt;br /&gt;         parent::__destruct();&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h5&gt;&lt;em&gt;Module.php&lt;/em&gt; &lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is the heart of all of the modules. It extends the &lt;code&gt;FR_Object_DB&lt;/code&gt; class and provides all of its children with database access and an open log file.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Additionally, it defines the default presentation layer, the default&lt;br /&gt;template file for the module, default page template file, and a few&lt;br /&gt;other variables that the controller and presentation layer use.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The class also provides the basic structure of what each module must possess as far as functions. The function &lt;code&gt;set()&lt;/code&gt; abstracts the method of setting data into a centralized place, which the &lt;code&gt;getData()&lt;/code&gt; function then hands off to the presentation layer for rendering.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt; abstract class FR_Module extends FR_Object_Web&lt;br /&gt; {&lt;br /&gt;     // {{{ properties&lt;br /&gt;     /**&lt;br /&gt;     * $presenter&lt;br /&gt;     *&lt;br /&gt;     * Used in FR_Presenter::factory() to determine which presentation (view)&lt;br /&gt;     * class should be used for the module.&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @var string $presenter&lt;br /&gt;     * @see FR_Presenter, FR_Presenter_common, FR_Presenter_smarty&lt;br /&gt;     */&lt;br /&gt;     public $presenter = &#39;smarty&#39;;&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * $data&lt;br /&gt;     *&lt;br /&gt;     * Data set by the module that will eventually be passed to the view.&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @var mixed $data Module data&lt;br /&gt;     * @see FR_Module::set(), FR_Module::getData()&lt;br /&gt;     */&lt;br /&gt;     protected $data = array();&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * $name&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @var string $name Name of module class&lt;br /&gt;     */&lt;br /&gt;     public $name;&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * $tplFile&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @var string $tplFile Name of template file&lt;br /&gt;     * @see FR_Presenter_smarty&lt;br /&gt;     */&lt;br /&gt;     public $tplFile;&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * $moduleName&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @var string $moduleName Name of requested module&lt;br /&gt;     * @see FR_Presenter_smarty&lt;br /&gt;     */&lt;br /&gt;     public $moduleName = null;&lt;br /&gt;&lt;br /&gt;     /**&lt;br /&gt;     * $pageTemplateFile&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @var string $pageTemplateFile Name of outer page template&lt;br /&gt;     */&lt;br /&gt;     public $pageTemplateFile = null;&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ __construct()&lt;br /&gt;     /**&lt;br /&gt;     * __construct&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     */&lt;br /&gt;     public function __construct()&lt;br /&gt;     {&lt;br /&gt;         parent::__construct();&lt;br /&gt;         $this-&gt;name = $this-&gt;me-&gt;getName();&lt;br /&gt;         $this-&gt;tplFile = $this-&gt;name.&#39;.tpl&#39;;&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ __default()&lt;br /&gt;     /**&lt;br /&gt;     * __default&lt;br /&gt;     *&lt;br /&gt;     * This function is ran by the controller if an event is not specified&lt;br /&gt;     * in the user&#39;s request.&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     */&lt;br /&gt;     abstract public function __default();&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ set($var,$val)&lt;br /&gt;     /**&lt;br /&gt;     * set&lt;br /&gt;     *&lt;br /&gt;     * Set data for your module. This will eventually be passed toe the&lt;br /&gt;     * presenter class via FR_Module::getData().&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @param string $var Name of variable&lt;br /&gt;     * @param mixed $val Value of variable&lt;br /&gt;     * @return void&lt;br /&gt;     * @see FR_Module::getData()&lt;br /&gt;     */&lt;br /&gt;     protected function set($var,$val) {&lt;br /&gt;         $this-&gt;data[$var] = $val;&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ getData()&lt;br /&gt;     /**&lt;br /&gt;     * getData&lt;br /&gt;     *&lt;br /&gt;     * Returns module&#39;s data.&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @return mixed&lt;br /&gt;     * @see FR_Presenter_common&lt;br /&gt;     */&lt;br /&gt;     public function getData()&lt;br /&gt;     {&lt;br /&gt;         return $this-&gt;data;&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ isValid($module)&lt;br /&gt;     /**&lt;br /&gt;     * isValid&lt;br /&gt;     *&lt;br /&gt;     * Determines if $module is a valid framework module. This is used by&lt;br /&gt;     * the controller to determine if the module fits into our framework&#39;s&lt;br /&gt;     * mold. If it extends from both FR_Module and FR_Auth then it should be&lt;br /&gt;     * good to run.&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @static&lt;br /&gt;     * @param mixed $module&lt;br /&gt;     * @return bool&lt;br /&gt;     */&lt;br /&gt;     public static function isValid($module)&lt;br /&gt;     {&lt;br /&gt;         return (is_object($module) &amp;amp;&amp;amp;&lt;br /&gt;                 $module instanceof FR_Module &amp;amp;&amp;amp;&lt;br /&gt;                 $module instanceof FR_Auth);&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt;     // {{{ __destruct()&lt;br /&gt;     public function __destruct()&lt;br /&gt;     {&lt;br /&gt;         parent::__destruct();&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;&lt;span id=&quot;intelliTxt&quot;&gt;&lt;h5&gt;&lt;em&gt;Presenter.php&lt;/em&gt; &lt;/h5&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;This is the foundation for the presentation layer. It uses the factory design pattern to create the presentation layer. &lt;code&gt;FR_Module::$presenter&lt;/code&gt;&lt;br /&gt;defines which presentation layer to use, which the controller will then&lt;br /&gt;create via the factory method. Once the controller has a valid&lt;br /&gt;presentation layer, the only thing left to do is to run the common &lt;code&gt;display()&lt;/code&gt; function, which presentation classes inherit from &lt;code&gt;FR_Presenter_common&lt;/code&gt;.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;code&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;&lt;br /&gt; class FR_Presenter&lt;br /&gt; {&lt;br /&gt;     // {{{ factory($type,FR_Module $module)&lt;br /&gt;     /**&lt;br /&gt;     * factory&lt;br /&gt;     *&lt;br /&gt;     * @author Joe Stump &lt;joe@joestump.net&gt;&lt;br /&gt;     * @access public&lt;br /&gt;     * @param string $type Presentation type (our view)&lt;br /&gt;     * @param mixed $module Our module, which the presenter will display&lt;br /&gt;     * @return mixed PEAR_Error on failure or a valid presenter&lt;br /&gt;     * @static&lt;br /&gt;     */&lt;br /&gt;     static public function factory($type,FR_Module $module)&lt;br /&gt;     {&lt;br /&gt;         $file = FR_BASE_PATH.&#39;/includes/Presenter/&#39;.$type.&#39;.php&#39;;&lt;br /&gt;         if (include($file)) {&lt;br /&gt;             $class = &#39;FR_Presenter_&#39;.$type;&lt;br /&gt;             if (class_exists($class)) {&lt;br /&gt;                 $presenter = new $class($module);&lt;br /&gt;                 if ($presenter instanceof FR_Presenter_common) {&lt;br /&gt;                     return $presenter;&lt;br /&gt;                 }&lt;br /&gt;&lt;br /&gt;                 return PEAR::raiseError(&#39;Invalid presentation class: &#39;.$type);&lt;br /&gt;             }&lt;br /&gt;&lt;br /&gt;             return PEAR::raiseError(&#39;Presentation class not found: &#39;.$type);&lt;br /&gt;         }&lt;br /&gt;&lt;br /&gt;         return PEAR::raiseError(&#39;Presenter file not found: &#39;.$type);&lt;br /&gt;     }&lt;br /&gt;     // }}}&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;h4&gt;Up Next&lt;/h4&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;So far I have covered why using MVC frameworks make sense and coded&lt;br /&gt;the foundation classes. The next article will cover the controller. The&lt;br /&gt;third part will cover the view, or presentation layer. The final part&lt;br /&gt;of this series will show the creation of the first application built&lt;br /&gt;using the framework, the Model.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Example code&lt;/strong&gt; for this article: &lt;a href=&quot;http://www.onlamp.com/php/2005/09/15/examples/framework-0.2.tar.gz&quot;&gt;&lt;em&gt;framework-0.2.tar.gz&lt;/em&gt;&lt;/a&gt;&lt;/p&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;span id=&quot;intelliTxt&quot;&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;code&gt;&lt;br /&gt;?&gt;&lt;/code&gt;&lt;/pre&gt;  &lt;p&gt;Notice that this code has no apparent concern with connecting to a database, verifying the user is logged in, or outputting anything. The controller handles all of this.&lt;/p&gt;  &lt;p&gt;If I wanted to authenticate against LDAP, I could create &lt;code&gt;FR_Auth_LDAP&lt;/code&gt;. The controller could recognize certain output methods (such as &lt;code&gt;$_GET[&#39;output&#39;]&lt;/code&gt;) and switch to the PDF or SOAP presenter on the fly. The event handler, &lt;code&gt;delete&lt;/code&gt;, handles only deleting and nothing else. Because the module has an instance of the &lt;code&gt;FR_User&lt;/code&gt; class, it&#39;s easy to check which groups that user is in, etc. Smarty, the template engine, handles caching, of course, but the controller could also handle some caching.&lt;/p&gt;  &lt;p&gt;Switching from the old way to the MVC way of doing things can be a completely foreign concept to some people, but once you have switched, it&#39;s hard to go back. I know I won&#39;t be leaving the comforts of my MVC framework anytime soon.&lt;/p&gt;  &lt;h4&gt;Creating the Foundation&lt;/h4&gt;  &lt;p&gt;I&#39;m a huge fan of &lt;code&gt;PEAR&lt;/code&gt; and the &lt;code&gt;PEAR_Error&lt;/code&gt; class. PHP 5 introduced a new class, &lt;code&gt;Exception&lt;/code&gt;, which is almost a drop-in replacement for &lt;code&gt;PEAR_Error&lt;/code&gt;. However, &lt;code&gt;PEAR_Error&lt;/code&gt; has a few extra features that make it a more robust solution than &lt;code&gt;Exception&lt;/code&gt;. As a result, the framework and foundation classes will use the &lt;code&gt;PEAR_Error&lt;/code&gt; class for error handling. I will use &lt;code&gt;Exception&lt;/code&gt;, however, to throw errors from the constructors, as they cannot return errors.&lt;/p&gt;  &lt;p&gt;The design goals of the foundation classes are:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;Leverage PEAR to quickly add features to the foundation classes.&lt;/li&gt;&lt;li&gt;Create small, reusable abstract foundation classes that will enable developers to build applications quickly within the framework.&lt;/li&gt;&lt;li&gt;Document all foundation classes using phpDocumentor tags.&lt;/li&gt;&lt;li&gt;Prepend all classes and global variables with &lt;code&gt;FR&lt;/code&gt; to avoid possible variable/class/function collisions.&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;The class hierarchy will look something like this:&lt;/p&gt;  &lt;ul&gt;&lt;li&gt;&lt;code&gt;FR_Object&lt;/code&gt; will provide the basic features that all objects need (including logging, generic &lt;code&gt;setFrom()&lt;/code&gt;, &lt;code&gt;toArray()&lt;/code&gt;).  &lt;ul&gt;&lt;li&gt;&lt;code&gt;FR_Object_DB&lt;/code&gt; is a thin layer to provide child classes a database connection, along with other functions such classes might need.  &lt;ul&gt;&lt;li&gt;&lt;code&gt;FR_Object_Web&lt;/code&gt; is a thin layer that provides session and user information for web-based applications.  &lt;ul&gt;&lt;li&gt;&lt;code&gt;FR_Module&lt;/code&gt; is the base class for all applications (AKA &quot;modules,&quot; &quot;model,&quot; etc.) built in the framework.  &lt;ul&gt;&lt;li&gt;&lt;code&gt;FR_Auth&lt;/code&gt; is the base authentication class, which will allow for multiple authentication mechanisms.  &lt;ul&gt;&lt;li&gt;&lt;code&gt;FR_Auth_User&lt;/code&gt; is an authentication class to use in modules that require a valid, logged-in user.&lt;/li&gt;&lt;li&gt;&lt;code&gt;FR_Auth_No&lt;/code&gt; is a dummy authentication class used for modules that require no authentication.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;FR_Presenter&lt;/code&gt; is the base presentation class (the view) that will handle loading and displaying the applications after they have run.  &lt;ul&gt;&lt;li&gt;&lt;code&gt;FR_Presenter_smarty&lt;/code&gt;: the presentation layer will include the ability to load different drivers. Smarty is a great template class that has built in caching and an active community.&lt;/li&gt;&lt;li&gt;&lt;code&gt;FR_Presenter_debug&lt;/code&gt; is a debugging presentation layer that developers can use to debug applications.&lt;/li&gt;&lt;li&gt;&lt;code&gt;FR_Presenter_rest&lt;/code&gt; is a REST presentation layer that developers can use to output applications in XML.&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;  &lt;p&gt;Looking at the foundation classes, you can start to see the separate parts of the MVC framework. &lt;code&gt;FR_Module&lt;/code&gt; provides for the basic needs of all of the modules (Model), &lt;code&gt;FR_Presenter&lt;/code&gt; provides a way to display applications arbitrarily in different formats (Views). In the next part of this series I will create the controller, which will bring all of our foundation classes together in a single place.&lt;/p&gt;&lt;/span&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/10/mvc-pattern-in-php.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-7630242626990998539</guid><pubDate>Wed, 08 Oct 2008 18:40:00 +0000</pubDate><atom:updated>2013-12-18T10:19:37.218-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interview</category><title>phpinterviewquestions</title><description></description><link>http://gurukanagaraj.blogspot.com/2008/10/phpinterviewquestions.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-5162646506913593582</guid><pubDate>Wed, 08 Oct 2008 18:29:00 +0000</pubDate><atom:updated>2013-12-18T10:19:37.211-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interview</category><title>gurukanagaraj: php questions</title><description>&lt;a href=&quot;http://gurukanagaraj.blogspot.com/2008/06/php-questions.html#comments&quot;&gt;gurukanagaraj: php questions&lt;/a&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/10/gurukanagaraj-php-questions.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-717682066919065210</guid><pubDate>Thu, 25 Sep 2008 17:07:00 +0000</pubDate><atom:updated>2008-09-25T10:27:56.390-07:00</atom:updated><title>SEF vs. SEO</title><description>&lt;p&gt;&lt;span style=&quot;font-size:130%;color:#ffff33;&quot;&gt;&lt;strong&gt;SEF vs. SEO&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;What are the differences between a search engine friendly (SEF) and a search engine optimized (SEO) website? The terms search engine friendly and search engine optimized are talked about all day long, but at the end of the day what businesses want to know is which one is right for them? Here&#39;s how it breaks down. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Search Engine Optimized&lt;/strong&gt;: Search engine companies create rules by which they &quot;rank&quot; sites. The goal of most businesses is to be one of the top ranked businesses when a consumer searches for a product or service - thus increasing the likelihood of converting that search into profit for the business. One of the ways to achieve a higher ranking on a site is to understand the rules set by the search engine companies and try to fit within those rules to the largest extent possible to get a top ranking. For example using carefully researched key words or phrases in text. However, a website that is based solely on the rules in play the day the website is created is at a disadvantage. Search engine companies know that there are people out there who might try to create sham websites simply to make a quick profit. Thus they continue to change their rules to close any loopholes that might exist to insure that these sham sites don&#39;t get a high ranking. These changes require a long term commitment to monitor changing rules to insure the website remains top ranked. This time of commitment is costly to the business because it requires numerous hours of research and changes. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Search Engine Friendly&lt;/strong&gt; The goal of a search engine friendly website is also to help a business maintain a top ranked site. However the means to the ends is quite different. Under the search engine friendly scenario the website is constructed with the consumer rather than the search engine company in mind. A SEF site will have clear navigation, easily understandable language for a wide-range of consumers and corrects all technological issues that can reduce search relevance. The SEF site does not need daily monitoring to keep up with the changing rules of search engine companies. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;--------------------------------------------------------&lt;/p&gt;&lt;p&gt;&lt;strong&gt;SEO vs. SEF&lt;/strong&gt;&lt;br /&gt;Apr 9, 2008 By Kanagaraj in&lt;br /&gt;&lt;a class=&quot;term_link-20&quot; title=&quot;&quot; href=&quot;http://www.innovatingtomorrow.net/categories/internet&quot; rel=&quot;tag&quot;&gt;Internet&lt;/a&gt;&lt;br /&gt;We often use the phrases Search Engine Optimization and Search Engine Friendly interchangeably. In our quests to get the best ranking in Google we&#39;re looking for the tools that will do that for us. But, they don&#39;t actually mean the same thing and the difference matters. Especially, if you are trying to improve your search engine ranking.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Search Engine Friendly&lt;/strong&gt;&lt;br /&gt;SEF is what usually gets talked about. We talk about SEF URLs to our content, semantic web pages that search engines can read, adding meta tags to our pages, and using &lt;a title=&quot;Microformats&quot; href=&quot;http://microformats.org/&quot;&gt;Microformats&lt;/a&gt; to better describe our content. This can and will help web pages be indexed more accurately by search engines.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This is where tools like &lt;a title=&quot;drupal&quot; href=&quot;http://drupal.org/&quot;&gt;drupal&lt;/a&gt;, &lt;a title=&quot;Joomla!&quot; href=&quot;http://www.joomla.com/&quot;&gt;joomla&lt;/a&gt;, and &lt;a title=&quot;Wordpress&quot; href=&quot;http://www.wordpress.org/&quot;&gt;wordpress&lt;/a&gt; live. They can create SEF sites that search engines can easily read and understand.&lt;br /&gt;Search Engine Optimization&lt;/p&gt;&lt;p&gt;&lt;br /&gt;SEO goes beyond SEF into the content itself. For example, SEO deals with looking for the right keywords to use on a piece of content to help it get a higher ranking. The idea is to preform an analysis on the content (e.g., a blog post or article) looking for ways to change the content so search engines will rank the posts higher.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If a tool, like a CMS, claims to do SEO what they really do is SEF.&lt;br /&gt;The difference is important for site owners to know so they don&#39;t stop at implementing a handful of SEF functionality. This is, especially, important for sites like the &lt;a title=&quot;the fshbwl&quot; href=&quot;http://www.fshbwl.com/&quot;&gt;fshbwl&lt;/a&gt; that are just launching and don&#39;t get indexed well simply because they are new.&lt;/p&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/09/sef-vs-seo.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-6277421422228293546</guid><pubDate>Tue, 23 Sep 2008 20:12:00 +0000</pubDate><atom:updated>2008-09-23T13:22:49.410-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">cms</category><category domain="http://www.blogger.com/atom/ns#">forum</category><category domain="http://www.blogger.com/atom/ns#">forums</category><category domain="http://www.blogger.com/atom/ns#">php</category><category domain="http://www.blogger.com/atom/ns#">phpbb</category><category domain="http://www.blogger.com/atom/ns#">phpbb forum</category><title>PHPBB FORUM</title><description>&lt;p&gt;phpBB is a popular &lt;a title=&quot;Internet forum&quot; href=&quot;http://en.wikipedia.org/wiki/Internet_forum&quot;&gt;Internet forum&lt;/a&gt; package written in the &lt;a title=&quot;PHP&quot; href=&quot;http://en.wikipedia.org/wiki/PHP&quot;&gt;PHP&lt;/a&gt; programming language. The name &quot;phpBB&quot; is an abbreviation of PHP Bulletin Board. Available under the &lt;a title=&quot;GNU General Public License&quot; href=&quot;http://en.wikipedia.org/wiki/GNU_General_Public_License&quot;&gt;GNU General Public License&lt;/a&gt;, phpBB is &lt;a title=&quot;Free software&quot; href=&quot;http://en.wikipedia.org/wiki/Free_software&quot;&gt;free software&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;phpBB was started by &lt;a title=&quot;James Atkinson (software developer)&quot; href=&quot;http://en.wikipedia.org/wiki/James_Atkinson_(software_developer)&quot;&gt;James Atkinson&lt;/a&gt; (now a former team member) as a simple &lt;a title=&quot;UBB.classic&quot; href=&quot;http://en.wikipedia.org/wiki/UBB.classic&quot;&gt;UBB&lt;/a&gt;-like forum for his own website on &lt;a title=&quot;June 17&quot; href=&quot;http://en.wikipedia.org/wiki/June_17&quot;&gt;June 17&lt;/a&gt;, &lt;a title=&quot;2000&quot; href=&quot;http://en.wikipedia.org/wiki/2000&quot;&gt;2000&lt;/a&gt;. Nathan Codding and John Abela (both now former team members) joined the development team after phpBB&#39;s &lt;a title=&quot;Concurrent Versions System&quot; href=&quot;http://en.wikipedia.org/wiki/Concurrent_Versions_System&quot;&gt;CVS&lt;/a&gt; repository was moved to &lt;a title=&quot;SourceForge.net&quot; href=&quot;http://en.wikipedia.org/wiki/SourceForge.net&quot;&gt;SourceForge.net&lt;/a&gt;, and work on 1.0.0 began. A fully functional, pre-release version of phpBB was made available in July.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-1&quot;&gt;[2]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;phpBB 1.0.0 was released on &lt;a title=&quot;December 9&quot; href=&quot;http://en.wikipedia.org/wiki/December_9&quot;&gt;December 9&lt;/a&gt;, &lt;a title=&quot;2000&quot; href=&quot;http://en.wikipedia.org/wiki/2000&quot;&gt;2000&lt;/a&gt;, with subsequent improvements to the 1.x codebase coming in two more major installments. The final release in the 1.x line was phpBB 1.4.4, released on &lt;a title=&quot;November 6&quot; href=&quot;http://en.wikipedia.org/wiki/November_6&quot;&gt;November 6&lt;/a&gt;, &lt;a title=&quot;2001&quot; href=&quot;http://en.wikipedia.org/wiki/2001&quot;&gt;2001&lt;/a&gt;. During the lifetime of the 1.x series, Bart van Bragt, &lt;a title=&quot;Paul S. Owen&quot; href=&quot;http://en.wikipedia.org/wiki/Paul_S._Owen&quot;&gt;Paul S. Owen&lt;/a&gt; (former co-manager of the project), Jonathan Haase&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-2&quot;&gt;[3]&lt;/a&gt; (now a former team member) and Frank Feingold joined the team. phpBB 1.x is no longer supported by the phpBB teams, and virtually no websites continue to use it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;phpBB 2.0.x began in February &lt;a title=&quot;2001&quot; href=&quot;http://en.wikipedia.org/wiki/2001&quot;&gt;2001&lt;/a&gt;. It was developed entirely from scratch; the developer&#39;s ambitions for phpBB had outgrown the original &lt;a title=&quot;Codebase&quot; href=&quot;http://en.wikipedia.org/wiki/Codebase&quot;&gt;codebase&lt;/a&gt;. Doug Kelly (now a former team member) joined the team shortly afterwards. After a year of development and extensive testing, phpBB 2.0.0, dubbed the &quot;Super Furry&quot; version, was released on &lt;a title=&quot;April 4&quot; href=&quot;http://en.wikipedia.org/wiki/April_4&quot;&gt;April 4&lt;/a&gt;, &lt;a title=&quot;2002&quot; href=&quot;http://en.wikipedia.org/wiki/2002&quot;&gt;2002&lt;/a&gt;, three days later than intended.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-3&quot;&gt;[4]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;phpBB 3.0.x began in late &lt;a title=&quot;2002&quot; href=&quot;http://en.wikipedia.org/wiki/2002&quot;&gt;2002&lt;/a&gt;. It was originally intended to be released as phpBB 2.2, and the first planned feature list for 2.2 was announced on &lt;a title=&quot;May 25&quot; href=&quot;http://en.wikipedia.org/wiki/May_25&quot;&gt;May 25&lt;/a&gt;, &lt;a title=&quot;2003&quot; href=&quot;http://en.wikipedia.org/wiki/2003&quot;&gt;2003&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-4&quot;&gt;[5]&lt;/a&gt; However, as development progressed, the developers realised that phpBB 2.1.x (the development release cycle for 2.2) had eliminated virtually all compatibility with the 2.0.x line, the version number for release was changed to 3.0.0, in keeping with the &lt;a title=&quot;Linux kernel&quot; href=&quot;http://en.wikipedia.org/wiki/Linux_kernel&quot;&gt;Linux kernel&lt;/a&gt; &lt;a title=&quot;Software versioning&quot; href=&quot;http://en.wikipedia.org/wiki/Software_versioning&quot;&gt;versioning scheme&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-5&quot;&gt;[6]&lt;/a&gt; Since then, the development team has seen many internal changes, and many changes to the phpBB3 code have been made. In September &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt;, Paul Owen resigned as the Development Team Leader and Meik Sievertsen was promoted as the new Development Team Leader.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In March &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;, the phpBB teams had planned to undergo a short round of server maintenance,&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-6&quot;&gt;[7]&lt;/a&gt; however the server crashed during the outage, suffering a double-disk failure and causing phpBB.com to be down for the full week. (The phpBB teams indicated that phpBB, the software, was not the cause of the outage.) However, due to the unexpected outage, the teams decided to change their original plans and launch their brand new website, powered by phpBB3 and the new prosilver theme.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-7&quot;&gt;[8]&lt;/a&gt; This was a big surprise to most, as the theme had been a heavily guarded secret, never before seen by the public, and was originally not intended to be revealed until the final release of phpBB 3.0.0. Initial feedback was split, with many applauding the new theme and others criticising a number of new design decisions, particularly the decision to display the user info on the right side of the viewtopic page (phpBB2&#39;s subSilver theme had displayed it on the left).&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-8&quot;&gt;[9]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;On &lt;a title=&quot;April 30&quot; href=&quot;http://en.wikipedia.org/wiki/April_30&quot;&gt;April 30&lt;/a&gt;, &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;, phpBB founder and co-Project Manager James Atkinson officially resigned from his duties towards phpBB, citing personal circumstances. With the announcement also came the announcement that phpBB was now newly independent, and that the team leaders would be collectively taking charge of the decisions in the future of the project. At the end of May, an announcement was made that Jonathan &quot;SHS`&quot; Stanley, the other co-Project Manager, was stepping down as well for personal reasons.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;On &lt;a title=&quot;July 7&quot; href=&quot;http://en.wikipedia.org/wiki/July_7&quot;&gt;July 7&lt;/a&gt;, &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;, the teams announced that phpBB had been nominated as a finalist for the &lt;a title=&quot;SourceForge.net&quot; href=&quot;http://en.wikipedia.org/wiki/SourceForge.net&quot;&gt;SourceForge.net&lt;/a&gt; &lt;a class=&quot;external text&quot; title=&quot;http://sourceforge.net/community/index.php/landing-pages/cca07/&quot; href=&quot;http://sourceforge.net/community/index.php/landing-pages/cca07/&quot; rel=&quot;nofollow&quot;&gt;Community Choice Awards&lt;/a&gt; in the category of &quot;Best Project for Communications&quot;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-9&quot;&gt;[10]&lt;/a&gt; At the end of the month, SourceForge.net announced that phpBB had won the award for &quot;Best Project for Communications&quot;, and in honour of the award, SourceForge.net donated $1000 in phpBB&#39;s name to &lt;a title=&quot;Marie Curie Cancer Care&quot; href=&quot;http://en.wikipedia.org/wiki/Marie_Curie_Cancer_Care&quot;&gt;Marie Curie Cancer Care&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-10&quot;&gt;[11]&lt;/a&gt; &lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-11&quot;&gt;[12]&lt;/a&gt; phpBB also won a &quot;Thingamagoop&quot; from &lt;a class=&quot;external text&quot; title=&quot;http://www.bleeplabs.com/&quot; href=&quot;http://www.bleeplabs.com/&quot; rel=&quot;nofollow&quot;&gt;Bleep Labs&lt;/a&gt;, and &quot;bragging rights for a full year.&quot;&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-12&quot;&gt;[13]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;On &lt;a title=&quot;September 6&quot; href=&quot;http://en.wikipedia.org/wiki/September_6&quot;&gt;September 6&lt;/a&gt;, &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;, the teams launched the &lt;a class=&quot;external text&quot; title=&quot;http://podcast.phpbb.com&quot; href=&quot;http://podcast.phpbb.com/&quot; rel=&quot;nofollow&quot;&gt;Official phpBB Podcast&lt;/a&gt;. The &lt;a title=&quot;Podcast&quot; href=&quot;http://en.wikipedia.org/wiki/Podcast&quot;&gt;podcast&lt;/a&gt; was recorded by a rotating group of phpBB team members with occasional guests, and discussed a number of phpBB-related topics, as well as answering questions e-mailed in from listeners.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-13&quot;&gt;[14]&lt;/a&gt;&lt;br /&gt;The first beta of phpBB3 was released in June &lt;a title=&quot;2006&quot; href=&quot;http://en.wikipedia.org/wiki/2006&quot;&gt;2006&lt;/a&gt;,&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-14&quot;&gt;[15]&lt;/a&gt; and the first release candidate was released in May &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-15&quot;&gt;[16]&lt;/a&gt; The phpBB3 codebase received an external &lt;a class=&quot;mw-redirect&quot; title=&quot;Security audit&quot; href=&quot;http://en.wikipedia.org/wiki/Security_audit&quot;&gt;security audit&lt;/a&gt; in September, which was done by &lt;a class=&quot;external text&quot; title=&quot;http://www.sektioneins.de/&quot; href=&quot;http://www.sektioneins.de/&quot; rel=&quot;nofollow&quot;&gt;SektionEins&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-autogenerated1-16&quot;&gt;[17]&lt;/a&gt; Finally, after much fanfare, phpBB 3.0.0 &quot;Olympus&quot; (also dubbed the Gold release) was published on &lt;a title=&quot;December 13&quot; href=&quot;http://en.wikipedia.org/wiki/December_13&quot;&gt;December 13&lt;/a&gt;, &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-17&quot;&gt;[18]&lt;/a&gt;&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-18&quot;&gt;[19]&lt;/a&gt;&lt;br /&gt;The teams launched a new &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/blog/&quot; href=&quot;http://www.phpbb.com/blog/&quot; rel=&quot;nofollow&quot;&gt;phpBB Blog&lt;/a&gt; in &lt;a title=&quot;July&quot; href=&quot;http://en.wikipedia.org/wiki/July&quot;&gt;July&lt;/a&gt; &lt;a title=&quot;2008&quot; href=&quot;http://en.wikipedia.org/wiki/2008&quot;&gt;2008&lt;/a&gt;. The blog will be written by phpBB team members on various topics related to phpBB and provide users with a unique inside look at the activities of the phpBB teams.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-19&quot;&gt;[20]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The phpBB teams held their first-ever phpBB users conference in &lt;a title=&quot;London&quot; href=&quot;http://en.wikipedia.org/wiki/London&quot;&gt;London&lt;/a&gt; on &lt;a title=&quot;July 20&quot; href=&quot;http://en.wikipedia.org/wiki/July_20&quot;&gt;July 20&lt;/a&gt;, &lt;a title=&quot;2008&quot; href=&quot;http://en.wikipedia.org/wiki/2008&quot;&gt;2008&lt;/a&gt;, which was titled &quot;Londonvasion 2008.&quot;&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-20&quot;&gt;[21]&lt;/a&gt; Londonvasion featured presentations by phpBB team members on various topics important to the phpBB community, MOD authors, and developers. Londonvasion provided a unique opportunity to socialise with members of the phpBB teams. The event also represented the first time that most members of the teams had a chance to meet each other in person.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;strong&gt;phpBB3&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;a class=&quot;image&quot; title=&quot;Administration Control Panel&quot; href=&quot;http://en.wikipedia.org/wiki/Image:PhpBB3_ACP.png&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;internal&quot; title=&quot;Enlarge&quot; href=&quot;http://en.wikipedia.org/wiki/Image:PhpBB3_ACP.png&quot;&gt;&lt;/a&gt;&lt;strong&gt;Administration Control Panel&lt;/strong&gt;&lt;br /&gt;phpBB3 is the current release of the phpBB bulletin board system. Following an eighteen-month beta/release candidate stage, it went &lt;a title=&quot;Software release life cycle&quot; href=&quot;http://en.wikipedia.org/wiki/Software_release_life_cycle#Gold_or_general_availability_release&quot;&gt;gold&lt;/a&gt; on &lt;a title=&quot;December 13&quot; href=&quot;http://en.wikipedia.org/wiki/December_13&quot;&gt;December 13&lt;/a&gt;, &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt; &lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-21&quot;&gt;[22]&lt;/a&gt;. It contains many new features that are not found in its older sibling, phpBB2. phpBB3 also provides administrators with much more control over every aspect of the forum software, such as how it is displayed to management of user and group permissions. Consequently, this increased functionality makes the administrative interface much more complex, and new users have found it somewhat more intimidating than phpBB2.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;phpBB3&#39;s default theme is called prosilver. During phpBB3&#39;s long development process, prosilver was kept a heavily guarded secret from the public in order to prevent premature copying of the theme and so that it would not spoil the &quot;wow&quot; factor upon the final release of phpBB 3.0.0;&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-22&quot;&gt;[23]&lt;/a&gt; however, the unexpected website downtime of March &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt; prompted the teams to change plans and unveil the new theme early. prosilver includes a number of new design concepts over its predecessor subSilver, including a new admin panel without &lt;a title=&quot;HTML element&quot; href=&quot;http://en.wikipedia.org/wiki/HTML_element#Frames&quot;&gt;frames&lt;/a&gt; and reduced use of &lt;a title=&quot;HTML element&quot; href=&quot;http://en.wikipedia.org/wiki/HTML_element#Tables&quot;&gt;tables&lt;/a&gt;. One of the more contentious decisions has been to move the user info panel on the viewtopic page to the right in order to provide more focus on the post content. Unlike phpBB2, phpBB3 does not allow the use of HTML tags in comments&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-23&quot;&gt;[24]&lt;/a&gt;. A phpBB3 port of the subSilver theme is included with the phpBB3 package and dubbed subsilver2, however an administrator must install it on the board themselves before it is accessible to users.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;For the first time, the teams will be quietly pushing out release candidates of minor updates of phpBB3 for &quot;quality assurance testing&quot; prior to general release.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-24&quot;&gt;[25]&lt;/a&gt; These candidates are intended to prevent the possibility of significant bugs being produced by minor updates, thus causing a subsequent critical update to be released within days of the original. (This scenario happened twice during the 2.0.x line and once during phpBB&#39;s release candidate stage in &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;.) A &lt;a class=&quot;external text&quot; title=&quot;http://code.phpbb.com/mailman/listinfo/phpbb-qa&quot; href=&quot;http://code.phpbb.com/mailman/listinfo/phpbb-qa&quot; rel=&quot;nofollow&quot;&gt;mailing list&lt;/a&gt; is open to anyone interested in testing these &quot;quality assurance&quot; releases when they are available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The latest in the 3.x line is phpBB 3.0.2, &lt;a title=&quot;Code name&quot; href=&quot;http://en.wikipedia.org/wiki/Code_name&quot;&gt;code named&lt;/a&gt; &quot;Olympus&quot;, released on &lt;a title=&quot;July 10&quot; href=&quot;http://en.wikipedia.org/wiki/July_10&quot;&gt;July 10&lt;/a&gt;, &lt;a title=&quot;2008&quot; href=&quot;http://en.wikipedia.org/wiki/2008&quot;&gt;2008&lt;/a&gt;&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-25&quot;&gt;[26]&lt;/a&gt;. phpBB3 requires &lt;a title=&quot;PHP&quot; href=&quot;http://en.wikipedia.org/wiki/PHP&quot;&gt;PHP&lt;/a&gt; 4.3.3 or later and is fully compatible with PHP 5.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Some of phpBB3&#39;s major features include:&lt;/strong&gt;&lt;br /&gt;Modular design for the Admin Control Panel, Moderator Control Panel, and User Control Panel&lt;br /&gt;Support for multiple &lt;a class=&quot;mw-redirect&quot; title=&quot;Database management systems&quot; href=&quot;http://en.wikipedia.org/wiki/Database_management_systems&quot;&gt;database management systems&lt;/a&gt;, including &lt;a title=&quot;MySQL&quot; href=&quot;http://en.wikipedia.org/wiki/MySQL&quot;&gt;MySQL&lt;/a&gt;, &lt;a title=&quot;Microsoft SQL Server&quot; href=&quot;http://en.wikipedia.org/wiki/Microsoft_SQL_Server&quot;&gt;Microsoft SQL Server&lt;/a&gt;, &lt;a class=&quot;mw-redirect&quot; title=&quot;Oracle database&quot; href=&quot;http://en.wikipedia.org/wiki/Oracle_database&quot;&gt;Oracle&lt;/a&gt;, &lt;a title=&quot;PostgreSQL&quot; href=&quot;http://en.wikipedia.org/wiki/PostgreSQL&quot;&gt;PostgreSQL&lt;/a&gt;, &lt;a title=&quot;SQLite&quot; href=&quot;http://en.wikipedia.org/wiki/SQLite&quot;&gt;SQLite&lt;/a&gt;, &lt;a title=&quot;Firebird (database server)&quot; href=&quot;http://en.wikipedia.org/wiki/Firebird_(database_server)&quot;&gt;Firebird&lt;/a&gt;, &lt;a title=&quot;Virtuoso Universal Server&quot; href=&quot;http://en.wikipedia.org/wiki/Virtuoso_Universal_Server&quot;&gt;OpenLink Virtuoso&lt;/a&gt;, and other &lt;a class=&quot;mw-redirect&quot; title=&quot;ODBC&quot; href=&quot;http://en.wikipedia.org/wiki/ODBC&quot;&gt;ODBC&lt;/a&gt;-accessible DBMS&lt;br /&gt;Support for unlimited levels of &lt;a class=&quot;new&quot; title=&quot;Subforums (page does not exist)&quot; href=&quot;http://en.wikipedia.org/w/index.php?title=Subforums&amp;amp;action=edit&amp;amp;redlink=1&quot;&gt;subforums&lt;/a&gt;&lt;br /&gt;Ability to create custom-defined &lt;a title=&quot;BBCode&quot; href=&quot;http://en.wikipedia.org/wiki/BBCode&quot;&gt;BBCode&lt;/a&gt;&lt;br /&gt;Ability to create custom profile fields&lt;br /&gt;&lt;a class=&quot;mw-redirect&quot; title=&quot;Permissions&quot; href=&quot;http://en.wikipedia.org/wiki/Permissions&quot;&gt;Permissions&lt;/a&gt; system&lt;br /&gt;The phpBB website includes a &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/about/features/&quot; href=&quot;http://www.phpbb.com/about/features/&quot; rel=&quot;nofollow&quot;&gt;non-exhaustive list of phpBB3 features&lt;/a&gt;. A &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/about/features/compare.php&quot; href=&quot;http://www.phpbb.com/about/features/compare.php&quot; rel=&quot;nofollow&quot;&gt;comparison page&lt;/a&gt; is also available on their website, comparing the features between phpBB3 and other bulletin board systems.&lt;br /&gt;Support for phpBB3 can be obtained in the official &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/community/viewforum.php?f=&quot; href=&quot;http://www.phpbb.com/community/viewforum.php?f=46&quot; rel=&quot;nofollow&quot;&gt;phpBB3 Support forum&lt;/a&gt;. &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/support/documentation/3.0/&quot; href=&quot;http://www.phpbb.com/support/documentation/3.0/&quot; rel=&quot;nofollow&quot;&gt;Full documentation&lt;/a&gt;, &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/support/tutorials/3.0/&quot; href=&quot;http://www.phpbb.com/support/tutorials/3.0/&quot; rel=&quot;nofollow&quot;&gt;flash tutorials&lt;/a&gt;, and a &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/kb/3.0/&quot; href=&quot;http://www.phpbb.com/kb/3.0/&quot; rel=&quot;nofollow&quot;&gt;knowledge base&lt;/a&gt; are also available.&lt;br /&gt;&lt;a id=&quot;phpBB2&quot; name=&quot;phpBB2&quot;&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;phpBB2&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;a class=&quot;image&quot; title=&quot;A default installation of phpBB 2.0.&quot; href=&quot;http://en.wikipedia.org/wiki/Image:PhpBB_2.0.png&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;a class=&quot;internal&quot; title=&quot;Enlarge&quot; href=&quot;http://en.wikipedia.org/wiki/Image:PhpBB_2.0.png&quot;&gt;&lt;/a&gt;A default installation of phpBB 2.0.&lt;br /&gt;phpBB2 is the older of the two packages supported by the phpBB teams. phpBB&#39;s website currently refers to it as the &quot;legacy release.&quot; It contains far fewer features than its younger counterpart, phpBB3, and also includes an older codebase, supporting &lt;a title=&quot;PHP&quot; href=&quot;http://en.wikipedia.org/wiki/PHP&quot;&gt;PHP&lt;/a&gt; 4.0.3 and later. Although most users report no problems running it on PHP 5, the phpBB teams currently do not officially offer support for this configuration.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-26&quot;&gt;[27]&lt;/a&gt; However, many administrators still prefer to run phpBB2 because it provides a much simpler administration interface and has a thriving ecosystem of MODs (modifications) and styles that allow admins many options for customising the software to their liking. Some administrators still run phpBB2 because they have installed so many MODs that they cannot upgrade their board without resetting it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The default theme in phpBB2 is named subSilver, and was designed by &lt;a class=&quot;new&quot; title=&quot;Tom Beddard (page does not exist)&quot; href=&quot;http://en.wikipedia.org/w/index.php?title=Tom_Beddard&amp;amp;action=edit&amp;amp;redlink=1&quot;&gt;Tom &quot;subBlue&quot; Beddard&lt;/a&gt;. At the time that it premiered in &lt;a title=&quot;2001&quot; href=&quot;http://en.wikipedia.org/wiki/2001&quot;&gt;2001&lt;/a&gt;, it was a revolutionary new design for bulletin boards, and many bulletin board themes since have borrowed many cues and design elements from subSilver.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The latest release in the 2.0.x line is 2.0.23 which was released on &lt;a title=&quot;February 17&quot; href=&quot;http://en.wikipedia.org/wiki/February_17&quot;&gt;February 17&lt;/a&gt;, &lt;a title=&quot;2008&quot; href=&quot;http://en.wikipedia.org/wiki/2008&quot;&gt;2008&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-27&quot;&gt;[28]&lt;/a&gt; Releases in the 2.0.x line are restricted to security fixes only.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Some of phpBB2&#39;s major features include the following:&lt;br /&gt;&lt;/strong&gt;A &lt;a title=&quot;Template engine&quot; href=&quot;http://en.wikipedia.org/wiki/Template_engine&quot;&gt;templated&lt;/a&gt; style system intended to allow easy customisation that keeps the &lt;a title=&quot;PHP&quot; href=&quot;http://en.wikipedia.org/wiki/PHP&quot;&gt;PHP&lt;/a&gt; code separate from the &lt;a title=&quot;HTML&quot; href=&quot;http://en.wikipedia.org/wiki/HTML&quot;&gt;HTML&lt;/a&gt;.&lt;br /&gt;Support for &lt;a class=&quot;mw-redirect&quot; title=&quot;Internationalisation&quot; href=&quot;http://en.wikipedia.org/wiki/Internationalisation&quot;&gt;internationalisation&lt;/a&gt; through a language pack system; 48 translations are available for phpBB2 as of &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-28&quot;&gt;[29]&lt;/a&gt;&lt;br /&gt;Compatibility with multiple &lt;a title=&quot;Database management system&quot; href=&quot;http://en.wikipedia.org/wiki/Database_management_system&quot;&gt;database management systems&lt;/a&gt; including &lt;a title=&quot;MySQL&quot; href=&quot;http://en.wikipedia.org/wiki/MySQL&quot;&gt;MySQL&lt;/a&gt;, &lt;a title=&quot;PostgreSQL&quot; href=&quot;http://en.wikipedia.org/wiki/PostgreSQL&quot;&gt;PostgreSQL&lt;/a&gt;, &lt;a title=&quot;Microsoft SQL Server&quot; href=&quot;http://en.wikipedia.org/wiki/Microsoft_SQL_Server&quot;&gt;Microsoft SQL Server&lt;/a&gt;, and &lt;a title=&quot;Microsoft Access&quot; href=&quot;http://en.wikipedia.org/wiki/Microsoft_Access&quot;&gt;Microsoft Access&lt;/a&gt;,&lt;br /&gt;A large community of users providing free support and customisations, including MODs and styles. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Support for phpBB2 can be obtained in the official &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/community/viewforum.php?f=&quot; href=&quot;http://www.phpbb.com/community/viewforum.php?f=1&quot; rel=&quot;nofollow&quot;&gt;phpBB2 Support forum&lt;/a&gt; and the unofficial &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb2-support.com/&quot; href=&quot;http://www.phpbb2-support.com/&quot; rel=&quot;nofollow&quot;&gt;phpBB2 Support&lt;/a&gt; boards. &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/support/documentation/2.0/&quot; href=&quot;http://www.phpbb.com/support/documentation/2.0/&quot; rel=&quot;nofollow&quot;&gt;Full documentation&lt;/a&gt;, &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/support/tutorials/2.0/&quot; href=&quot;http://www.phpbb.com/support/tutorials/2.0/&quot; rel=&quot;nofollow&quot;&gt;flash tutorials&lt;/a&gt;, and a &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/kb/2.0/&quot; href=&quot;http://www.phpbb.com/kb/2.0/&quot; rel=&quot;nofollow&quot;&gt;knowledge base&lt;/a&gt; are also available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;phpBB2 is currently in the process of being slowly retired by the phpBB teams, and all official support for phpBB2 (other than converting from 2.0.x to 3.0.x) will be discontinued on &lt;a title=&quot;January 1&quot; href=&quot;http://en.wikipedia.org/wiki/January_1&quot;&gt;January 1&lt;/a&gt;, &lt;a title=&quot;2009&quot; href=&quot;http://en.wikipedia.org/wiki/2009&quot;&gt;2009&lt;/a&gt;. Security patches will continue to be released, if required, until &lt;a title=&quot;February 1&quot; href=&quot;http://en.wikipedia.org/wiki/February_1&quot;&gt;February 1&lt;/a&gt;, &lt;a title=&quot;2009&quot; href=&quot;http://en.wikipedia.org/wiki/2009&quot;&gt;2009&lt;/a&gt;, after which the teams will cease all development on phpBB2. The MODs and Styles Teams will similarly be dropping support for phpBB2 MODs and Styles on a similar timetable.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-29&quot;&gt;[30]&lt;/a&gt;&lt;br /&gt;&lt;a id=&quot;Future_development&quot; name=&quot;Future_development&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Future development&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;The Development Team has begun working on phpBB 3.1.x, the development line for phpBB 3.2. Planned features have not yet been officially announced, however the teams have revealed&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-30&quot;&gt;[31]&lt;/a&gt; that the new version will include a new events system, a completely rewritten &lt;a title=&quot;BBCode&quot; href=&quot;http://en.wikipedia.org/wiki/BBCode&quot;&gt;BBCode&lt;/a&gt; system, &lt;a title=&quot;RSS&quot; href=&quot;http://en.wikipedia.org/wiki/RSS&quot;&gt;RSS&lt;/a&gt; feed support, the ability to edit the FAQ, and more. The phpBB teams maintain a website for phpBB development at &lt;a class=&quot;external text&quot; title=&quot;http://area51.phpbb.com&quot; href=&quot;http://area51.phpbb.com/&quot; rel=&quot;nofollow&quot;&gt;Area51&lt;/a&gt;. The teams have also revealed that phpBB 3.2 will be code-named &quot;Ascraeus,&quot; named after &lt;a title=&quot;Ascraeus Mons&quot; href=&quot;http://en.wikipedia.org/wiki/Ascraeus_Mons&quot;&gt;Ascraeus Mons&lt;/a&gt;, the second tallest mountain on &lt;a title=&quot;Mars&quot; href=&quot;http://en.wikipedia.org/wiki/Mars&quot;&gt;Mars&lt;/a&gt;. (&lt;a title=&quot;Olympus Mons&quot; href=&quot;http://en.wikipedia.org/wiki/Olympus_Mons&quot;&gt;Olympus Mons&lt;/a&gt;, which 3.0 was named after, is the tallest.)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Current developers are:&lt;br /&gt;Acyd Burn - (Meik Sievertsen)&lt;br /&gt;APTX - (Marek A. R.)&lt;br /&gt;DavidMJ - (David M.)&lt;br /&gt;Kellanved - (Henry Sudhof)&lt;br /&gt;naderman - (Nils Adermann)&lt;br /&gt;ToonArmy - (Chris Smith)&lt;br /&gt;Vic D&#39;Elfant - (Vic D&#39;Elfant)&lt;br /&gt;&lt;/strong&gt;&lt;a id=&quot;MODs&quot; name=&quot;MODs&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;MODs&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;MODs are code modifications created by the phpBB community, often used to extend the functionality of or change the display of phpBB. The term is capitalised to distinguish modifications from &lt;a title=&quot;Forum moderator&quot; href=&quot;http://en.wikipedia.org/wiki/Forum_moderator&quot;&gt;forum moderators&lt;/a&gt;. Modifications referred to in this manner are not authored by the phpBB developers, and do not enjoy the same level of support as unmodified official code. The phpBB MOD Team accepts modifications from community sources for validation, and modifications which meet the MOD Team&#39;s standards are made available for download from the phpBB &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/mods/db/&quot; href=&quot;http://www.phpbb.com/mods/db/&quot; rel=&quot;nofollow&quot;&gt;MOD Database&lt;/a&gt;. Other sites also provide phpBB2 and phpBB3 modifications for download. Some of the sites have their own standards which they validate to, and other sites do not do any validation, however the phpBB teams do not offer support for boards using MODs downloaded from sites other than phpBB.com. &lt;a class=&quot;external text&quot; title=&quot;http://www.phpbb.com/mods/documentation/&quot; href=&quot;http://www.phpbb.com/mods/documentation/&quot; rel=&quot;nofollow&quot;&gt;Documentation for phpBB3 MODding&lt;/a&gt; is provided by the MOD Team.&lt;br /&gt;&lt;a id=&quot;Security&quot; name=&quot;Security&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Security&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;In December &lt;a title=&quot;2004&quot; href=&quot;http://en.wikipedia.org/wiki/2004&quot;&gt;2004&lt;/a&gt;, a large number of Web sites were defaced by the &lt;a title=&quot;Santy&quot; href=&quot;http://en.wikipedia.org/wiki/Santy&quot;&gt;Santy&lt;/a&gt; worm, which used vulnerabilities in outdated versions of phpBB2 to overwrite PHP and HTML pages.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-31&quot;&gt;[32]&lt;/a&gt; Although these were the result of outdated versions of PHP and phpBB, incidents like these have caused the security of phpBB to be disputed. There have also been a few times where new releases of phpBB have come out a few days apart, although the last occurrence of this was in early 2005.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-32&quot;&gt;[33]&lt;/a&gt; However, the phpBB Team usually responds to security reports as soon as possible, and releases a new version quickly. The phpBB Group has also learned from a series of security issues, and phpBB 2.0.18 was released following a codebase security audit.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-33&quot;&gt;[34]&lt;/a&gt; The phpBB 3.0.x codebase has also received a security audit, which resulted in the release of phpBB 3.0 RC6.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-34&quot;&gt;[35]&lt;/a&gt;&lt;br /&gt;Additionally, many things have been changed in phpBB2 to avoid problems in the future, including many features backported from the phpBB3 codebase. Among those are a re-authentication system for the administration panel (introduced after a cookie verification issue allowed attackers to gain administrator access&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-35&quot;&gt;[36]&lt;/a&gt;), a visual confirmation system (&lt;a title=&quot;CAPTCHA&quot; href=&quot;http://en.wikipedia.org/wiki/CAPTCHA&quot;&gt;CAPTCHA&lt;/a&gt;) to prevent bots from registering, as well as the substitution of the highlighting code, which was the cause for critical vulnerabilities in phpBB 2.0.10 and 2.0.15. In order to keep boards as secure as possible, administrators are urged by the teams to keep their board updated to the latest version.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In November &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt;, the phpBB Group announced a new Incident Investigation Team (IIT), a sub-team of their Support Team, which is responsible for assisting users in the cleanup and repair of an attacked phpBB installation and investigating reports of new exploits.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-36&quot;&gt;[37]&lt;/a&gt; The team announced a tracker the following January where administrators of attacked bulletin boards could report an attack and receive support from the IIT.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-37&quot;&gt;[38]&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The CAPTCHA system in phpBB2 has proven vulnerable to automated registrations, with numerous phpBB-based forums being swamped by spam registrations. Due to the feature freeze, the antispam solutions have to be installed separately. The phpBB team has published recommendations&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-38&quot;&gt;[39]&lt;/a&gt; on protecting the boards from spam. At the moment, the best method is to use a question-answer challenge, implemented by Textual Confirmation or Registration Auth Code MODs.[&lt;a title=&quot;Wikipedia:Citation needed&quot; href=&quot;http://en.wikipedia.org/wiki/Wikipedia:Citation_needed&quot;&gt;citation needed&lt;/a&gt;] phpBB3 has a much stronger CAPTCHA system, however during the phpBB3 development/beta phase it was frequently criticised for being difficult to read.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-39&quot;&gt;[40]&lt;/a&gt; The development team, however, has been working on improving its readability prior to phpBB3&#39;s final release.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;phpBB3 has enjoyed additional attention from the teams in the area of security, and was completely rewritten to have a more secure code base than phpBB2. The phpBB3 codebase received an external &lt;a class=&quot;mw-redirect&quot; title=&quot;Security audit&quot; href=&quot;http://en.wikipedia.org/wiki/Security_audit&quot;&gt;security audit&lt;/a&gt; in September &lt;a title=&quot;2007&quot; href=&quot;http://en.wikipedia.org/wiki/2007&quot;&gt;2007&lt;/a&gt;, which was done by &lt;a class=&quot;external text&quot; title=&quot;http://www.sektioneins.de/&quot; href=&quot;http://www.sektioneins.de/&quot; rel=&quot;nofollow&quot;&gt;SektionEins&lt;/a&gt;. The sixth release candidate of phpBB3 was published following the results of the security audit.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-autogenerated1-16&quot;&gt;[17]&lt;/a&gt; Additionally, the teams have announced that each minor release of phpBB3 (3.0.1, 3.0.2, etc.) will be preceded by individual release candidates in an effort to prevent instances where subsequent releases would be only days apart (as happened a couple of times during the 2.0.x line).&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Phpbb#cite_note-40&quot;&gt;[41]&lt;/a&gt;&lt;/p&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/09/phpbb-forum.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-2671641412535750075</guid><pubDate>Tue, 23 Sep 2008 20:09:00 +0000</pubDate><atom:updated>2008-09-23T13:10:26.528-07:00</atom:updated><title>CMS</title><description>&lt;p&gt;A content management system (CMS) is a computer application used to create, edit, manage, and publish &lt;a title=&quot;Content (media and publishing)&quot; href=&quot;http://en.wikipedia.org/wiki/Content_(media_and_publishing)&quot;&gt;content&lt;/a&gt; in a consistently organized fashion.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Content_management_system#cite_note-0&quot;&gt;[1]&lt;/a&gt; CMSs are frequently used for storing, controlling, versioning, and publishing industry-specific documentation such as news articles, operators&#39; manuals, technical manuals, sales guides, and marketing brochures. The content managed may include &lt;a title=&quot;Computer file&quot; href=&quot;http://en.wikipedia.org/wiki/Computer_file&quot;&gt;computer files&lt;/a&gt;, &lt;a title=&quot;Image&quot; href=&quot;http://en.wikipedia.org/wiki/Image&quot;&gt;image&lt;/a&gt; media, &lt;a class=&quot;mw-redirect&quot; title=&quot;Audio file&quot; href=&quot;http://en.wikipedia.org/wiki/Audio_file&quot;&gt;audio files&lt;/a&gt;, video files, &lt;a title=&quot;Electronic document&quot; href=&quot;http://en.wikipedia.org/wiki/Electronic_document&quot;&gt;electronic documents&lt;/a&gt;, and &lt;a title=&quot;Web content&quot; href=&quot;http://en.wikipedia.org/wiki/Web_content&quot;&gt;Web content&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;A CMS may support the following features:&lt;/strong&gt;&lt;br /&gt;identification of all key users and their content management roles;&lt;br /&gt;the ability to assign roles and responsibilities to different content categories or types;&lt;br /&gt;definition of &lt;a title=&quot;Workflow&quot; href=&quot;http://en.wikipedia.org/wiki/Workflow&quot;&gt;workflow&lt;/a&gt; tasks for collaborative creation, often coupled with event messaging so that content managers are alerted to changes in content (For example, a content creator submits a story, which is published only after the copy editor revises it and the editor-in-chief approves it.);&lt;br /&gt;the ability to track and manage multiple versions of a single instance of content;&lt;br /&gt;the ability to capture content (e.g. scanning);&lt;br /&gt;the ability to publish the content to a repository to support access to the content (Increasingly, the repository is an inherent part of the system, and incorporates &lt;a title=&quot;Enterprise search&quot; href=&quot;http://en.wikipedia.org/wiki/Enterprise_search&quot;&gt;enterprise search&lt;/a&gt; and retrieval.);&lt;br /&gt;separation of content&#39;s semantic layer from its layout (For example, the CMS may automatically set the color, fonts, or &lt;a title=&quot;Emphasis (typography)&quot; href=&quot;http://en.wikipedia.org/wiki/Emphasis_(typography)&quot;&gt;emphasis&lt;/a&gt; of text.). &lt;/p&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/09/cms.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-1522244011076294834</guid><pubDate>Tue, 23 Sep 2008 19:17:00 +0000</pubDate><atom:updated>2008-09-23T13:09:31.530-07:00</atom:updated><title>Joomla</title><description>&lt;div align=&quot;left&quot;&gt;&lt;span style=&quot;font-size:180%;color:#ffcc99;&quot;&gt;&lt;strong&gt;JOOMLA&lt;/strong&gt;&lt;/span&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;color:#ffcc66;&quot;&gt;What is joomla?&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;br /&gt;Joomla™ is a free content management system used to create websites. Joomla™ allows web designers to construct sites by combining modules, and requires no knowledge of programming to use. Joomla™&#39;s framework is written in PHP, as are the modules used to customize websites. There is a wide variety of modules available, including RSS feeds, polls, and language &lt;a href=&quot;http://www.wisegeek.com/what-is-internationalization.htm&quot;&gt;internationalization&lt;/a&gt;, which make it easy for Joomla™ users to publish content to the web, even with minimal &lt;a href=&quot;http://www.wisegeek.com/what-is-web-design.htm&quot;&gt;web design&lt;/a&gt; experience. Joomla™ can also be used to publish information on &lt;a href=&quot;http://www.wisegeek.com/what-is-an-intranet.htm&quot;&gt;intranets&lt;/a&gt;, making it a useful organizational tool. &lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;br /&gt;Because Joomla™&#39;s code is &lt;a href=&quot;http://www.wisegeek.com/what-is-open-source.htm&quot;&gt;open source&lt;/a&gt;, anyone is able to write modules and extensions of the system, making it extremely adaptable. These modules are available for download, typically through their creators&#39; websites. Many web designers also create Joomla™ design elements, called &#39;themes&#39;, which they then make available for download. Not all Joomla™ themes are free, however, and many web designers will make custom themes for a price. &lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;br /&gt;Joomla™ is often compared to &lt;a href=&quot;http://www.wisegeek.com/what-is-drupal.htm&quot;&gt;Drupal&lt;/a&gt;, another open source content management system. Joomla™ is often described as easier to use, initially, but Drupal seems to be more adaptable if a user is able to handle the technical issues. One of Joomla™key features is its graphical interface, which has less of a learning curve than Drupals menu system. &lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;br /&gt;The name &#39;Joomla&#39; is a &lt;a href=&quot;http://www.wisegeek.com/what-is-transliteration.htm&quot;&gt;transliteration&lt;/a&gt; of a &lt;a href=&quot;http://www.wisegeek.com/what-is-swahili.htm&quot;&gt;Swahili&lt;/a&gt; word meaning &#39;all together&#39; or &#39;as a whole.&#39; It was selected as part of a re-branding process for software originally developed as part of the &lt;a href=&quot;http://www.wisegeek.com/what-is-the-mambo.htm&quot;&gt;Mambo&lt;/a&gt; content management system. Mambo was the center of controversy questioning what constituted open source software, and members of the foundation charged with funding the project were accused of planning a capitalization venture. Mambo&#39;s development team, in turn, left the project and released the first version of Joomla™ — essentially Mambo version 4.5.2.3 — in 2005.&lt;/div&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;/div&gt;&lt;div align=&quot;left&quot;&gt;*********************************************************************&lt;/div&gt;&lt;div align=&quot;left&quot;&gt; &lt;/div&gt;&lt;div align=&quot;left&quot;&gt;&lt;/div&gt;Joomla! is a &lt;a title=&quot;Free software&quot; href=&quot;http://en.wikipedia.org/wiki/Free_software&quot;&gt;free&lt;/a&gt; &lt;a title=&quot;Open source software&quot; href=&quot;http://en.wikipedia.org/wiki/Open_source_software&quot;&gt;open source&lt;/a&gt; &lt;a title=&quot;Content management system&quot; href=&quot;http://en.wikipedia.org/wiki/Content_management_system&quot;&gt;content management system&lt;/a&gt; for publishing content on the &lt;a title=&quot;World Wide Web&quot; href=&quot;http://en.wikipedia.org/wiki/World_Wide_Web&quot;&gt;World Wide Web&lt;/a&gt; and &lt;a title=&quot;Intranet&quot; href=&quot;http://en.wikipedia.org/wiki/Intranet&quot;&gt;intranets&lt;/a&gt;. The system includes features such as page &lt;a title=&quot;Cache&quot; href=&quot;http://en.wikipedia.org/wiki/Cache&quot;&gt;caching&lt;/a&gt; to improve performance, &lt;a class=&quot;mw-redirect&quot; title=&quot;RSS (file format)&quot; href=&quot;http://en.wikipedia.org/wiki/RSS_(file_format)&quot;&gt;RSS&lt;/a&gt; feeds, printable versions of pages, news flashes, &lt;a class=&quot;mw-redirect&quot; title=&quot;Blogs&quot; href=&quot;http://en.wikipedia.org/wiki/Blogs&quot;&gt;blogs&lt;/a&gt;, &lt;a title=&quot;Opinion poll&quot; href=&quot;http://en.wikipedia.org/wiki/Opinion_poll&quot;&gt;polls&lt;/a&gt;, website searching, and &lt;a title=&quot;Internationalization and localization&quot; href=&quot;http://en.wikipedia.org/wiki/Internationalization_and_localization&quot;&gt;language internationalization&lt;/a&gt;. Joomla is licensed under the &lt;a title=&quot;GNU General Public License&quot; href=&quot;http://en.wikipedia.org/wiki/GNU_General_Public_License&quot;&gt;GPL&lt;/a&gt;, and is the result of a &lt;a title=&quot;Fork (software development)&quot; href=&quot;http://en.wikipedia.org/wiki/Fork_(software_development)&quot;&gt;fork&lt;/a&gt; of &lt;a class=&quot;mw-redirect&quot; title=&quot;Mambo (CMS)&quot; href=&quot;http://en.wikipedia.org/wiki/Mambo_(CMS)&quot;&gt;Mambo&lt;/a&gt;.&lt;br /&gt;The name Joomla officially ends with an exclamation mark, but this is commonly omitted.&lt;br /&gt;It is written in the &lt;a title=&quot;PHP&quot; href=&quot;http://en.wikipedia.org/wiki/PHP&quot;&gt;PHP&lt;/a&gt; programming language and uses the &lt;a title=&quot;MySQL&quot; href=&quot;http://en.wikipedia.org/wiki/MySQL&quot;&gt;MySQL&lt;/a&gt; database by default.&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#00cccc;&quot;&gt;History&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Joomla came into being as the result of a &lt;a title=&quot;Fork (software development)&quot; href=&quot;http://en.wikipedia.org/wiki/Fork_(software_development)&quot;&gt;fork&lt;/a&gt; of &lt;a class=&quot;mw-redirect&quot; title=&quot;Mambo (CMS)&quot; href=&quot;http://en.wikipedia.org/wiki/Mambo_(CMS)&quot;&gt;Mambo&lt;/a&gt; by the development team on &lt;a title=&quot;August 17&quot; href=&quot;http://en.wikipedia.org/wiki/August_17&quot;&gt;August 17&lt;/a&gt;, &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt;. At that time, the Mambo name was trademarked by Miro International Pty Ltd, who formed a &lt;a class=&quot;mw-redirect&quot; title=&quot;Non-profit&quot; href=&quot;http://en.wikipedia.org/wiki/Non-profit&quot;&gt;non-profit&lt;/a&gt; &lt;a class=&quot;mw-redirect&quot; title=&quot;Foundation (charity)&quot; href=&quot;http://en.wikipedia.org/wiki/Foundation_(charity)&quot;&gt;foundation&lt;/a&gt; with the stated purpose to fund the project and protect it from lawsuits.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-0&quot;&gt;[1]&lt;/a&gt; The development team claimed that many of the provisions of the foundation structure went against previous agreements made by the elected Mambo Steering Committee, lacked the necessary consultation with key stake holders, and included provisions that violated core &lt;a title=&quot;Open source software&quot; href=&quot;http://en.wikipedia.org/wiki/Open_source_software&quot;&gt;open source&lt;/a&gt; values.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-1&quot;&gt;[2]&lt;/a&gt;&lt;br /&gt;The development team created a web site called OpenSourceMatters to distribute information to users, developers, web designers, and the community in general. The project team leader Andrew Eddie, a.k.a. &quot;MasterChief&quot; wrote an open letter to the community&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-2&quot;&gt;[3]&lt;/a&gt; which appeared on the announcements section of the public forum at mamboserver.com.&lt;br /&gt;A thousand people had joined the opensourcematters.org web site within a day, most posting words of encouragement and support. The web site received the &lt;a title=&quot;Slashdot effect&quot; href=&quot;http://en.wikipedia.org/wiki/Slashdot_effect&quot;&gt;slashdot effect&lt;/a&gt; as a result. Miro CEO Peter Lamont gave a public response to the development team in an article entitled &quot;The Mambo Open Source Controversy - 20 Questions With Miro&quot;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-3&quot;&gt;[4]&lt;/a&gt;&lt;br /&gt;This event stirred deeply within the &lt;a title=&quot;Free software community&quot; href=&quot;http://en.wikipedia.org/wiki/Free_software_community&quot;&gt;free software community&lt;/a&gt; regarding what constitutes &quot;open source&quot;. Forums at many other open source projects were active with postings for and against the actions of both sides.&lt;br /&gt;In the two weeks following Eddie&#39;s announcement, teams were re-organized and the community continued to grow. &lt;a title=&quot;Eben Moglen&quot; href=&quot;http://en.wikipedia.org/wiki/Eben_Moglen&quot;&gt;Eben Moglen&lt;/a&gt; and the &lt;a title=&quot;Software Freedom Law Center&quot; href=&quot;http://en.wikipedia.org/wiki/Software_Freedom_Law_Center&quot;&gt;Software Freedom Law Center&lt;/a&gt; (SFLC) assisted the Joomla core team beginning in August 2005, as indicated by Moglen&#39;s &lt;a class=&quot;external text&quot; title=&quot;http://emoglen.law.columbia.edu/blog/2005/08/index.html&quot; href=&quot;http://emoglen.law.columbia.edu/blog/2005/08/index.html&quot; rel=&quot;nofollow&quot;&gt;blog entry from that date&lt;/a&gt; and a related &lt;a class=&quot;external text&quot; title=&quot;http://www.opensourcematters.com/index.php?option=&quot; href=&quot;http://www.opensourcematters.com/index.php?option=com_content&amp;amp;task=view&amp;amp;id=41&amp;amp;Itemid=1&quot; rel=&quot;nofollow&quot; task=&quot;view&amp;amp;id=&quot; itemid=&quot;1&quot;&gt;OSM announcement&lt;/a&gt;. The SFLC &lt;a class=&quot;external text&quot; title=&quot;http://www.joomla.org/content/view/40/41/&quot; href=&quot;http://www.joomla.org/content/view/40/41/&quot; rel=&quot;nofollow&quot;&gt;continue&lt;/a&gt; to provide legal guidance to Joomla project.&lt;br /&gt;On &lt;a title=&quot;August 18&quot; href=&quot;http://en.wikipedia.org/wiki/August_18&quot;&gt;August 18&lt;/a&gt;, &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt;, Andrew Eddie &lt;a class=&quot;external text&quot; title=&quot;http://forum.joomla.org/viewtopic.php?f=&quot; href=&quot;http://forum.joomla.org/viewtopic.php?f=124&amp;amp;t=272&quot; rel=&quot;nofollow&quot; t=&quot;272&quot;&gt;called for community input&lt;/a&gt; on suggested names for the project. The core team indicated that it would make the final decision for the project name based on &lt;a class=&quot;external text&quot; title=&quot;http://forum.joomla.org/viewtopic.php?f=&quot; href=&quot;http://forum.joomla.org/viewtopic.php?f=124&amp;amp;t=272&amp;amp;&amp;amp;start=600#p20658&quot; rel=&quot;nofollow&quot; t=&quot;272&amp;amp;&amp;amp;start=&quot;&gt;community input&lt;/a&gt;. The name the core team eventually chose was not in the list of suggested names provided by the community.&lt;br /&gt;On &lt;a title=&quot;September 1&quot; href=&quot;http://en.wikipedia.org/wiki/September_1&quot;&gt;September 1&lt;/a&gt;, &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt; the new name, &quot;Joomla&quot;, was announced, which is the &lt;a title=&quot;English language&quot; href=&quot;http://en.wikipedia.org/wiki/English_language&quot;&gt;English&lt;/a&gt; spelling of the &lt;a class=&quot;mw-redirect&quot; title=&quot;Swahili&quot; href=&quot;http://en.wikipedia.org/wiki/Swahili&quot;&gt;Swahili&lt;/a&gt; (Arabic:جملة ,and &lt;a title=&quot;Urdu&quot; href=&quot;http://en.wikipedia.org/wiki/Urdu&quot;&gt;Urdu&lt;/a&gt;: &lt;a class=&quot;extiw&quot; title=&quot;ur:جوملہ&quot; href=&quot;http://ur.wikipedia.org/wiki/Ø¬ÙˆÙ…Ù„Û&quot;&gt;جملہ&lt;/a&gt; ) word jumla meaning &quot;all together&quot; or &quot;as a whole&quot; &lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-4&quot;&gt;[5]&lt;/a&gt;.&lt;br /&gt;On &lt;a title=&quot;September 7&quot; href=&quot;http://en.wikipedia.org/wiki/September_7&quot;&gt;September 7&lt;/a&gt;, &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt;, the development team called for &lt;a class=&quot;external text&quot; title=&quot;http://forum.joomla.org/viewtopic.php?f=&quot; href=&quot;http://forum.joomla.org/viewtopic.php?f=8&amp;amp;t=4205&quot; rel=&quot;nofollow&quot; t=&quot;4205&quot;&gt;logo submissions&lt;/a&gt; from the community, &lt;a class=&quot;external text&quot; title=&quot;http://forum.joomla.org/viewtopic.php?f=&quot; href=&quot;http://forum.joomla.org/viewtopic.php?f=8&amp;amp;t=5956&quot; rel=&quot;nofollow&quot; t=&quot;5956&quot;&gt;invited the community&lt;/a&gt; to vote on the logo preferred, and announced &lt;a class=&quot;external text&quot; title=&quot;http://forum.joomla.org/viewtopic.php?f=&quot; href=&quot;http://forum.joomla.org/viewtopic.php?f=8&amp;amp;t=7710&quot; rel=&quot;nofollow&quot; t=&quot;7710&quot;&gt;the community&#39;s decision&lt;/a&gt; on &lt;a title=&quot;September 22&quot; href=&quot;http://en.wikipedia.org/wiki/September_22&quot;&gt;September 22&lt;/a&gt;, &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt;. Following the logo selection, &lt;a class=&quot;external text&quot; title=&quot;http://www.joomla.org/content/view/259/70/&quot; href=&quot;http://www.joomla.org/content/view/259/70/&quot; rel=&quot;nofollow&quot;&gt;Brand Guidelines&lt;/a&gt;, a &lt;a class=&quot;external text&quot; title=&quot;http://www.joomla.org/content/view/259/70/&quot; href=&quot;http://www.joomla.org/content/view/259/70/&quot; rel=&quot;nofollow&quot;&gt;Brand Manual&lt;/a&gt;, and set of Logo Resources were published on &lt;a title=&quot;October 2&quot; href=&quot;http://en.wikipedia.org/wiki/October_2&quot;&gt;October 2&lt;/a&gt;, &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt; for the community&#39;s use.&lt;br /&gt;The first release of Joomla (Joomla 1.0.0) was announced on &lt;a title=&quot;September 16&quot; href=&quot;http://en.wikipedia.org/wiki/September_16&quot;&gt;September 16&lt;/a&gt;, &lt;a title=&quot;2005&quot; href=&quot;http://en.wikipedia.org/wiki/2005&quot;&gt;2005&lt;/a&gt;. This was a re-branded release of &lt;a class=&quot;mw-redirect&quot; title=&quot;Mambo (CMS)&quot; href=&quot;http://en.wikipedia.org/wiki/Mambo_(CMS)&quot;&gt;Mambo&lt;/a&gt; 4.5.2.3 combined with other bug and moderate-level security fixes. Joomla version 1.5 was released on &lt;a title=&quot;January 22&quot; href=&quot;http://en.wikipedia.org/wiki/January_22&quot;&gt;January 22&lt;/a&gt;, &lt;a title=&quot;2008&quot; href=&quot;http://en.wikipedia.org/wiki/2008&quot;&gt;2008&lt;/a&gt;. Joomla won the &lt;a title=&quot;Packt&quot; href=&quot;http://en.wikipedia.org/wiki/Packt&quot;&gt;Packt&lt;/a&gt; Publishing Open Source Content Management System Award in 2006&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-packtpub-award-5&quot;&gt;[6]&lt;/a&gt; and 2007.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-packtpub-award2-6&quot;&gt;[7]&lt;/a&gt;&lt;br /&gt;&lt;a id=&quot;Features&quot; name=&quot;Features&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;color:#33ffff;&quot;&gt;&lt;strong&gt;Features&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;The Joomla package consists of many different parts, which are built to be as modular as possible, allowing extensions and integrations to be made easily. An example of such are extensions called &quot;Plugins&quot;.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-extensions1-7&quot;&gt;[8]&lt;/a&gt; (Previously known as &quot;Mambots&quot;.) Plugins are background extensions that extend Joomla with new functionality. The &lt;a class=&quot;external text&quot; title=&quot;http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,2825/Itemid,35/&quot; href=&quot;http://extensions.joomla.org/component/option,com_mtree/task,viewlink/link_id,2825/Itemid,35/&quot; rel=&quot;nofollow&quot;&gt;WikiBot&lt;/a&gt;, for example, allows the author of Joomla content to use &quot;Wikitags&quot; in Joomla articles which will auto-create dynamic hyperlinks to Wikipedia articles when displayed. There are over 3,500 extensions for Joomla available via the Extensions Directory.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-8&quot;&gt;[9]&lt;/a&gt;&lt;br /&gt;In addition to Plugins, more comprehensive extensions are available. &quot;Components&quot; allow webmasters to perform such tasks as build a community by expanding user features, backup a website, translate content and create &lt;a class=&quot;mw-redirect&quot; title=&quot;URL&quot; href=&quot;http://en.wikipedia.org/wiki/URL&quot;&gt;URLs&lt;/a&gt; that are more friendly to search engines.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-extensions1-7&quot;&gt;[8]&lt;/a&gt; &quot;Modules&quot; perform such tasks as displaying a calendar or allowing custom code like Google AdSense etc., to be inserted within the base Joomla code.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-extensions1-7&quot;&gt;[8]&lt;/a&gt;&lt;br /&gt;Since it has been around longer, there are more extensions available for Joomla 1.0 than for Joomla 1.5, although native 1.5 extensions are becoming increasingly available. Some of the older 1.0 extensions can be used with version 1.5 if it is set to legacy mode.&lt;br /&gt;Joomla permits administrators to set global configuration parameters that affect every article. Every page conforms to these parameters by default, but a page can have its own setting for each parameter. For example, you can elect to show the article author, hide the author, or simply go with the global &quot;show author&quot; parameter.&lt;br /&gt;&lt;a id=&quot;Community&quot; name=&quot;Community&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#33ffff;&quot;&gt;Community&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Joomla has an official and many unofficial communities. &lt;a class=&quot;mw-redirect&quot; title=&quot;As of July 2008&quot; href=&quot;http://en.wikipedia.org/wiki/As_of_July_2008&quot;&gt;As of July 2008&lt;/a&gt;, the official Joomla forum has more than 300,000 threads and over 1.3 million posts from more than 200,000 registered members in 40 languages.&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-9&quot;&gt;[10]&lt;/a&gt; Unofficial sites are published in many languages, often with Joomla extensions that are region specific. &lt;a title=&quot;Bi-directional text&quot; href=&quot;http://en.wikipedia.org/wiki/Bi-directional_text&quot;&gt;Bi-directional text&lt;/a&gt; support for the &lt;a class=&quot;mw-redirect&quot; title=&quot;Hebrew&quot; href=&quot;http://en.wikipedia.org/wiki/Hebrew&quot;&gt;Hebrew&lt;/a&gt; and &lt;a class=&quot;mw-redirect&quot; title=&quot;Arabic&quot; href=&quot;http://en.wikipedia.org/wiki/Arabic&quot;&gt;Arabic&lt;/a&gt; languages, for example, can be found on 3rd party community portals. Unofficial web developers also build extensions and &lt;a class=&quot;mw-redirect&quot; title=&quot;Web templates&quot; href=&quot;http://en.wikipedia.org/wiki/Web_templates&quot;&gt;web templates&lt;/a&gt; for commercial sale and offer &lt;a class=&quot;mw-redirect&quot; title=&quot;Freelance&quot; href=&quot;http://en.wikipedia.org/wiki/Freelance&quot;&gt;freelance&lt;/a&gt; customization services. Usually a template is distributed as a &lt;a title=&quot;ZIP (file format)&quot; href=&quot;http://en.wikipedia.org/wiki/ZIP_(file_format)&quot;&gt;zip file&lt;/a&gt; which can be installed using the Joomla installer.&lt;br /&gt;&lt;a id=&quot;Criticism&quot; name=&quot;Criticism&quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style=&quot;color:#33ffff;&quot;&gt;&lt;strong&gt;Criticism&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;There have been several security issues since its initial release&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-10&quot;&gt;[11]&lt;/a&gt;.&lt;br /&gt;The latest Joomla does not have built in granular user access control&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-11&quot;&gt;[12]&lt;/a&gt;.&lt;br /&gt;The current Joomla built-in friendly URL functionality does not allow one to name paths exactly to choice. Flexible Friendly URL can be useful for &lt;a title=&quot;Search engine optimization&quot; href=&quot;http://en.wikipedia.org/wiki/Search_engine_optimization&quot;&gt;search engine optimization&lt;/a&gt; (SEO)&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-12&quot;&gt;[13]&lt;/a&gt;.&lt;br /&gt;The built in section/category feature is limited by the simple section/category/article hierarchy&lt;a title=&quot;&quot; href=&quot;http://en.wikipedia.org/wiki/Joomla#cite_note-13&quot;&gt;[14]&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;-------------------------------------------------------&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;&lt;span style=&quot;color:#ff9966;&quot;&gt;&lt;strong&gt;What is Joomla?&lt;/strong&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;Joomla is an award-winning content management system (CMS), which enables you to build Web sites and powerful online applications. Many aspects, including its ease-of-use and extensibility, have made Joomla the most popular Web site software available. Best of all, Joomla is an open source solution that is freely available to everyone.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;color:#ff9966;&quot;&gt;&lt;strong&gt;What&#39;s a content management system (CMS)?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;A content management system is software that keeps track of every piece of content on your Web site, much like your local public library keeps track of books and stores them. Content can be simple text, photos, music, video, documents, or just about anything you can think of. A major advantage of using a CMS is that it requires almost no technical skill or knowledge to manage. Since the CMS manages all your content, you don&#39;t have to.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;color:#ff9966;&quot;&gt;&lt;strong&gt;What are some real world examples of what Joomla! can do?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Joomla is used all over the world to power Web sites of all shapes and sizes. For example:&lt;br /&gt;Corporate Web sites or portals&lt;br /&gt;Corporate intranets and extranets&lt;br /&gt;Online magazines, newspapers, and publications&lt;br /&gt;E-commerce and online reservations&lt;br /&gt;Government applications&lt;br /&gt;Small business Web sites&lt;br /&gt;Non-profit and organizational Web sites&lt;br /&gt;Community-based portals&lt;br /&gt;School and church Web sites&lt;br /&gt;Personal or family homepages&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;color:#ff9966;&quot;&gt;&lt;strong&gt;Who uses Joomla?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Here are just a few examples of Web sites that use Joomla:&lt;br /&gt;United Nations (Governmental organization) - &lt;a href=&quot;http://www.unric.org/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.unric.org/&lt;/a&gt;&lt;br /&gt;MTV Networks Quizilla (Social networking) - &lt;a href=&quot;http://www.quizilla.com/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.quizilla.com/&lt;/a&gt;&lt;br /&gt;L.A. Weekly (Online publication) - &lt;a href=&quot;http://www.laweekly.com/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.laweekly.com/&lt;/a&gt;&lt;br /&gt;IHOP (Restaurant chain) - &lt;a href=&quot;http://www.ihop.com/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.ihop.com/&lt;/a&gt;&lt;br /&gt;Harvard University (Educational) - &lt;a href=&quot;http://gsas.harvard.edu/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://gsas.harvard.edu/&lt;/a&gt;&lt;br /&gt;Citibank (Financial institution intranet) - Not publicly accessible&lt;br /&gt;The Green Maven (Eco-resources) - &lt;a href=&quot;http://www.greenmaven.com/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.greenmaven.com/&lt;/a&gt;&lt;br /&gt;Outdoor Photographer (Magazine) - &lt;a href=&quot;http://www.outdoorphotographer.com/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.outdoorphotographer.com/&lt;/a&gt;&lt;br /&gt;PlayShakespeare.com (Cultural) - &lt;a href=&quot;http://www.playshakespeare.com/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.playshakespeare.com/&lt;/a&gt;&lt;br /&gt;Senso Interiors (Furniture design) - &lt;a href=&quot;http://www.sensointeriors.co.za/&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;http://www.sensointeriors.co.za/&lt;/a&gt;&lt;br /&gt;More examples of companies using Joomla can be found in the &lt;a href=&quot;http://forum.joomla.org/viewforum.php?f=514&quot; included=&quot;null&quot;&gt;Joomla Site Showcase Forum&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;color:#ff9966;&quot;&gt;I need to build a site for a client. How will Joomla! help me?&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Joomla is designed to be easy to install and set up even if you&#39;re not an advanced user. Many Web hosting services offer a single-click install, getting your new site up and running in just a few minutes.&lt;br /&gt;Since Joomla is so easy to use, as a Web designer or developer, you can quickly build sites for your clients. Then, with a minimal amount of instruction, you can empower your clients to easily manage their own sites themselves.&lt;br /&gt;If your clients need specialized functionality, Joomla is highly extensible and thousands of extensions (most for free under the &lt;a href=&quot;http://www.gnu.org/licenses/old-licenses/gpl-2.0.html&quot; target=&quot;_blank&quot; included=&quot;null&quot;&gt;GPL license&lt;/a&gt;) are available in the &lt;a href=&quot;http://extensions.joomla.org/&quot; included=&quot;null&quot;&gt;Joomla Extensions Directory&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;color:#ff9966;&quot;&gt;&lt;strong&gt;How can I be sure there will be Joomla! support in the future?&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;Joomla is the most popular open source CMS currently available as evidenced by a vibrant and growing community of friendly users and talented developers. Joomla&#39;s roots go back to 2000 and, with over 200,000 community users and contributors, the future looks bright for the award-winning Joomla Project.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;color:#ff9966;&quot;&gt;&lt;strong&gt;I&#39;m a developer. What are some advanced ways I can use Joomla?&lt;/strong&gt;&lt;/span&gt;&lt;a href=&quot;http://www.joomla.org/images/stories/mvc_diagram.png&quot; rel=&quot;lightbox&quot; included=&quot;null&quot;&gt;&lt;/a&gt;&lt;br /&gt;Many companies and organizations have requirements that go beyond what is available in the basic Joomla package. In those cases, Joomla&#39;s powerful application framework makes it easy for developers to create sophisticated add-ons that extend the power of Joomla into virtually unlimited directions.&lt;br /&gt;The core Joomla framework enables developers to quickly and easily build:&lt;br /&gt;Inventory control systems&lt;br /&gt;Data reporting tools&lt;br /&gt;Application bridges&lt;br /&gt;Custom product catalogs&lt;br /&gt;Integrated e-commerce systems&lt;br /&gt;Complex business directories&lt;br /&gt;Reservation systems&lt;br /&gt;Communication tools&lt;br /&gt;Since Joomla is based on PHP and MySQL, you&#39;re building powerful applications on an open platform anyone can use, share, and support. To find out more information on leveraging the Joomla framework, visit the &lt;a href=&quot;http://developer.joomla.org/&quot; included=&quot;null&quot;&gt;Joomla Developer Network.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-size:130%;color:#000000;&quot;&gt;----------------------------------------------------&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Core Features&lt;br /&gt;JOOMLA! Core Features&lt;br /&gt;Components&lt;br /&gt;Modules&lt;br /&gt;Pages 10-29&lt;br /&gt;Plugins&lt;br /&gt;Templates&lt;br /&gt;JOOMLA! Core Features&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Components&lt;br /&gt;Banner&lt;br /&gt;Contacts&lt;br /&gt;Newsfeeds&lt;br /&gt;Polls&lt;br /&gt;Search&lt;br /&gt;Weblinks&lt;br /&gt;&lt;br /&gt;**************************&lt;br /&gt;&lt;strong&gt;Components&lt;br /&gt;Banner&lt;br /&gt;&lt;/strong&gt;The “Banner” component allows the user to manage banners by Categories and Clients. The&lt;br /&gt;“Banners Manager” has three tabs, “Banners,” “Clients,” and “Categories.”&lt;br /&gt;The “Banners” tab shows a detailed list of active (published and unpublished) banners within&lt;br /&gt;the website. It also provides the ability to add new or edit existing banners and their details.&lt;br /&gt;The “Clients” tab shows list of clients and their contact details.&lt;br /&gt;The “Categories” tab allows whole categories of banners to be organised and “Published” status&lt;br /&gt;changed.&lt;br /&gt;Each banner is managed individually with various parameters for essential information such as&lt;br /&gt;“Impressions Purchased” and “Click URL.”&lt;br /&gt;&lt;/p&gt;&lt;p&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Components&lt;br /&gt;Contacts&lt;br /&gt;&lt;/strong&gt;The “Contacts” component allows the user to manage a Contacts directory with regard to the&lt;br /&gt;Contacts within the web site.&lt;br /&gt;The “Contacts” tab shows a detailed list of active (published and unpublished) contacts. It also&lt;br /&gt;provides the ability to add new or edit existing contacts and their details.&lt;br /&gt;The “Categories” tab allows whole categories of contacts to be organised and “Published”&lt;br /&gt;status changed.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Components&lt;br /&gt;Newsfeeds&lt;br /&gt;&lt;/strong&gt;The “Newsfeeds” component enables the most recent articles from external web sites feeds&lt;br /&gt;(e.g. RSS) to be linked to for further reading.&lt;br /&gt;The “Feeds” tab contains a detailed list of all active (published and unpublished) feeds within&lt;br /&gt;the website. Important information is instantly visible such as “Category,” “# Articles,” and&lt;br /&gt;“Cache Time.”&lt;br /&gt;The “Categories” tab allows whole categories of feeds to be organised and “Published” status&lt;br /&gt;changed.&lt;br /&gt;Feeds are managed in categories and have various parameters such as “Number of Articles,”&lt;br /&gt;“Cache Time” and ordering.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Components&lt;br /&gt;Polls&lt;br /&gt;&lt;/strong&gt;The “Polls” component displays a list of all active (published or unpublished) polls on your site.&lt;br /&gt;“Polls” are easily managed with parameters such as “Lag” (time between votes) and “Options”&lt;br /&gt;for which visitors may vote.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Components&lt;br /&gt;Search&lt;br /&gt;&lt;/strong&gt;The “Search” component provides statistics on searches performed using the Joomla! Search&lt;br /&gt;Plugin.&lt;br /&gt;The component provides the statistics as a simple list containing “Search Text” compared to&lt;br /&gt;“Times Requested,” and by default sorted by “Times Requested.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Components&lt;br /&gt;Weblinks&lt;br /&gt;&lt;/strong&gt;The “Weblink” component lists and provides management controls for controlling Web Links&lt;br /&gt;displayed in the Front-end of the web site.&lt;br /&gt;The “Links” tab displays a list of active (published and unpublished) links organised by category&lt;br /&gt;and order.&lt;br /&gt;The “Categories” tab allows whole categories of links to be organised and “Published” status&lt;br /&gt;changed.&lt;br /&gt;Weblinks are managed in categories and have various parameters such as “Target” (e.g. “New&lt;br /&gt;Window with Browser Navigation”) and “Description.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Modules&lt;br /&gt;Archived Content&lt;br /&gt;Banners &amp;amp; Feed&lt;br /&gt;Custom HTML&lt;br /&gt;Breadcrumbs&lt;br /&gt;Footer&lt;br /&gt;Login&lt;br /&gt;Menu&lt;br /&gt;Most Read &amp;amp; Latest News&lt;br /&gt;News Flash&lt;br /&gt;Polls&lt;br /&gt;Random Image&lt;br /&gt;Related Items&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;Search&lt;br /&gt;Sections&lt;br /&gt;Statistics&lt;br /&gt;Syndicate&lt;br /&gt;Who&#39;s Online&lt;br /&gt;Wrapper&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;a name=&quot;12&quot;&gt;&lt;/a&gt;&lt;strong&gt;Archived Content&lt;br /&gt;&lt;/strong&gt;The “Archived Content” module allows the positioning of a display of Content Items that have&lt;br /&gt;been Archived by a Publisher or above. The Content Itmes are available behind a Month/Year&lt;br /&gt;directory list.&lt;br /&gt;The Items are sorted by creation date not archival date. Only those Months/Years with Content&lt;br /&gt;Items created in them will be displayed so there will not be a list of empty directories.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Banners and Feed&lt;br /&gt;&lt;/strong&gt;Both the “Banners” and “Feed” modules are the front-end display mechanism for their&lt;br /&gt;respective components.&lt;br /&gt;Both can be configured to display specific items on specific pages.&lt;br /&gt;Standard module parameters such as “Menu Assignment” and “Details” are available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Custom HTML&lt;br /&gt;&lt;/strong&gt;The “Custom HTML” module allows the creation of a custom module. “Custom HTML” modules&lt;br /&gt;may contain any HTML based content, including text, images and links.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Breadcrumbs&lt;br /&gt;&lt;/strong&gt;The “Breadcrumbs” module allows the adition of breadcrumbs to the websites front-end.&lt;br /&gt;Breadcrumbs are a navigation aid commonly used in user interfaces. The breadcrumbs give&lt;br /&gt;users a way to keep track of there location within the web site.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Footer&lt;br /&gt;&lt;/strong&gt;The “Footer” module shows the Joomla! Copyright information in the following form.&lt;br /&gt;“Copyright © YYYY [Site Name Here]. All Rights Reserved.”&lt;br /&gt;“Joomla! is Free Software released under the GNU/GPL License.”&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Login&lt;br /&gt;&lt;/strong&gt;The “Login” module displays the required fields to login, without navigating to a new page.&lt;br /&gt;Default visible fields include “Username,” “Password,” and “Remember Me.”&lt;br /&gt;Various parameters are available to change what extra options are available, such as&lt;br /&gt;“Remember Me.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Menu&lt;br /&gt;&lt;/strong&gt;The “Menu” module displays a menu that is defined from within the Menu Manager. All Joomla!&lt;br /&gt;web sites have a “Main Menu” which cannot be deleted. The “Menu” module allows new menus&lt;br /&gt;to be displayed in other positions.&lt;br /&gt;The module has various parameters including “Menu Name,” “Menu Style,” and sub-menu item&lt;br /&gt;preferences.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Most Read &amp;amp; Latest News&lt;br /&gt;&lt;/strong&gt;Both the “Most Read” and “Latest News” modules display a list of links to either the most read&lt;br /&gt;articles or the most recently added articles.&lt;br /&gt;Both are easily managed with parameters to limit the scope to certain sections and/or&lt;br /&gt;categories. Standard module parameters such as “Menu Assignment” and “Details” are&lt;br /&gt;available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;News Flash&lt;br /&gt;&lt;/strong&gt;The “Newsflash” module displays Content Items from a specific Section/Category list. Standard&lt;br /&gt;module parameters such as “Menu Assignment” and “Details” are available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Polls&lt;br /&gt;&lt;/strong&gt;The “Polls” module is the front-end display mechanism for the “Polls” component.&lt;br /&gt;Together, the “Polls” module and component can be configured to show specific polls on&lt;br /&gt;specific pages.&lt;br /&gt;Standard module parameters such as “Menu Assignment” and “Details” are available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Random Image&lt;br /&gt;&lt;/strong&gt;The “Random Image” module displays a random image from the contents of a specific image&lt;br /&gt;folder. This folder is set via the parameters dialoge. Standard module parameters such as&lt;br /&gt;“Menu Assignment” and “Details” are available in addition to certain “Advanced Parameters.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Related Items&lt;br /&gt;&lt;/strong&gt;The “Related Items” module utilises the meta-data associated with each piece of content. The&lt;br /&gt;module will display content items with the same keywords, and therefore of a similar subject,&lt;br /&gt;giving the user added value to the amount of detail that are able to obtain from a web site.&lt;br /&gt;Hence, it is important to ensure that the keywords accurately reflect the specific content in&lt;br /&gt;every item, otherwise the advantages are rapidly lost and will significantly detract from the user&lt;br /&gt;experience.&lt;br /&gt;Less is definitely more (provided they are accurate).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Search&lt;br /&gt;&lt;/strong&gt;The “Search” module provides the user with the ability to instantly perform a basic search from&lt;br /&gt;their current location and to be taken directly to the results. This removes the need to navigate&lt;br /&gt;to a search dialogue.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Sections&lt;br /&gt;&lt;/strong&gt;The “Sections” module shows a list of all Article Sections configured in the your web sites&lt;br /&gt;database.&lt;br /&gt;If the parameter “Show Unauthorised Links” is set to No, the list will be limited to the Sections&lt;br /&gt;the User&#39;s access level permits them to see.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Statistics&lt;br /&gt;&lt;/strong&gt;The “Statistics” module displays a basic list of information about the server and Joomla!&lt;br /&gt;Installation. Information displayed includes Server OS, PHP Version, MySQL Version, Time,&lt;br /&gt;Caching, GZIP, Members, Content, Weblinks, and Content View Hits.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Syndicate&lt;br /&gt;&lt;/strong&gt;The “Syndicate” module displays a pictorial list of all the Feed types that are available for the&lt;br /&gt;web site. The module works in conjunction with the Syndicate Component where the actual feed&lt;br /&gt;details are configured.&lt;br /&gt;A website user wishing to add the fee would them simply need to right click the module image&lt;br /&gt;and copy the link location to their News Feed reader, or as is more common these days, use&lt;br /&gt;their News Feed reader or Browse to automatically add the Feed.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Who&#39;s Online&lt;br /&gt;&lt;/strong&gt;The “Who&#39;s Online” module provides a basic display of the number of Guests (unregistered&lt;br /&gt;vistors) and how many members (registered users that are logged in) are connected to the&lt;br /&gt;website at the time the web page was queried.&lt;br /&gt;The module can be set to display the names of the Members who are logged in.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Wrapper&lt;br /&gt;&lt;/strong&gt;The “Wrapper” module wraps another web page directly into the website at a specific location&lt;br /&gt;determined by the module position. The web page is inserted as an inline frame into the web&lt;br /&gt;site layout template.&lt;br /&gt;The module can be used to display another web site, but also alternative pages from within the&lt;br /&gt;website is is installed upon, as well as allowing completely independent applications and scripts&lt;br /&gt;to be run on the web site and output their displays/information as if an integral part of the&lt;br /&gt;website.&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Plugins&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;Authentication (Joomla!, LDAP, OpenID, GMail)&lt;br /&gt;Cache&lt;br /&gt;Code Highlighter (GeSHi)&lt;br /&gt;Email Cloaking&lt;br /&gt;Editors (TinyMCE 2.1 &amp;amp; Xstandard Lite for Joomla!)&lt;br /&gt;Editors-XTD (Image, Page Break, Readmore)&lt;br /&gt;Legacy&lt;br /&gt;Rating&lt;br /&gt;Search (Categories, Newsfeeds, Sections, Contacts, Content, Weblinks)&lt;br /&gt;SEF&lt;br /&gt;XML-RPC (Blogger API, Joomla! API)&lt;br /&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Authentication (Joomla!, LDAP, OpenID, GMail)&lt;br /&gt;&lt;/strong&gt;The “Authentication” plugins add different form of user authentication to your site.&lt;br /&gt;The Joomla! Authentication plugin involves initially registering at the web site and then&lt;br /&gt;confirming your identity through a confirmation email.&lt;br /&gt;The OpenID and GMail Authentication plugins use prexisting databases to authenticate the user.&lt;br /&gt;By signing in with a GMail or OpenID account, steps will be eliminated from the registration&lt;br /&gt;process.&lt;br /&gt;By default, only the Joomla! Authentication plugin is enabled.&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Cache&lt;br /&gt;&lt;/strong&gt;The “Cache” Plugin provides page caching functionality. This reduces server load and lag.&lt;br /&gt;By caching the pages, new pages do not have to be generated as often, however, the benefits of&lt;br /&gt;caching require high traffic levels to be noticable.&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Code Highlighter (GeSHi)&lt;br /&gt;&lt;/strong&gt;GeSHi is an Open Source syntax highlighter program&lt;br /&gt;that helps illustrate different code languages such as&lt;br /&gt;PHP, JavaScript, HTML, each in a different colour, to&lt;br /&gt;assist with the readability of a code entry in a&lt;br /&gt;Content Item. This code entry must be encased&lt;br /&gt;within a &lt;pre&gt;...&lt;/pre&gt;element that defines a block&lt;br /&gt;of preformatted code.&lt;br /&gt;In this Plugin form, GeSHi is installed with the ability&lt;br /&gt;to highlight CSS, HTML4 (strict), JavaScript, PHP,&lt;br /&gt;PHP brief, MySQL, SQL, and XML.&lt;br /&gt;&lt;?php function simpsonf($x){ // returns f(x) for integral approximation with composite Simpson&#39;s rule return(pow((1+pow($x, (-4))), 0.5)); } function simpsonsrule($a, $b, $n){ // approximates integral_a_b f(x) dx with composite Simpson&#39;s rule with $n intervals // $n has to be an even number // f(x) is defined in &quot;function simpsonf($x)&quot; if($n%2==0){ $h=($b-$a)/$n; $S=simpsonf($a)+simpsonf($b); $i=1; while($i &lt;= ($n-1)){ $xi=$a+$h*$i; if($i%2==0){ $S=$S+2*simpsonf($xi); } else{ $S=$S+4*simpsonf($xi); } $i++; } return($h/3*$S); } else{ return(&#39;$n has to be an even number&#39;); } } ?&gt;&lt;br /&gt;************************** &lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Email Cloaking&lt;br /&gt;&lt;/strong&gt;The Email Cloaking plugin adds a layer of security to email addresses contained inside Content&lt;br /&gt;Items and Contacts. The plugin uses JavaScript to effectivly hide the email address when an&lt;br /&gt;email address appears as one of the following:&lt;br /&gt;●&lt;br /&gt;address@mydomain.com&lt;br /&gt;●&lt;br /&gt;&lt;a xhref=&quot;“mailto:address@mydomain.com”&quot;&gt;address@mydomain.com&lt;/a&gt;&lt;br /&gt;●&lt;br /&gt;&lt;a xhref=&quot;“mailto:address@mydomain.com”&quot;&gt;mail Admin!&lt;/a&gt;&lt;br /&gt;All would be cloaked by the functionality of this plugin.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Editors (TinyMCE 2.1 &amp;amp; XStandard Lite for Joomla!)&lt;br /&gt;&lt;/strong&gt;Both the TinyMCE 2.1 and the Xstandard Lite for Joomla! plugins are WYSIWYG (What You See&lt;br /&gt;Is What You Get) editors. They allow for the creation of Content Items and editing descriptions&lt;br /&gt;among other tasks.&lt;br /&gt;TinyMCE 2.1 is both the default and most feature rich editor. It offers all the features that are&lt;br /&gt;needed for standard use.&lt;br /&gt;The default editor may be set from the “Global Configuration” dialoge.&lt;br /&gt;TinyMCE 2.1 Toolbars&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Legacy&lt;br /&gt;&lt;/strong&gt;The “Legacy” Plugin adds Legacy support for Joomla! 1.0. This Plugin allows existing&lt;br /&gt;components, mambots, templates and modules to function in Joomla! 1.5.&lt;br /&gt;By default, the “Legacy” Plugin is disabled, but can be enabled if required.&lt;br /&gt;It is recommended to use extensions that run natively in Joomla! 1.5.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Editors-XTD (Image, Pagebreak, Readmore)&lt;br /&gt;&lt;/strong&gt;These Plugins add important functionality to the front-end for viewing content and the back-end&lt;br /&gt;for enabling and configuring this functionality.&lt;br /&gt;The Image Editor-XTD Plugin displays a button to make it possible to insert images into an&lt;br /&gt;Article. The button causes a popup to be displayed allowing you to configure the image&#39;s&lt;br /&gt;properties, and to upload new image files.&lt;br /&gt;The Pagebreak Editor-XTD Plugin provides a button to enable a pagebreak to be inserted into an&lt;br /&gt;Article. A popup allows you to configure the settings to be used, such as “Title.”&lt;br /&gt;The Readmore Editor-XTD Plugin enables a button to be available that allows you to easily&lt;br /&gt;insert the “Read more...” link into an Article.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Rating&lt;br /&gt;&lt;/strong&gt;The “Search” Plugin adds the functionality of a reader rating system to the Content Items in the&lt;br /&gt;Front-end of the web site. This is the sequence of 5 image objects that are “lit up” in accordance&lt;br /&gt;with the seletions made by the Users in the Front-end.&lt;br /&gt;By default, this Plugin is not enabled.&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Search (Categories, Newsfeeds, Sections, Contacts, Content, Weblinks)&lt;br /&gt;&lt;/strong&gt;The various “Search” Plugins enable the Search component to search all types of content on&lt;br /&gt;your website. The different plugins are for each type of content, allowing the enabling and&lt;br /&gt;disabling of searching the different types of content.&lt;br /&gt;Through using this methodology, content stored and managed by third party components can&lt;br /&gt;be searched if an appropriate plugin is made available.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;SEF&lt;br /&gt;&lt;/strong&gt;The “SEF” Plugin adds Search Engine Friendly functionality to the URL links of content items. It&lt;br /&gt;operates automatically once published and enabled in the Global Configuration. The plugin&lt;br /&gt;operates directly on the HTML code and does not require special tagging to be added by a user.&lt;/p&gt;&lt;p&gt;**************************&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;XML-RPC (Blogger API &amp;amp; Joomla! API)&lt;br /&gt;&lt;/strong&gt;The “XML-RPC” (Extensible Markup Language – Remote Procedure Call) Plugin adds XML-RPC&lt;br /&gt;functionality to Joomla!&lt;br /&gt;The “XML-RPC Blogger API” allows third party applications, such as w.bloggar, to talk to&lt;br /&gt;Joomla!, giving the user the ability to remotely edit, add, delete and publish content items.&lt;br /&gt;The “XML-RPC Joomla! API” adds further Joomla! specific functionality through compliant&lt;br /&gt;third party applications.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Templates&lt;br /&gt;&lt;/strong&gt;RHUK Milkyway&lt;br /&gt;Beez&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;span style=&quot;font-size:130%;&quot;&gt;Templates&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;RHUK Milkyway&lt;br /&gt;&lt;/strong&gt;The “RHUK Milkyway” template is the default template for a Joomla! Installation. The clean&lt;br /&gt;design of this template makes it very lightweight and fast.&lt;br /&gt;The template has three parameters for setting the “Colour Variation,” “Background Variation,”&lt;br /&gt;and “Template Width.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;**************************&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Beez&lt;br /&gt;&lt;/strong&gt;The “Beez” template is a template that has been designed with particular attention to the&lt;br /&gt;standard conformables code, accessibility and flexibility.&lt;br /&gt;This template is an exmaple to demonstrate the new accessibilty features in Joomla! 1.5. It&lt;br /&gt;serves as a basis and can be modified and extended as much as you wish.&lt;br /&gt;&lt;/p&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/09/joomla.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-3119885472796611371</guid><pubDate>Fri, 22 Aug 2008 09:31:00 +0000</pubDate><atom:updated>2008-08-22T02:35:24.440-07:00</atom:updated><title>SEF</title><description>&lt;span style=&quot;font-family:arial;&quot;&gt;&lt;span style=&quot;font-size:100%;&quot;&gt;We live in a day and age where people use search engines on a daily basis to find information, products or services. Web site owners who offer these things want to be found in the number 1 spot for a particular keyword phrase or at least on the first page of results. In order to obtain these prized positions, the engines have to make the decision that your site deserves that prestigious place. As web site owners or those who are responsible for the overall success of a site, how do we help the search engines come to this conclusion? While there may be many pieces of the puzzle to accomplish this, one of the foundational things that can be done is to make sure your site is &quot;search engine friendly&quot;.&lt;br /&gt;&lt;br /&gt;What does that mean anyway - search engine friendly? Does it entail having an all text site because search engines love content? Does it mean sacrificing aesthetics because graphical components get in the way of search engines? Does it mean stuffing your pages with repetitive keywords or employing sneaky tricks? Actually none of these things are ingredients for a search engine friendly site. Additionally many are under the impression that one has to sacrifice the end user if they are to please the search engine. Nothing could be further from the truth.&lt;br /&gt;&lt;br /&gt;Let me give you some basic ingredients that constitute a search engine friendly site but in doing so, always keep this principle in mind - your web site is for the end user, not the search engines! What do I mean by that? It is quite simple. Search engines are not going to buy your products or hire you to perform a service. In other words, they are not going to pay your bills or allow you to earn an income. The end user will. It is the end user that you want to attract and as a result, covert to a customer. Therefore you should always design and market your site with the end user in mind. This involves the aesthetics of your site, its usability, the way it communicates and ultimately its ability to convert. Keeping this very important principle in mind, lets look at some key ingredients that make up a search engine friendly site.&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;strong&gt;Make Sure Search Engines Can Find You In The First Place&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Seems simple enough, right? However, there are still people that launch a brand new site and then go searching for it on Google or Yahoo but are unable to find it. They submitted their site through one of those &quot;add URL&quot; forms or through a submission service but still do not show up in the search engine&#39;s index. You will never get your site listed, at least long term, in a search engine by simply submitting it. Rather you need to get a link from a site that is already in the search engines and then the engines will find the link, visit your site and add it to their index.&lt;br /&gt;&lt;br /&gt;How does one go about getting a link on another site? The easiest way is to submit your site to free directories like GoGuides, JoeAnt, Skaffe or Wow. Search engines regularly crawl these and other directories and will find your site once it is listed.&lt;br /&gt;&lt;br /&gt;Another thing that we do is add a link to the client&#39;s site in our client list, portfolio, press release section or even in one of our own directories. Either way, the preferred method of search engines is to find your site on their own.&lt;br /&gt;&lt;br /&gt;&lt;span&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;&lt;strong&gt;Search Engines Crave Content&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;It is true that search engines like content or plain old html text. They do not recognize how aesthetically pleasing your site is but rather will digest the content of your site to understand its subject matter. That is not to say that you should sacrifice design for content. You can actually have the best of both worlds. There is a myth that one has to have all their content appear on the page before graphical components. That is simply not true. As long as there is good content within your pages, it doesn&#39;t matter where it is - search engines will find it. So the challenge then is not &quot;where&quot; to place content but simply to have it in the first place.&lt;br /&gt;&lt;br /&gt;In having content it is imperative to then have the best content. This is where creativity in presenting information comes into play. If your site offers information on a subject, then make sure you have the best info available on the Internet. If you sell a line of products, make sure you provide content describing the products whether that be in the form of convincing sales verbiage, product reviews, testimonials or all those combined.&lt;br /&gt;&lt;br /&gt;Make sure your content is written in a natural language. In other words, make sure it is written for the end user in mind. Who is your target audience. Men? Women? Teens? Business owners? A geographical region? Whatever it be, write for that target audience. This is where a good copywriter that has some basic understanding of SEO will be worth their weight in gold. &quot;What about my keywords?&quot; you ask. There is no reason why your site cannot contain well written content designed for your target audience and at the same time represent your most important keywords.&lt;br /&gt;&lt;br /&gt;Is Your Site Crawlable?&lt;br /&gt;&lt;br /&gt;I am probably stretching the English language using the word &quot;crawlable&quot;. What I am referring to is simply making sure that a search engine can find other pages within your site beyond your home page. This may sound simple enough but I come across many sites that in one way or another have stopped a search engine dead it its tracks at the home page.&lt;br /&gt;&lt;br /&gt;There are a variety of situations that can stop a search engine from reaching the sub pages of your site. One of the most common is when a site uses a JavaScript navigation system such as with dynamic menus. While Google is working to overcome the inability to understand JavaScript, the other search engines simply cannot crawl links in these types of navigational systems. What should you do then? Get rid of the JavaScript? Certainly not. Rather, provide an alternate way to navigate the site such as a set of text links in the footer of your site. If your site has too many pages or sections to include a set of links in the footer, then build a site map with text links to every page or at least every major section of the site and then include a text link to the site map from your home page. You can also link to sub pages within the regular copy of your pages as well.&lt;br /&gt;&lt;br /&gt;Another thing that will stop search engines from finding the sub pages of your site is requiring cookies or setting session ids. Sure cookies and/or session ids may be necessary to track visitor activity but you can make an exception for search engines. Search engine crawlers are like old browsers in a way. They do not like cookies. Don&#39;t require them to accept them or they will simply leave.&lt;br /&gt;&lt;br /&gt;Search boxes and forms are another obstacle to search engines. They cannot add a zip code into a form field or a keyword into a search query box. If these are the only ways to reach the inner contents of your site, then you will shut the door on search engine crawlers.&lt;br /&gt;&lt;br /&gt;The basic idea of allowing a crawler to find the inner pages of your site is that each page should be unique to a specific subject, product or service. Therefore in most cases the more pages you have indexed in a search engine, the greater visibility you have because you have a better chance of showing up well for multiple keywords and phrases.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3366ff;&quot;&gt;Use Unique Title Tags and Meta Description Tags&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;How often I come across sites that have the same title tag on every page. Usually it is simply the company or web site name. It is also very common in product database sites that use a run of site title tag or an include file for the info that goes between the opening and closing head tags in the html.&lt;br /&gt;&lt;br /&gt;Whether your site is static or dynamic, it is of the utmost importance to have unique title tags for each page. Each page should be different, right? Then why not make sure your title tag coincides with the subject matter of the page? The title tag is probably the most important thing a search engine looks at out of all the other elements of your site. So make sure you are capitalizing on this by having optimized, unique title tags for each page.&lt;br /&gt;&lt;br /&gt;While you are at it, each page should have its own unique meta description tag as well. Sure Google rarely displays the meta description tag as the description of a listing that might appear in the SERPs but they still index it and Yahoo does use the meta description tag (at least at the time of this writing) as the description that appears in the SERPs.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style=&quot;color:#3333ff;&quot;&gt;Make Your Site The Very Best It Can Be&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;All search engines want to do is to be relevant and help their users find the very best sites related to their search queries. While some people do &quot;trick&quot; and &quot;cheat&quot; their way to the top, the web sites that ultimately earn the top positions and stay there are the web sites that are the best in their field. Never stop working to make your site better than all the others you are competing against. This is the best strategy in obtaining long term success not only in regards to search engine positioning but with your end users as well.&lt;br /&gt;&lt;br /&gt;So in conclusion, having a search engine friendly site simply means having a site that they can find, that they can understand, that provides a wealth of good info and that is the best in its field.&lt;/span&gt;&lt;/span&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/08/sef.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-6793540166294061612</guid><pubDate>Sun, 29 Jun 2008 04:39:00 +0000</pubDate><atom:updated>2013-12-18T10:19:37.214-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interview</category><title>HRInterviewQuestions</title><description>&lt;a name=&quot;_Toc33364714&quot;&gt;Question 1 &lt;/a&gt;Tell me about yourself.&lt;br /&gt;TRAPS: Beware, about 80% of all interviews begin with this “innocent” question. Many candidates, unprepared for the question, skewer themselves by rambling, recapping their life story, delving into ancient work history or personal matters.&lt;br /&gt;&lt;br /&gt;BEST ANSWER: Start with the present and tell why you are well qualified for the position. Remember that the key to all successful interviewing is to match your qualifications to what the interviewer is looking for. In other words you must sell what the buyer is buying. This is the single most important strategy in job hunting.&lt;br /&gt;&lt;br /&gt;So, before you answer this or any question it&#39;s imperative that you try to uncover your interviewer&#39;s greatest need, want, problem or goal.&lt;br /&gt;&lt;br /&gt;To do so, make you take these two steps:&lt;br /&gt;1. Do all the homework you can before the interview to uncover this person&#39;s wants and needs (not the generalized needs of the industry or company)&lt;br /&gt;2. As early as you can in the interview, ask for a more complete description of what the position entails. You might say: “I have a number of accomplishments I&#39;d like to tell you about, but I want to make the best use of our time together and talk directly to your needs. To help me do, that, could you tell me more about the most important priorities of this position? All I know is what I (heard from the recruiter, read in the classified ad, etc.)”&lt;br /&gt;&lt;br /&gt;Then, ALWAYS follow-up with a second and possibly, third question, to draw out his needs even more. Surprisingly, it&#39;s usually this second or third question that unearths what the interviewer is most looking for.&lt;br /&gt;&lt;br /&gt;You might ask simply, &quot;And in addition to that?...&quot; or, &quot;Is there anything else you see as essential to success in this position?:&lt;br /&gt;&lt;br /&gt;This process will not feel easy or natural at first, because it is easier simply to answer questions, but only if you uncover the employer&#39;s wants and needs will your answers make the most sense. Practice asking these key questions before giving your answers, the process will feel more natural and you will be light years ahead of the other job candidates you&#39;re competing with.&lt;br /&gt;After uncovering what the employer is looking for, describe why the needs of this job bear striking parallels to tasks you&#39;ve succeeded at before. Be sure to illustrate with specific examples of your responsibilities and especially your achievements, all of which are geared to present yourself as a perfect match for the needs he has just described.&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;a name=&quot;_Toc33364715&quot;&gt;Question 2 &lt;/a&gt;What are your greatest strengths? &lt;/p&gt;&lt;p&gt;&lt;br /&gt;TRAPS: This question seems like a softball lob, but be prepared. You don&#39;t want to come across as egotistical or arrogant. Neither is this a time to be humble. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: You know that your key strategy is to first uncover your interviewer&#39;s greatest wants and needs before you answer questions. And from Question 1, you know how to do this.&lt;br /&gt;Prior to any interview, you should have a list mentally prepared of your greatest strengths. You should also have, a specific example or two, which illustrates each strength, an example chosen from your most recent and most impressive achievements. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;You should, have this list of your greatest strengths and corresponding examples from your achievements so well committed to memory that you can recite them cold after being shaken awake at 2:30AM. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Then, once you uncover your interviewer&#39;s greatest wants and needs, you can choose those achievements from your list that best match up. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;As a general guideline, the 10 most desirable traits that all employers love to see in their employees are:&lt;br /&gt;1. A proven track record as an achiever...especially if your achievements match up with the employer&#39;s greatest wants and needs.&lt;br /&gt;2. Intelligence...management &quot;savvy&quot;.&lt;br /&gt;3. Honesty...integrity...a decent human being.&lt;br /&gt;4. Good fit with corporate culture...someone to feel comfortable with...a team player who meshes well with interviewer&#39;s team.&lt;br /&gt;5. Likeability...positive attitude...sense of humor.&lt;br /&gt;6. Good communication skills.&lt;br /&gt;7. Dedication...willingness to walk the extra mile to achieve excellence.&lt;br /&gt;8. Definiteness of purpose...clear goals.&lt;br /&gt;9. Enthusiasm...high level of motivation.&lt;br /&gt;10. Confident...healthy...a leader. &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364716&quot;&gt;Question 3 &lt;/a&gt;What are your greatest weaknesses?&lt;br /&gt;TRAPS: Beware - this is an eliminator question, designed t&lt;/p&gt;&lt;p&gt;o shorten the candidate list. Any admission of a weakness or fault will earn you an “A” for honesty, but an “F” for the interview. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;PASSABLE ANSWER: Disguise a strength as a weakness.&lt;br /&gt;Example: “I sometimes push my people too hard. I like to work with a sense of urgency and everyone is not always on the same wavelength.”&lt;br /&gt;Drawback: This strategy is better than admitting a flaw, but it&#39;s so widely used, it is transparent to any experienced interviewer. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: (and another reason it&#39;s so important to get a thorough description of your interviewer&#39;s needs before you answer questions): Assure the interviewer that you can think of nothing that would stand in the way of your performing in this position with excellence. Then, quickly review you strongest qualifications. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example: “Nobody&#39;s perfect, but based on what you&#39;ve told me about this position, I believe I&#39; d make an outstanding match. I know that when I hire people, I look for two things most of all. Do they have the qualifications to do the job well, and the motivation to do it well? Everything in my background shows I have both the qualifications and a strong desire to achieve excellence in whatever I take on. So I can say in all honesty that I see nothing that would cause you even a small concern about my ability or my strong desire to perform this job with excellence.”&lt;br /&gt;Alternate strategy (if you don&#39;t yet know enough about the position to talk about such a perfect fit): Instead of confessing a weakness, describe what you like most and like least, making sure that what you like most matches up with the most important qualification for success in the position, and what you like least is not essential. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example: Let&#39;s say you&#39;re applying for a teaching position. “If given a choice, I like to spend as much time as possible in front of my prospects selling, as opposed to shuffling paperwork back at the office. Of course, I long ago learned the importance of filing paperwork properly, and I do it conscientiously. But what I really love to do is sell (if your interviewer were a sales manager, this should be music to his ears.) &lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364717&quot;&gt;Question 4 &lt;/a&gt;Tell me about something you did – or failed to do – that you now feel a little ashamed of.&lt;br /&gt;TRAPS: There are some questions your interviewer has no business asking, and this is one. But while you may feel like answering, “none of your business,” naturally you can’t. Some interviewers ask this question on the chance you admit to something, but if not, at least they’ll see how you think on your feet. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Some unprepared candidates, flustered by this question, unburden themselves of guilt from their personal life or career, perhaps expressing regrets regarding a parent, spouse, child, etc. All such answers can be disastrous. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: As with faults and weaknesses, never confess a regret. But don’t seem as if you’re stonewalling either. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Best strategy: Say you harbor no regrets, then add a principle or habit you practice regularly for healthy human relations.Example: Pause for reflection, as if the question never occurred to you. Then say, “You know, I really can’t think of anything.” (Pause again, then add): “I would add that as a general management principle, I’ve found that the best way to avoid regrets is to avoid causing them in the first place. I practice one habit that helps me a great deal in this regard. At the end of each day, I mentally review the day’s events and conversations to take a second look at the people and developments I’m involved with and do a doublecheck of what they’re likely to be feeling. Sometimes I’ll see things that do need more follow-up, whether a pat on the back, or maybe a five minute chat in someone’s office to make sure we’re clear on things…whatever.”&lt;br /&gt;“I also like to make each person feel like a member of an elite team, like the Boston Celtics or LA Lakers in their prime. I’ve found that if you let each team member know you expect excellence in their performance…if you work hard to set an example yourself…and if you let people know you appreciate and respect their feelings, you wind up with a highly motivated group, a team that’s having fun at work because they’re striving for excellence rather than brooding over slights or regrets.”&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364718&quot;&gt;Question 5 &lt;/a&gt;Why are you leaving (or did you leave) this position?&lt;br /&gt;TRAPS: Never badmouth your previous industry, company, board, boss, staff, employees or customers. This rule is inviolable: never be negative. Any mud you hurl will only soil your suit.&lt;br /&gt;Especially avoid words like “personality clash”, “didn’t get along”, or others which cast a shadow on your competence, integrity, or temperament.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:&lt;br /&gt;(If you have a job presently)If you’re not yet 100% committed to leaving your present post, don’t be afraid to say so. Since you have a job, you are in a stronger position than someone who does not. But don’t be coy either. State honestly what you’d be hoping to find in a new spot. Of course, as stated often before, you answer will all the stronger if you have already uncovered what this position is all about and you match your desires to it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;(If you do not presently have a job.)Never lie about having been fired. It’s unethical – and too easily checked. But do try to deflect the reason from you personally. If your firing was the result of a takeover, merger, division wide layoff, etc., so much the better.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;But you should also do something totally unnatural that will demonstrate consummate professionalism. Even if it hurts , describe your own firing – candidly, succinctly and without a trace of bitterness – from the company’s point-of-view, indicating that you could understand why it happened and you might have made the same decision yourself.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Your stature will rise immensely and, most important of all, you will show you are healed from the wounds inflicted by the firing. You will enhance your image as first-class management material and stand head and shoulders above the legions of firing victims who, at the slightest provocation, zip open their shirts to expose their battle scars and decry the unfairness of it all.&lt;br /&gt;For all prior positions:Make sure you’ve prepared a brief reason for leaving. Best reasons: more money, opportunity, responsibility or growth.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364719&quot;&gt;Question 6 &lt;/a&gt;The “Silent Treatment”&lt;br /&gt;TRAPS: Beware – if you are unprepared for this question, you will probably not handle it right and possibly blow the interview. Thank goodness most interviewers don’t employ it. It’s normally used by those determined to see how you respond under stress. Here’s how it works:&lt;br /&gt;You answer an interviewer’s question and then, instead of asking another, he just stares at you in a deafening silence.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;You wait, growing a bit uneasy, and there he sits, silent as Mt. Rushmore, as if he doesn’t believe what you’ve just said, or perhaps making you feel that you’ve unwittingly violated some cardinal rule of interview etiquette.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;When you get this silent treatment after answering a particularly difficult question , such as “tell me about your weaknesses”, its intimidating effect can be most disquieting, even to polished job hunters.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Most unprepared candidates rush in to fill the void of silence, viewing prolonged, uncomfortable silences as an invitation to clear up the previous answer which has obviously caused some problem. And that’s what they do – ramble on, sputtering more and more information, sometimes irrelevant and often damaging, because they are suddenly playing the role of someone who’s goofed and is now trying to recoup. But since the candidate doesn’t know where or how he goofed, he just keeps talking, showing how flustered and confused he is by the interviewer’s unmovable silence.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: Like a primitive tribal mask, the Silent Treatment loses all it power to frighten you once you refuse to be intimidated. If your interviewer pulls it, keep quiet yourself for a while and then ask, with sincere politeness and not a trace of sarcasm, “Is there anything else I can fill in on that point?” That’s all there is to it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Whatever you do, don’t let the Silent Treatment intimidate you into talking a blue streak, because you could easily talk yourself out of the position.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364720&quot;&gt;Question 7 &lt;/a&gt;Why should I hire you?&lt;br /&gt;TRAPS: Believe it or not, this is a killer question because so many candidates are unprepared for it. If you stammer or adlib you’ve blown it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: By now you can see how critical it is to apply the overall strategy of uncovering the employer’s needs before you answer questions. If you know the employer’s greatest needs and desires, this question will give you a big leg up over other candidates because you will give him better reasons for hiring you than anyone else is likely to…reasons tied directly to his needs.&lt;br /&gt;Whether your interviewer asks you this question explicitly or not, this is the most important question of your interview because he must answer this question favorably in is own mind before you will be hired. So help him out! Walk through each of the position’s requirements as you understand them, and follow each with a reason why you meet that requirement so well.&lt;br /&gt;Example: “As I understand your needs, you are first and foremost looking for someone who can manage the sales and marketing of your book publishing division. As you’ve said you need someone with a strong background in trade book sales. This is where I’ve spent almost all of my career, so I’ve chalked up 18 years of experience exactly in this area. I believe that I know the right contacts, methods, principles, and successful management techniques as well as any person can in our industry.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“You also need someone who can expand your book distribution channels. In my prior post, my innovative promotional ideas doubled, then tripled, the number of outlets selling our books. I’m confident I can do the same for you.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“You need someone to give a new shot in the arm to your mail order sales, someone who knows how to sell in space and direct mail media. Here, too, I believe I have exactly the experience you need. In the last five years, I’ve increased our mail order book sales from $600,000 to $2,800,000, and now we’re the country’s second leading marketer of scientific and medical books by mail.” Etc., etc., etc.,&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Every one of these selling “couplets” (his need matched by your qualifications) is a touchdown that runs up your score. IT is your best opportunity to outsell your competition.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364721&quot;&gt;Question 8 &lt;/a&gt;Aren’t you overqualified for this position?&lt;br /&gt;TRAPS: The employer may be concerned that you’ll grow dissatisfied and leave.&lt;br /&gt;BEST ANSWER: As with any objection, don’t view this as a sign of imminent defeat. It’s an invitation to teach the interviewer a new way to think about this situation, seeing advantages instead of drawbacks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example: “I recognize the job market for what it is – a marketplace. Like any marketplace, it’s subject to the laws of supply and demand. So ‘overqualified’ can be a relative term, depending on how tight the job market is. And right now, it’s very tight. I understand and accept that.”&lt;br /&gt;“I also believe that there could be very positive benefits for both of us in this match.”&lt;br /&gt;“Because of my unusually strong experience in ________________ , I could start to contribute right away, perhaps much faster than someone who’d have to be brought along more slowly.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“There’s also the value of all the training and years of experience that other companies have invested tens of thousands of dollars to give me. You’d be getting all the value of that without having to pay an extra dime for it. With someone who has yet to acquire that experience, he’d have to gain it on your nickel.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“I could also help you in many things they don’t teach at the Harvard Business School. For example…(how to hire, train, motivate, etc.) When it comes to knowing how to work well with people and getting the most out of them, there’s just no substitute for what you learn over many years of front-line experience. You company would gain all this, too.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“From my side, there are strong benefits, as well. Right now, I am unemployed. I want to work, very much, and the position you have here is exactly what I love to do and am best at. I’ll be happy doing this work and that’s what matters most to me, a lot more that money or title.”&lt;br /&gt;“Most important, I’m looking to make a long term commitment in my career now. I’ve had enough of job-hunting and want a permanent spot at this point in my career. I also know that if I perform this job with excellence, other opportunities cannot help but open up for me right here. In time, I’ll find many other ways to help this company and in so doing, help myself. I really am looking to make a long-term commitment.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;NOTE: The main concern behind the “overqualified” question is that you will leave your new employer as soon as something better comes your way. Anything you can say to demonstrate the sincerity of your commitment to the employer and reassure him that you’re looking to stay for the long-term will help you overcome this objection.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364722&quot;&gt;Question 9 &lt;/a&gt;Where do you see yourself five years from now?&lt;br /&gt;TRAPS: One reason interviewers ask this question is to see if you’re settling for this position, using it merely as a stopover until something better comes along. Or they could be trying to gauge your level of ambition.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you’re too specific, i.e., naming the promotions you someday hope to win, you’ll sound presumptuous. If you’re too vague, you’ll seem rudderless.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: Reassure your interviewer that you’re looking to make a long-term commitment…that this position entails exactly what you’re looking to do and what you do extremely well. As for your future, you believe that if you perform each job at hand with excellence, future opportunities will take care of themselves.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example: “I am definitely interested in making a long-term commitment to my next position. Judging by what you’ve told me about this position, it’s exactly what I’m looking for and what I am very well qualified to do. In terms of my future career path, I’m confident that if I do my work with excellence, opportunities will inevitable open up for me. It’s always been that way in my career, and I’m confident I’ll have similar opportunities here.”&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364723&quot;&gt;Question 10 &lt;/a&gt;Describe your ideal company, location and job.&lt;br /&gt;TRAPS: This is often asked by an experienced interviewer who thinks you may be overqualified, but knows better than to show his hand by posing his objection directly. So he’ll use this question instead, which often gets a candidate to reveal that, indeed, he or she is looking for something other than the position at hand.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: The only right answer is to describe what this company is offering, being sure to make your answer believable with specific reasons, stated with sincerity, why each quality represented by this opportunity is attractive to you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Remember that if you’re coming from a company that’s the leader in its field or from a glamorous or much admired company, industry, city or position, your interviewer and his company may well have an “Avis” complex. That is, they may feel a bit defensive about being “second best” to the place you’re coming from, worried that you may consider them bush league.&lt;br /&gt;This anxiety could well be there even though you’ve done nothing to inspire it. You must go out of your way to assuage such anxiety, even if it’s not expressed, by putting their virtues high on the list of exactly what you’re looking for, providing credible reason for wanting these qualities.&lt;br /&gt;If you do not express genuine enthusiasm for the firm, its culture, location, industry, etc., you may fail to answer this “Avis” complex objection and, as a result, leave the interviewer suspecting that a hot shot like you, coming from a Fortune 500 company in New York, just wouldn’t be happy at an unknown manufacturer based in Topeka, Kansas.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364724&quot;&gt;Question 11 &lt;/a&gt;Why do you want to work at our company?&lt;br /&gt;TRAPS: This question tests whether you’ve done any homework about the firm. If you haven’t, you lose. If you have, you win big.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: This question is your opportunity to hit the ball out of the park, thanks to the in-depth research you should do before any interview.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Best sources for researching your target company: annual reports, the corporate newsletter, contacts you know at the company or its suppliers, advertisements, articles about the company in the trade press.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364725&quot;&gt;Question 12 &lt;/a&gt;What are your career options right now?&lt;br /&gt;TRAPS: The interviewer is trying to find out, “How desperate are you?”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: Prepare for this question by thinking of how you can position yourself as a desired commodity. If you are still working, describe the possibilities at your present firm and why, though you’re greatly appreciated there, you’re looking for something more (challenge, money, responsibility, etc.). Also mention that you’re seriously exploring opportunities with one or two other firms.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you’re not working, you can talk about other employment possibilities you’re actually exploring. But do this with a light touch, speaking only in general terms. You don’t want to seem manipulative or coy.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364726&quot;&gt;Question 13 &lt;/a&gt;Why have you been out of work so long?&lt;br /&gt;TRAPS: A tough question if you’ve been on the beach a long time. You don’t want to seem like damaged goods.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: You want to emphasize factors which have prolonged your job search by your own choice.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example: “After my job was terminated, I made a conscious decision not to jump on the first opportunities to come along. In my life, I’ve found out that you can always turn a negative into a positive IF you try hard enough. This is what I determined to do. I decided to take whatever time I needed to think through what I do best, what I most want to do, where I’d like to do it…and then identify those companies that could offer such an opportunity.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“Also, in all honesty, you have to factor in the recession (consolidation, stabilization, etc.) in the (banking, financial services, manufacturing, advertising, etc.) industry.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“So between my being selective and the companies in our industry downsizing, the process has taken time. But in the end, I’m convinced that when I do find the right match, all that careful evaluation from both sides of the desk will have been well worthwhile for both the company that hires me and myself.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364727&quot;&gt;Question 14 &lt;/a&gt;Tell me honestly about the strong points and weak points of your boss (company, management team, etc.)…&lt;br /&gt;TRAPS: Skillfull interviewers sometimes make it almost irresistible to open up and air a little dirty laundry from your previous position. DON’T &lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER: Remember the rule: Never be negative. Stress only the good points, no matter how charmingly you’re invited to be critical.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Your interviewer doesn’t care a whit about your previous boss. He wants to find out how loyal and positive you are, and whether you’ll criticize him behind his back if pressed to do so by someone in this own company. This question is your opportunity to demonstrate your loyalty to those you work with.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364728&quot;&gt;Question 15 &lt;/a&gt;What good books have you read lately?&lt;br /&gt;TRAPS: As in all matters of your interview, never fake familiarity you don’t have. Yet you don’t want to seem like a dullard who hasn’t read a book since Tom Sawyer.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;ANSWER: Unless you’re up for a position in academia or as book critic for The New York Times, you’re not expected to be a literary lion. But it wouldn’t hurt to have read a handful of the most recent and influential books in your profession and on management.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Consider it part of the work of your job search to read up on a few of these leading books. But make sure they are quality books that reflect favorably upon you, nothing that could even remotely be considered superficial. Finally, add a recently published bestselling work of fiction by a world-class author and you’ll pass this question with flying colors.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364729&quot;&gt;Question 16 &lt;/a&gt;Tell me about a situation when your work was criticized.&lt;br /&gt;TRAPS: This is a tough question because it’s a more clever and subtle way to get you to admit to a weakness. You can’t dodge it by pretending you’ve never been criticized. Everybody has been. Yet it can be quite damaging to start admitting potential faults and failures that you’d just as soon leave buried.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This question is also intended to probe how well you accept criticism and direction.&lt;br /&gt;BEST ANSWERS: Begin by emphasizing the extremely positive feedback you’ve gotten throughout your career and (if it’s true) that your performance reviews have been uniformly excellent.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Of course, no one is perfect and you always welcome suggestions on how to improve your performance. Then, give an example of a not-too-damaging learning experience from early in your career and relate the ways this lesson has since helped you. This demonstrates that you learned from the experience and the lesson is now one of the strongest breastplates in your suit of armor.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you are pressed for a criticism from a recent position, choose something fairly trivial that in no way is essential to your successful performance. Add that you’ve learned from this, too, and over the past several years/months, it’s no longer an area of concern because you now make it a regular practice to…etc.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Another way to answer this question would be to describe your intention to broaden your master of an area of growing importance in your field. For example, this might be a computer program you’ve been meaning to sit down and learn… a new management technique you’ve read about…or perhaps attending a seminar on some cutting-edge branch of your profession.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Again, the key is to focus on something not essential to your brilliant performance but which adds yet another dimension to your already impressive knowledge base.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364730&quot;&gt;Question 17 &lt;/a&gt;What are your outside interests?&lt;br /&gt;TRAPS: You want to be a well-rounded, not a drone. But your potential employer would be even more turned off if he suspects that your heavy extracurricular load will interfere with your commitment to your work duties.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWERS: Try to gauge how this company’s culture would look upon your favorite outside activities and be guided accordingly.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;You can also use this question to shatter any stereotypes that could limit your chances. If you’re over 50, for example, describe your activities that demonstrate physical stamina. If you’re young, mention an activity that connotes wisdom and institutional trust, such as serving on the board of a popular charity.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;But above all, remember that your employer is hiring your for what you can do for him, not your family, yourself or outside organizations, no matter how admirable those activities may be.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364731&quot;&gt;Question 18 &lt;/a&gt;The “Fatal Flaw” question&lt;br /&gt;TRAPS: If an interviewer has read your resume carefully, he may try to zero in on a “fatal flaw” of your candidacy, perhaps that you don’t have a college degree…you’ve been out of the job market for some time…you never earned your CPA, etc.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;A fatal flaw question can be deadly, but usually only if you respond by being overly defensive.&lt;br /&gt;BEST ANSWERS: As every master salesperson knows, you will encounter objections (whether stated or merely thought) in every sale. They’re part and parcel of the buyer’s anxiety. The key is not to exacerbate the buyer’s anxiety but diminish it. Here’s how…&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Whenever you come up against a fatal flaw question:&lt;br /&gt;1. Be completely honest, open and straightforward about admitting the shortcoming. (Showing you have nothing to hide diminishes the buyer’s anxiety.)&lt;br /&gt;2. Do not apologize or try to explain it away. You know that this supposed flaw is nothing to be concerned about, and this is the attitude you want your interviewer to adopt as well.&lt;br /&gt;3. Add that as desirable as such a qualification might be, its lack has made you work all the harder throughout your career and has not prevented you from compiling an outstanding tack record of achievements. You might even give examples of how, through a relentless commitment to excellence, you have consistently outperformed those who do have this qualification. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Of course, the ultimate way to handle “fatal flaw” questions is to prevent them from arising in the first place. You will do that by following the master strategy described in Question 1, i.e., uncovering the employers needs and them matching your qualifications to those needs.&lt;/p&gt;&lt;br /&gt;&lt;p&gt;Once you’ve gotten the employer to start talking about his most urgently-felt wants and goals for the position, and then help him see in step-by-step fashion how perfectly your background and achievements match up with those needs, you’re going to have one very enthusiastic interviewer on your hands, one who is no longer looking for “fatal flaws”.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364732&quot;&gt;Question 19         &lt;/a&gt;How do you feel about reporting to a younger person (minority, woman, etc)?&lt;br /&gt;TRAPS:  It’s a shame that some interviewers feel the need to ask this question, but many understand the reality that prejudices still exist among some job candidates, and it’s better to try to flush them out beforehand.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The trap here is that in today’s politically sensitized environment, even a well-intentioned answer can result in planting your foot neatly in your mouth.  Avoid anything which smacks of a patronizing or an insensitive attitude, such as “I think they make terrific bosses” or “Hey, some of my best friends are…”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Of course, since almost anyone with an IQ above room temperature will at least try to steadfastly affirm the right answer here, your interviewer will be judging your sincerity most of all.  “Do you really feel that way?” is what he or she will be wondering.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;So you must make your answer believable and not just automatic.  If the firm is wise enough to have promoted peopled on the basis of ability alone, they’re likely quite proud of it, and prefer to hire others who will wholeheartedly share their strong sense of fair play. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  You greatly admire a company that hires and promotes on merit alone and you couldn’t agree more with that philosophy.  The age (gender, race, etc.) of the person you report to would certainly make no difference to you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Whoever has that position has obviously earned it and knows their job well.  Both the person and the position are fully deserving of respect.  You believe that all people in a company, from the receptionist to the Chairman, work best when their abilities, efforts and feelings are respected and rewarded fairly, and that includes you.  That’s the best type of work environment you can hope to find.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364733&quot;&gt;Question 20         &lt;/a&gt;On confidential matters…&lt;br /&gt;TRAPS:  When an interviewer presses you to reveal confidential information about a present or former employer, you may feel it’s a no-win situation.  If you cooperate, you could be judged untrustworthy.  If you don’t, you may irritate the interviewer and seem obstinate, uncooperative or overly suspicious.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Your interviewer may press you for this information for two reasons.&lt;br /&gt;First, many companies use interviews to research the competition.  It’s a perfect set-up.  Here in their own lair, is an insider from the enemy camp who can reveal prized information on the competition’s plans, research, financial condition, etc.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Second, the company may be testing your integrity to see if you can be cajoled or bullied into revealing confidential data.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;What to do?  The answer here is easy.  Never reveal anything truly confidential about a present or former employer.  By all means, explain your reticence diplomatically.  For example, “I certainly want to be as open as I can about that.  But I also wish to respect the rights of those who have trusted me with their most sensitive information, just as you would hope to be able to trust any of your key people when talking with a competitor…”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;And certainly you can allude to your finest achievements in specific ways that don’t reveal the combination to the company safe.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;But be guided by the golden rule.  If you were the owner of your present company, would you feel it ethically wrong for the information to be given to your competitors?  If so, steadfastly refuse to reveal it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Remember that this question pits your desire to be cooperative against your integrity.  Faced with any such choice, always choose integrity.  It is a far more valuable commodity than whatever information the company may pry from you.  Moreover, once you surrender the information, your stock goes down.  They will surely lose respect for you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;One President we know always presses candidates unmercifully for confidential information. If he doesn’t get it, he grows visibly annoyed, relentlessly inquisitive,  It’s all an act.  He couldn’t care less about the information. This is his way of testing the candidate’s moral fiber.  Only those who hold fast are hired.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364734&quot;&gt;Question 21         &lt;/a&gt;Would you lie for the company?&lt;br /&gt;TRAPS:  This another question that pits two values against one another, in this case loyalty against integrity.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Try to avoid choosing between two values, giving a positive statement which covers all bases instead.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “I would never do anything to hurt the company..”&lt;br /&gt;If aggressively pressed to choose between two competing values, always choose personal integrity.  It is the most prized of all values.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364735&quot;&gt;Question 22         &lt;/a&gt;Looking back, what would you do differently in your life?&lt;br /&gt;TRAPS:  This question is usually asked to uncover any life-influencing mistakes, regrets, disappointments or problems that may continue to affect your personality and performance.&lt;br /&gt;You do not want to give the interviewer anything negative to remember you by, such as some great personal or career disappointment, even long ago, that you wish could have been avoided.&lt;br /&gt;Nor do you wish to give any answer which may hint that your whole heart and soul will not be in your work.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Indicate that you are a happy, fulfilled, optimistic person and that, in general, you wouldn’t change a thing.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “It’s been a good life, rich in learning and experience, and the best it yet to come.  Every experience in life is a lesson it its own way.  I wouldn’t change a thing.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364736&quot;&gt;Question 23         &lt;/a&gt;Could you have done better in your last job?&lt;br /&gt;TRAPS:  This is no time for true confessions of major or even minor problems.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Again never be negative.&lt;br /&gt;Example:  “I suppose with the benefit of hindsight you can always find things to do better, of course, but off the top of my head, I can’t think of anything of major consequence.”&lt;br /&gt;(If more explanation seems necessary) Describer a situation that didn’t suffer because of you but from external conditions beyond your control.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;For example, describe the disappointment you felt with a test campaign, new product launch, merger, etc., which looked promising at first, but led to underwhelming results.  “I wish we could have known at the start what we later found out (about the economy turning, the marketplace changing, etc.), but since we couldn’t, we just had to go for it.  And we did learn from it…”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364737&quot;&gt;Question 24         &lt;/a&gt;Can you work under pressure?&lt;br /&gt;TRAPS:  An easy question, but you want to make your answer believable.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Absolutely…(then prove it with a vivid example or two of a goal or project accomplished under severe pressure.)&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364738&quot;&gt;Question 25         &lt;/a&gt;What makes you angry?&lt;br /&gt;TRAPS:  You don’t want to come across either as a hothead or a wimp.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:    Give an answer that’s suited to both your personality and the management style of the firm.  Here, the homework you’ve done about the company and its style can help in your choice of words.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Examples:  If you are a reserved person and/or the corporate culture is coolly professional:&lt;br /&gt;“I’m an even-tempered and positive person by nature, and I believe this helps me a great deal in keeping my department running smoothly, harmoniously and with a genuine esprit de corps.  I believe in communicating clearly what’s expected, getting people’s commitment to those goals, and then following up continuously to check progress.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“If anyone or anything is going off track, I want to know about it early.  If, after that kind of open communication and follow up, someone isn’t getting the job done, I’ll want to know why.  If there’s no good reason, then I’ll get impatient and angry…and take appropriate steps from there.  But if you hire good people, motivate them to strive for excellence and then follow up constantly, it almost never gets to that state.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you are feisty by nature and/or the position calls for a tough straw boss.&lt;br /&gt;“You know what makes me angry?  People who (the fill in the blanks with the most objectionable traits for this type of position)…people who don’t pull their own weight, who are negative, people who lie…etc.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364739&quot;&gt;Question 26         &lt;/a&gt;Why aren’t you earning more money at this stage of your career?&lt;br /&gt;TRAPS:  You don’t want to give the impression that money is not important to you, yet you want to explain why your salary may be a little below industry standards.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  You like to make money, but other factors are even more important.&lt;br /&gt;Example:  “Making money is very important to me, and one reason I’m here is because I’m looking to make more.  Throughout my career, what’s been even more important to me is doing work I really like to do at the kind of company I like and respect.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;(Then be prepared to be specific about what your ideal position and company would be like, matching them as closely as possible to the opportunity at hand.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364740&quot;&gt;Question 27         &lt;/a&gt;Who has inspired you in your life and why?&lt;br /&gt;TRAPS:  The two traps here are unpreparedness and irrelevance.  If you grope for an answer, it seems you’ve never been inspired.  If you ramble about your high school basketball coach, you’ve wasted an opportunity to present qualities of great value to the company.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Have a few heroes in mind, from your mental “Board of Directors” – Leaders in your industry, from history or anyone else who has been your mentor.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Be prepared to give examples of how their words, actions or teachings have helped inspire your achievements.  As always, prepare an answer which highlights qualities that would be highly valuable in the position you are seeking.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364741&quot;&gt;Question 28         &lt;/a&gt;What was the toughest decision you ever had to make?&lt;br /&gt;TRAPS:  Giving an unprepared or irrelevant answer.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Be prepared with a good example, explaining why the decision was difficult…the process you followed in reaching it…the courageous or effective way you carried it out…and the beneficial results.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364742&quot;&gt;Question 29         &lt;/a&gt;Tell me about the most boring job you’ve ever had.&lt;br /&gt;TRAPS:  You give a very memorable description of a very boring job.  Result?  You become associated with this boring job in the interviewer’s mind.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  You have never allowed yourself to grow bored with a job and you can’t understand it when others let themselves fall into that rut.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “Perhaps I’ve been fortunate, but that I’ve never found myself bored with any job I have ever held.  I’ve always enjoyed hard work.  As with actors who feel there are no small parts, I also believe that in every company or department there are exciting challenges and intriguing problems crying out for energetic and enthusiastic solutions.  If you’re bored, it’s probably because you’re not challenging yourself to tackle those problems right under your nose.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364743&quot;&gt;Question 30         &lt;/a&gt;Have you been absent from work more than a few days in any previous position?&lt;br /&gt;TRAPS:  If you’ve had a problem, you can’t lie.  You could easily be found out.  Yet admitting an attendance problem could raise many flags.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  If you have had no problem, emphasize your excellent and consistent attendance record throughout your career.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Also describe how important you believe such consistent attendance is for a key executive…why it’s up to you to set an example of dedication…and why there’s just no substitute for being there with your people to keep the operation running smoothly, answer questions and handle problems and crises as they arise.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you do have a past attendance problem, you want to minimize it, making it clear that it was an exceptional circumstance and that it’s cause has been corrected.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;To do this, give the same answer as above but preface it with something like, “Other that being out last year (or whenever) because of (your reason, which is now in the past), I have never had a problem and have enjoyed an excellent attendance record throughout my career.  Furthermore, I believe, consistent attendance is important because…”  (Pick up the rest of the answer as outlined above.).&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364744&quot;&gt;Question 31         &lt;/a&gt;What changes would you make if you came on board?&lt;br /&gt;TRAPS:  Watch out!  This question can derail your candidacy faster than a bomb on the tracks – and just as you are about to be hired.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Reason:  No matter how bright you are, you cannot know the right actions to take in a position before you settle in and get to know the operation’s strengths, weaknesses key people, financial condition, methods of operation, etc.  If you lunge at this temptingly baited question, you will probably be seen as someone who shoots from the hip.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Moreover, no matter how comfortable you may feel with your interviewer, you are still an outsider.  No one, including your interviewer, likes to think that a know-it-all outsider is going to come in, turn the place upside down and with sweeping, grand gestures, promptly demonstrate what jerks everybody’s been for years.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  You, of course, will want to take a good hard look at everything the company is doing before making any recommendations.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “Well, I wouldn’t be a very good doctor if I gave my diagnosis before the examination.  Should you hire me, as I hope you will, I’d want to take a good hard look at everything you’re doing and understand why it’s being done that way.  I’d like to have in-depth meetings with you and the other key people to get a deeper grasp of what you feel you’re doing right and what could be improved.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“From what you’ve told me so far, the areas of greatest concern to you are…” (name them.  Then do two things.  First, ask if these are in fact his major concerns.  If so then reaffirm how your experience in meeting similar needs elsewhere might prove very helpful).&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364745&quot;&gt;Question 32         &lt;/a&gt;I’m concerned that you don’t have as much experience as we’d like in…&lt;br /&gt;TRAPS:  This could be a make-or-break question.  The interviewer mostly likes what he sees, but has doubts over one key area.  If you can assure him on this point, the job may be yours.&lt;br /&gt;BEST ANSWER:   This question is related to “The Fatal Flaw” (Question 18), but here the concern is not that you are totally missing some qualifications, such as CPA certification, but rather that your experience is light in one area.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Before going into any interview, try to identify the weakest aspects of your candidacy from this company’s point of view.  Then prepare the best answer you possible can to shore up your defenses.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;To get past this question with flying colors, you are going to rely on your master strategy of uncovering the employer’s greatest wants and needs and then matching them with your strengths.  Since you already know how to do this from Question 1, you are in a much stronger position.  &lt;/p&gt;&lt;p&gt;&lt;br /&gt;More specifically, when the interviewer poses as objection like this, you should…&lt;br /&gt;1.                  Agree on the importance of this qualification.&lt;br /&gt;2.                  Explain that your strength may be indeed be greater than your resume indicates because…&lt;br /&gt;3.                  When this strength is added to your other strengths, it’s really your combination of qualifications that’s most important.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Then review the areas of your greatest strengths that match up most favorably with the company’s most urgently-felt wants and needs.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This is powerful way to handle this question for two reasons.  First, you’re giving your interviewer more ammunition in the area of his concern.  But more importantly, you’re shifting his focus away from this one, isolated area and putting it on the unique combination of strengths you offer, strengths which tie in perfectly with his greatest wants.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364746&quot;&gt;Question 33         &lt;/a&gt;How do you feel about working nights and weekends?&lt;br /&gt;TRAPS:  Blurt out “no way, Jose” and you can kiss the job offer goodbye.  But what if you have a family and want to work a reasonably normal schedule?  Is there a way to get both the job and the schedule you want?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  First, if you’re a confirmed workaholic, this question is a softball lob.  Whack it out of the park on the first swing by saying this kind of schedule is just your style.  Add that your family understands it.  Indeed, they’re happy for you, as they know you get your greatest satisfaction from your work.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If however, you prefer a more balanced lifestyle, answer this question with another:  “What’s the norm for your best people here?”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If the hours still sound unrealistic for you, ask, “Do you have any top people who perform exceptionally for you, but who also have families and like to get home in time to see them at night?”  Chances are this company does, and this associates you with this other “top-performers-who-leave-not-later-than-six” group.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Depending on the answer, be honest about how you would fit into the picture.  If all those extra hours make you uncomfortable, say so, but phrase your response positively.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “I love my work and do it exceptionally well.  I think the results speak for themselves, especially in …(mention your two or three qualifications of greater interest to the employer.  Remember, this is what he wants most, not a workaholic with weak credentials).  Not only would I bring these qualities, but I’ve built my whole career on working not just hard, but smart.  I think you’ll find me one of the most productive people here.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;I do have a family who likes to see me after work and on weekends.  They add balance and richness to my life, which in turn helps me be happy and productive at work.  If I could handle some of the extra work at home in the evenings or on weekends, that would be ideal.  You’d be getting a person of exceptional productivity who meets your needs with strong credentials.  And I’d be able to handle some of the heavy workload at home where I can be under the same roof as my family.  Everybody would win.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364747&quot;&gt;Question 34         &lt;/a&gt;Are you willing to relocate or travel?&lt;br /&gt;TRAPS:  Answer with a flat “no” and you may slam the door shut on this opportunity.  But what if you’d really prefer not to relocate or travel, yet wouldn’t want to lose the job offer over it?&lt;br /&gt;BEST ANSWER:   First find out where you may have to relocate and how much travel may be involved.  Then respond to the question.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If there’s no problem, say so enthusiastically.&lt;br /&gt;If you do have a reservation, there are two schools of thought on how to handle it.&lt;br /&gt;One advises you to keep your options open and your reservations to yourself in the early going, by saying, “no problem”.  You strategy here is to get the best offer you can, then make a judgment whether it’s worth it to you to relocate or travel.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Also, by the time the offer comes through, you may have other offers and can make a more informed decision.  Why kill of this opportunity before it has chance to blossom into something really special?  And if you’re a little more desperate three months from now, you might wish you hadn’t slammed the door on relocating or traveling.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The second way to handle this question is to voice a reservation, but assert that you’d be open to relocating (or traveling) for the right opportunity.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The answering strategy you choose depends on how eager you are for the job.  If you want to take no chances, choose the first approach.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you want to play a little harder-to-get in hopes of generating a more enticing offer, choose the second.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364748&quot;&gt;Question 35         &lt;/a&gt;Do you have the stomach to fire people?  Have you had experience firing many people?&lt;br /&gt;TRAPS:  This “innocent” question could be a trap door which sends you down a chute and lands you in a heap of dust outside the front door.  Why?  Because its real intent is not just to see if you’ve got the stomach to fire, but also to uncover poor judgment in hiring which has caused you to fire so many.  Also, if you fire so often, you could be a tyrant.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;So don’t rise to the bait by boasting how many you’ve fired, unless you’ve prepared to explain why it was beyond your control, and not the result of your poor hiring procedures or foul temperament.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:    Describe the rational and sensible management process you follow in both hiring and firing.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “My whole management approach is to hire the best people I can find, train them thoroughly and well, get them excited and proud to be part of our team, and then work with them to achieve our goals together.  If you do all of that right, especially hiring the right people, I’ve found you don’t have to fire very often.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“So with me, firing is a last resort.  But when it’s got to be done, it’s got to be done, and the faster and cleaner, the better.  A poor employee can wreak terrible damage in undermining the morale of an entire team of good people.  When there’s no other way, I’ve found it’s better for all concerned to act decisively in getting rid of offenders who won’t change their ways.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364749&quot;&gt;Question 36         &lt;/a&gt;Why have you had so many jobs?&lt;br /&gt;TRAPS:  Your interviewer fears you may leave this position quickly, as you have others.  He’s concerned you may be unstable, or a “problem person” who can’t get along with others.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  First, before you even get to the interview stage, you should try to minimize your image as job hopper.  If there are several entries on your resume of less than one year, consider eliminating the less important ones.  Perhaps you can specify the time you spent at previous positions in rounded years not in months and years.  &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:   Instead of showing three positions this way:&lt;br /&gt;6/1982 – 3/1983, Position A;4/1983 – 12/1983, Position B;1/1984 – 8/1987, Position C;&lt;br /&gt;…it would be better to show simply:&lt;br /&gt;1982 – 1983, Position A;1984 – 1987 Position C.&lt;br /&gt;In other words, you would drop Position B altogether.  Notice what a difference this makes in reducing your image as a job hopper.&lt;br /&gt;Once in front of the interviewer and this question comes up, you must try to reassure him.  Describe each position as part of an overall pattern of growth and career destination.&lt;br /&gt;Be careful not to blame other people for your frequent changes.  But you can and should attribute certain changes to conditions beyond your control.  &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  Thanks to an upcoming merger, you wanted to avoid an ensuing bloodbath, so you made a good, upward career move before your department came under the axe of the new owners.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If possible, also show that your job changes were more frequent in your younger days, while you were establishing yourself, rounding out your skills and looking for the right career path.  At this stage in your career, you’re certainly much more interested in the best long-term opportunity.&lt;br /&gt;You might also cite the job(s) where you stayed the longest and describe that this type of situation is what you’re looking for now.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364750&quot;&gt;Question 37         &lt;/a&gt;What do you see as the proper role/mission of……a good (job title you’re seeking);…a good manager;…an executive in serving the community;…a leading company in our industry; etc.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;TRAPS:  These and other “proper role” questions are designed to test your understanding of your place in the bigger picture of your department, company, community and profession….as well as the proper role each of these entities should play in its bigger picture.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The question is most frequently asked by the most thoughtful individuals and companies…or by those concerned that you’re coming from a place with a radically different corporate culture (such as from a big government bureaucracy to an aggressive small company).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The most frequent mistake executives make in answering is simply not being prepared (seeming as if they’ve never giving any of this a though.)…or in phrasing an answer best suited to their prior organization’s culture instead of the hiring company’s.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:    Think of the most essential ingredients of success for each category above – your job title, your role as manager, your firm’s role, etc.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Identify at least three but no more than six qualities you feel are most important to success in each role.  Then commit your response to memory.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Here, again, the more information you’ve already drawn out about the greatest wants and needs of the interviewer, and the more homework you’ve done to identify the culture of the firm, the more on-target your answer will be.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364751&quot;&gt;Question 38         &lt;/a&gt;What would you say to your boss if he’s crazy about an idea, but you think it stinks?&lt;br /&gt;TRAPS:  This is another question that pits two values, in this case loyalty and honesty, against one another.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:    Remember the rule stated earlier:  In any conflict between values, always choose integrity.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  I believe that when evaluating anything, it’s important to emphasize the positive.  What do I like about this idea?”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“Then, if you have reservations, I certainly want to point them out, as specifically, objectively and factually as I can.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“After all, the most important thing I owe my boss is honesty.  If he can’t count on me for that, then everything else I may do or say could be questionable in his eyes.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“But I also want to express my thoughts in a constructive way.  So my goal in this case would be to see if my boss and I could make his idea even stronger and more appealing, so that it effectively overcomes any initial reservation I or others may have about it.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“Of course, if he overrules me and says, ‘no, let’s do it my way,’ then I owe him my full and enthusiastic support to make it work as best it can.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364752&quot;&gt;Question 39         &lt;/a&gt;How could you have improved your career progress?&lt;br /&gt;TRAPS:  This is another variation on the question, “If you could, how would you live your life over?”  Remember, you’re not going to fall for any such invitations to rewrite person history. You can’t win if you do.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  You’re generally quite happy with your career progress.  Maybe, if you had known something earlier in life (impossible to know at the time, such as the booming growth in a branch in your industry…or the corporate downsizing that would phase out your last job), you might have moved in a certain direction sooner.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;But all things considered, you take responsibility for where you are, how you’ve gotten there, where you are going…and you harbor no regrets.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364753&quot;&gt;Question 40         &lt;/a&gt;What would you do if a fellow executive on your own corporate level wasn’t pulling his/her weight…and this was hurting your department?&lt;br /&gt;TRAPS:  This question and other hypothetical ones test your sense of human relations and how you might handle office politics.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Try to gauge the political style of the firm and be guided accordingly.  In general, fall back on universal principles of effective human relations – which in the end, embody the way you would like to be treated in a similar circumstance.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “Good human relations would call for me to go directly to the person and explain the situation, to try to enlist his help in a constructive, positive solution.  If I sensed resistance, I would be as persuasive as I know how to explain the benefits we can all gain from working together, and the problems we, the company and our customers will experience if we don’t.”&lt;br /&gt;POSSIBLE FOLLOW-UP QUESTION:  And what would you do if he still did not change his ways?&lt;/p&gt;&lt;p&gt;&lt;br /&gt;ANSWER:  “One thing I wouldn’t do is let the problem slide, because it would only get worse and overlooking it would set a bad precedent.  I would try again and again and again, in whatever way I could, to solve the problem, involving wider and wider circles of people, both above and below the offending executive and including my own boss if necessary, so that everyone involved can see the rewards for teamwork and the drawbacks of non-cooperation.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“I might add that I’ve never yet come across a situation that couldn’t be resolved by harnessing others in a determined, constructive effort.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364754&quot;&gt;Question 41         &lt;/a&gt;You’ve been with your firm a long time.  Won’t it be hard switching to a new company?&lt;br /&gt;TRAPS:  Your interviewer is worried that this old dog will find it hard to learn new tricks.&lt;br /&gt;BEST ANSWER:  To overcome this objection, you must point to the many ways you have grown and adapted to changing conditions at your present firm.  It has not been a static situation. Highlight the different responsibilities you’ve held, the wide array of new situations you’ve faced and conquered.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;As a result, you’ve learned to adapt quickly to whatever is thrown at you, and you thrive on the stimulation of new challenges.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;To further assure the interviewer, describe the similarities between the new position and your prior one.  Explain that you should be quite comfortable working there, since their needs and your skills make a perfect match.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364755&quot;&gt;Question 42         &lt;/a&gt;May I contact your present employer for a reference?&lt;br /&gt;TRAPS:  If you’re trying to keep your job search private, this is the last thing you want.  But if you don’t cooperate, won’t you seem as if you’re trying to hide something?&lt;br /&gt;BEST ANSWER:  Express your concern that you’d like to keep your job search private, but that in time, it will be perfectly okay.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “My present employer is not aware of my job search and, for obvious reasons; I’d prefer to keep it that way.  I’d be most appreciative if we kept our discussion confidential right now.  Of course, when we both agree the time is right, then by all means you should contact them.  I’m very proud of my record there.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364756&quot;&gt;Question 43         &lt;/a&gt;Give me an example of your creativity (analytical skill…managing ability, etc.)&lt;br /&gt;TRAPS:  The worst offense here is simply being unprepared.  Your hesitation may seem as if you’re having a hard time remembering the last time you were creative, analytical, etc.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Remember from Question 2 that you should commit to memory a list of your greatest and most recent achievements, ever ready on the tip of your tongue.&lt;br /&gt;If you have such a list, it’s easy to present any of your achievements in light of the quality the interviewer is asking about.  For example, the smashing success you orchestrated at last year’s trade show could be used as an example of creativity, or analytical ability, or your ability to manage.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364757&quot;&gt;Question 44         &lt;/a&gt;Where could you use some improvement?&lt;br /&gt;TRAPS:  Another tricky way to get you to admit weaknesses.  Don’t fall for it.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Keep this answer, like all your answers, positive.  A good way to answer this question is to identify a cutting-edge branch of your profession (one that’s not essential to your employer’s needs) as an area you’re very excited about and want to explore more fully over the next six months.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364758&quot;&gt;Question 45         &lt;/a&gt;What do you worry about?&lt;br /&gt;TRAPS:  Admit to worrying and you could sound like a loser.  Saying you never worry doesn’t sound credible.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Redefine the word ‘worry’ so that it does not reflect negatively on you.&lt;br /&gt;Example:  “I wouldn’t call it worry, but I am a strongly goal-oriented person.  So I keep turning over in my mind anything that seems to be keeping me from achieving those goals, until I find a solution.  That’s part of my tenacity, I suppose.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364759&quot;&gt;Question 46         &lt;/a&gt;How many hours a week do you normally work?&lt;br /&gt;TRAPS:  You don’t want to give a specific number.  Make it to low, and you may not measure up.  Too high, and you’ll forever feel guilty about sneaking out the door at 5:15.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  If you are in fact a workaholic and you sense this company would like that:  Say you are a confirmed workaholic, that you often work nights and weekends.  Your family accepts this because it makes you fulfilled.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you are not a workaholic:  Say you have always worked hard and put in long hours.  It goes with the territory.  It one sense, it’s hard to keep track of the hours because your work is a labor of love, you enjoy nothing more than solving problems.  So you’re almost always thinking about your work, including times when you’re home, while shaving in the morning, while commuting, etc.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364760&quot;&gt;Question 47         &lt;/a&gt;What’s the most difficult part of being a (job title)?&lt;br /&gt;TRAPS:  Unless you phrase your answer properly, your interviewer may conclude that whatever you identify as “difficult” is where you are weak.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  First, redefine “difficult” to be “challenging” which is more positive.  Then, identify an area everyone in your profession considers challenging and in which you excel.  Describe the process you follow that enables you to get splendid results…and be specific about those results.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “I think every sales manager finds it challenging to motivate the troops in a recession. But that’s probably the strongest test of a top sales manager.  I feel this is one area where I excel.”  &lt;/p&gt;&lt;p&gt;&lt;br /&gt;“When I see the first sign that sales may slip or that sales force motivation is flagging because of a downturn in the economy, here’s the plan I put into action immediately…” (followed by a description of each step in the process…and most importantly,  the exceptional results you’ve achieved.).&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364761&quot;&gt;Question 48         &lt;/a&gt;The “Hypothetical Problem”&lt;br /&gt;TRAPS:  Sometimes an interviewer will describe a difficult situation and ask, “How would you handle this?”  Since it is virtually impossible to have all the facts in front of you from such a short presentation, don’t fall into the trap of trying to solve this problem and giving your verdict on the spot. It will make your decision-making process seem woefully inadequate.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Instead, describe the rational, methodical process you would follow in analyzing this problem, who you would consult with, generating possible solutions, choosing the best course of action, and monitoring the results.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Remember, in all such, “What would you do?” questions, always describe your process or working methods, and you’ll never go wrong.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364762&quot;&gt;Question 49         &lt;/a&gt;What was the toughest challenge you’ve ever faced?&lt;br /&gt;TRAPS:  Being unprepared or citing an example from so early in your life that it doesn’t score many points for you at this stage of your career.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  This is an easy question if you’re prepared. Have a recent example ready that demonstrates either:&lt;br /&gt;1.      A quality most important to the job at hand; or&lt;br /&gt;2.      A quality that is always in demand, such as leadership, initiative, managerial skill, persuasiveness, courage, persistence, intelligence, etc.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364763&quot;&gt;Question 50         &lt;/a&gt;Have you consider starting your own business?&lt;br /&gt;TRAPS:  If you say “yes” and elaborate enthusiastically, you could be perceived as a loose cannon in a larger company, too entrepreneurial to make a good team player…or someone who had to settle for the corporate life because you couldn’t make a go of your own business.&lt;br /&gt;Also too much enthusiasm in answering “yes” could rouse the paranoia of a small company indicating that you may plan to go out on your own soon, perhaps taking some key accounts or trade secrets with you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;On the other hand, if you answer “no, never” you could be perceived as a security-minded drone who never dreamed a big dream.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Again it’s best to:&lt;br /&gt;1.      Gauge this company’s corporate culture before answering and…&lt;br /&gt;2.      Be honest (which doesn’t mean you have to vividly share your fantasy of the franchise or bed-and-breakfast you someday plan to open).&lt;br /&gt;In general, if the corporate culture is that of a large, formal, military-style structure, minimize any indication that you’d love to have your own business.  You might say, “Oh, I may have given it a thought once or twice, but my whole career has been in larger organizations.  That’s where I have excelled and where I want to be.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If the corporate culture is closer to the free-wheeling, everybody’s-a-deal-maker variety, then emphasize that in a firm like this, you can virtually get the best of all worlds, the excitement of seeing your own ideas and plans take shape…combined with the resources and stability of a well-established organization.   Sounds like the perfect environment to you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In any case, no matter what the corporate culture, be sure to indicate that any desires about running your own show are part of your past, not your present or future.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The last thing you want to project is an image of either a dreamer who failed and is now settling for the corporate cocoon…or the restless maverick who will fly out the door with key accounts, contacts and trade secrets under his arms just as soon as his bankroll has gotten rebuilt.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Always remember:  Match what you want with what the position offers.  The more information you’ve uncovered about the position, the more believable you can make your case.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364764&quot;&gt;Question 51         &lt;/a&gt;What are your goals?&lt;br /&gt;TRAPS:  Not having any…or having only vague generalities, not highly specific goals.&lt;br /&gt;BEST ANSWER:  Many executives in a position to hire you are strong believers in goal-setting. (It’s one of the reason they’ve achieved so much).  They like to hire in kind.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you’re vague about your career and personal goals, it could be a big turnoff to may people you will encounter in your job search.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Be ready to discuss your goals for each major area of your life:  career, personal development and learning, family, physical (health), community service and (if your interviewer is clearly a religious person) you could briefly and generally allude to your spiritual goals (showing you are a well-rounded individual with your values in the right order).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Be prepared to describe each goal in terms of specific milestones you wish to accomplish along the way, time periods you’re allotting for accomplishment, why the goal is important to you, and the specific steps you’re taking to bring it about.  But do this concisely, as you never want to talk more than two minutes straight before letting your interviewer back into the conversation.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364765&quot;&gt;Question 52         &lt;/a&gt;What do you for when you hire people?&lt;br /&gt;TRAPS:  Being unprepared for the question.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Speak your own thoughts here, but for the best answer weave them around the three most important qualifications for any position.&lt;br /&gt;1.      Can the person do the work (qualifications)?&lt;br /&gt;2.      Will the person do the work (motivation)?&lt;br /&gt;3.      Will the person fit in (“our kind of team player”)?&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364766&quot;&gt;Question 53         &lt;/a&gt;Sell me this stapler…(this pencil…this clock…or some other object on interviewer’s desk).&lt;br /&gt;TRAPS:  Some interviewers, especially business owners and hard-changing executives in marketing-driven companies, feel that good salesmanship is essential for any key position and ask for an instant demonstration of your skill.  Be ready.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Of course, you already know the most important secret of all great salesmanship – “find out what people want, then show them how to get it.”&lt;br /&gt;If your interviewer picks up his stapler and asks, “sell this to me,” you are going to demonstrate this proven master principle.  Here’s how: &lt;br /&gt;“Well, a good salesman must know both his product and his prospect before he sells anything.  If I were selling this, I’d first get to know everything I could about it, all its features and benefits.”&lt;br /&gt;“Then, if my goal were to sell it you, I would do some research on how you might use a fine stapler like this.  The best way to do that is by asking some questions.  May I ask you a few questions?”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Then ask a few questions such as, “Just out of curiosity, if you didn’t already have a stapler like this, why would you want one?  And in addition to that?  Any other reason?  Anything else?”&lt;br /&gt;“And would you want such a stapler to be reliable?...Hold a good supply of staples?”  (Ask more questions that point to the features this stapler has.)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Once you’ve asked these questions, make your presentation citing all the features and benefits of this stapler and why it’s exactly what the interviewer just told you he’s looking for.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Then close with, “Just out of curiosity, what would you consider a reasonable price for a quality stapler like this…a stapler you could have right now and would (then repeat all the problems the stapler would solve for him)?  Whatever he says, (unless it’s zero), say, “Okay, we’ve got a deal.”&lt;br /&gt;NOTE:  If your interviewer tests you by fighting every step of the way, denying that he even wants such an item, don’t fight him.  Take the product away from him by saying, “Mr. Prospect, I’m delighted you’ve told me right upfront that there’s no way you’d ever want this stapler.  As you well know, the first rule of the most productive salespeople in any field is to meet the needs of people who really need and want our products, and it just wastes everyone’s time if we try to force it on those who don’t.  And I certainly wouldn’t want to waste your time.  But we sell many items.  Is there any product on this desk you would very much like to own…just one item?”  When he points something out, repeat the process above.  If he knows anything about selling, he may give you a standing ovation.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364767&quot;&gt;Question 54         &lt;/a&gt;“The Salary Question” – How much money do you want?&lt;br /&gt;TRAPS:  May also be phrases as, “What salary are you worth?”…or, “How much are you making now?”  This is your most important negotiation. Handle it wrong and you can blow the job offer or go to work at far less than you might have gotten.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  For maximum salary negotiating power, remember these five guidelines:&lt;br /&gt;1.      Never bring up salary.  Let the interviewer do it first.  Good salespeople sell their products thoroughly before talking price.  So should you.  Make the interviewer want you first, and your bargaining position will be much stronger.&lt;br /&gt;2.      If your interviewer raises the salary question too early, before you’ve had a chance to create desire for your qualifications, postpone the question, saying something like, “Money is important to me, but is not my main concern.  Opportunity and growth are far more important.  What I’d rather do, if you don’t mind, is explore if I’m right for the position, and then talk about money. Would that be okay?”&lt;br /&gt;3.      The #1 rule of any negotiation is:  the side with more information wins.  After you’ve done a thorough job of selling the interviewer and it’s time to talk salary, the secret is to get the employer talking about what he’s willing to pay before you reveal what you’re willing to accept.  So, when asked about salary, respond by asking, “I’m sure the company has already established a salary range for this position.  Could you tell me what that is?”  Or, “I want an income commensurate with my ability and qualifications.  I trust you’ll be fair with me.  What does the position pay?” Or, more simply, “What does this position pay?”&lt;br /&gt;4.      Know beforehand what you’d accept.  To know what’s reasonable, research the job market and this position for any relevant salary information.  Remember that most executives look for a 20-25%$ pay boost when they switch jobs. If you’re grossly underpaid, you may want more.&lt;br /&gt;5.      Never lie about what you currently make, but feel free to include the estimated cost of all your fringes, which could well tack on 25-50% more to your present “cash-only” salary.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364768&quot;&gt;Question 55         &lt;/a&gt;The Illegal Question&lt;br /&gt;TRAPS:  Illegal questions include any regarding your age…number and ages of your children or other dependents…marital status…maiden name…religion…political affiliation…ancestry…national origin…birthplace…naturalization of your parents, spouse or children…diseases…disabilities…clubs…or spouse’s occupation…unless any of the above are directly related to your performance of the job.  You can’t even be asked about arrests, though you can be asked about convictions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Under the ever-present threat of lawsuits, most interviewers are well aware of these taboos.  Yet you may encounter, usually on a second or third interview, a senior executive who doesn’t interview much and forgets he can’t ask such questions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;You can handle an illegal question in several ways. First, you can assert your legal right not to answer. But this will frighten or embarrass your interviewer and destroy any rapport you had.&lt;br /&gt;Second, you could swallow your concerns over privacy and answer the question straight forwardly if you feel the answer could help you.  For example, your interviewer, a devout Baptist, recognizes you from church and mentions it. Here, you could gain by talking about your church.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Third, if you don’t want your privacy invaded, you can diplomatically answer the concern behind the question without answering the question itself.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  If you are over 50 and are asked, “How old are you?” you can answer with a friendly, smiling question of your own on whether there’s a concern that your age my affect your performance.  Follow this up by reassuring the interviewer that there’s nothing in this job you can’t do and, in fact, your age and experience are the most important advantages you offer the employer for the following reasons…&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Another example:  If asked, “Do you plan to have children?” you could answer, “I am wholeheartedly dedicated to my career“, perhaps adding, “I have no plans regarding children.”  (You needn’t fear you’ve pledged eternal childlessness.  You have every right to change your plans later.  Get the job first and then enjoy all your options.)&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Most importantly, remember that illegal questions arise from fear that you won’t perform well.  The best answer of all is to get the job and perform brilliantly. All concerns and fears will then varnish, replaced by respect and appreciation for your work.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364769&quot;&gt;Question 56         &lt;/a&gt;The “Secret” Illegal Question&lt;br /&gt;TRAPS:  Much more frequent than the Illegal question (see Question 55) is the secret illegal question.  It’s secret because it’s asked only in the interviewer’s mind.  Since it’s not even expressed to you, you have no way to respond to it, and it can there be most damaging.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  You’re physically challenged, or a single mother returning to your professional career, or over 50, or a member of an ethnic minority, or fit any of a dozen other categories that do not strictly conform to the majority in a given company.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Your interviewer wonders, “Is this person really able to handle the job?”…”Is he or she a ‘good fit’ at a place like ours?”…”Will the chemistry ever be right with someone like this?”  But the interviewer never raises such questions because they’re illegal.  So what can you do?&lt;br /&gt;BEST ANSWER:  Remember that just because the interviewer doesn’t ask an illegal question doesn’t mean he doesn’t have it.  More than likely, he is going to come up with his own answer.  So you might as well help him out.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;How?  Well, you obviously can’t respond to an illegal question if he hasn’t even asked.  This may well offend him.  And there’s always the chance he wasn’t even concerned about the issue until you brought it up, and only then begins to wonder.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;So you can’t address “secret” illegal questions head-on.  But what you can do is make sure there’s enough counterbalancing information to more than reassure him that there’s no problem in the area he may be doubtful about.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;For example, let’s say you’re a sales rep who had polio as a child and you need a cane to walk.  You know your condition has never impeded your performance, yet you’re concerned that your interviewer may secretly be wondering about your stamina or ability to travel.  Well, make sure that you hit these abilities very hard, leaving no doubt about your capacity to handle them well.&lt;br /&gt;So, too, if you’re in any different from what passes for “normal”.  Make sure, without in any way seeming defensive about yourself that you mention strengths, accomplishments, preferences and affiliations that strongly counterbalance any unspoken concern your interviewer may have.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364770&quot;&gt;Question 57         &lt;/a&gt;What was the toughest part of your last job?&lt;br /&gt;TRAPS: This is slightly different from the question raised earlier, “What’s the most difficult part of being a (job title…)” because this asks what you personally have found most difficult in your last position.  This question is more difficult to redefine into something positive.  Your interviewer will assume that whatever you found toughest may give you a problem in your new position.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  State that there was nothing in your prior position that you found overly difficult, and let your answer go at that.  If pressed to expand your answer, you could describe the aspects of the position you enjoyed more than others, making sure that you express maximum enjoyment for those tasks most important to the open position, and you enjoyed least those tasks that are unimportant to the position at hand.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364771&quot;&gt;Question 58         &lt;/a&gt;How do you define success…and how do you measure up to your own definition?&lt;br /&gt;TRAPS:  Seems like an obvious enough question.  Yet many executives, unprepared for it, fumble the ball.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Give a well-accepted definition of success that leads right into your own stellar collection of achievements.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Example:  “The best definition I’ve come across is that success is the progressive realization of a worthy goal.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“As to how I would measure up to that definition, I would consider myself both successful and fortunate…”(Then summarize your career goals and how your achievements have indeed represented a progressive path toward realization of your goals.)&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364772&quot;&gt;Question 59         &lt;/a&gt;“The Opinion Question” – What do you think about …Abortion…The President…The Death Penalty…(or any other controversial subject)?&lt;br /&gt;TRAPS:  Obviously, these and other “opinion” questions should never be asked.  Sometimes they come up over a combination dinner/interview when the interviewer has had a drink or two, is feeling relaxed, and is spouting off about something that bugged him in today’s news.  If you give your opinion and it’s the opposite of his, you won’t change his opinions, but you could easily lose the job offer.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  In all of these instances, just remember the tale about student and the wise old rabbi.  The scene is a seminary, where an overly serious student is pressing the rabbi to answer the ultimate questions of suffering, life and death.  But no matter how hard he presses, the wise old rabbi will only answer each difficult question with a question of his own.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In exasperation, the seminary student demands, “Why, rabbi, do you always answer a question with another question?”  To which the rabbi responds, “And why not?”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If you are ever uncomfortable with any question, asking a question in return is the greatest escape hatch ever invented.  It throws the onus back on the other person, sidetracks the discussion from going into an area of risk to you, and gives you time to think of your answer or, even better, your next question!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In response to any of the “opinion” questions cited above, merely responding, “Why do you ask?” will usually be enough to dissipate any pressure to give your opinion.  But if your interviewer again presses you for an opinion, you can ask another question.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Or you could assert a generality that almost everyone would agree with.  For example, if your interviewer is complaining about politicians then suddenly turns to you and asks if you’re a Republican or Democrat, you could respond by saying, “Actually, I’m finding it hard to find any politicians I like these days.”&lt;br /&gt;(Of course, your best question of all may be whether you want to work for someone opinionated.)&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364773&quot;&gt;Question 60         &lt;/a&gt;If you won $10 million lottery, would you still work?&lt;/p&gt;&lt;p&gt;TRAPS:  Your totally honest response might be, “Hell, no, are you serious?”  That might be so, but any answer which shows you as fleeing work if given the chance could make you seem lazy.  On the other hand, if you answer, “Oh, I’d want to keep doing exactly what I am doing, only doing it for your firm,” you could easily inspire your interviewer to silently mutter to himself, “Yeah, sure.  Gimme a break.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  This type of question is aimed at getting at your bedrock attitude about work and how you feel about what you do.  Your best answer will focus on your positive feelings.&lt;br /&gt;Example:  “After I floated down from cloud nine, I think I would still hold my basic belief that achievement and purposeful work are essential to a happy, productive life.  After all, if money alone bought happiness, then all rich people would be all happy, and that’s not true.&lt;br /&gt;“I love the work I do, and I think I’d always want to be involved in my career in some fashion.  Winning the lottery would make it more fun because it would mean having more flexibility, more options...who knows?”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“Of course, since I can’t count on winning, I’d just as soon create my own destiny by sticking with what’s worked for me, meaning good old reliable hard work and a desire to achieve.  I think those qualities have built many more fortunes that all the lotteries put together.”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364774&quot;&gt;Question 61         &lt;/a&gt;Looking back on your last position, have you done your best work?&lt;br /&gt;TRAPS:  Tricky question.  Answer “absolutely” and it can seem like your best work is behind you.  Answer, “no, my best work is ahead of me,” and it can seem as if you didn’t give it your all.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  To cover both possible paths this question can take, your answer should state that you always try to do your best, and the best of your career is right now.  Like an athlete at the top of his game, you are just hitting your career stride thanks to several factors.  Then, recap those factors, highlighting your strongest qualifications.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364775&quot;&gt;Question 62         &lt;/a&gt;Why should I hire you from the outside when I could promote someone from within?&lt;br /&gt;TRAPS:  This question isn’t as aggressive as it sounds.  It represents the interviewer’s own dilemma over this common problem.  He’s probably leaning toward you already and for reassurance, wants to hear what you have to say on the matter.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Help him see the qualifications that only you can offer.&lt;br /&gt;Example:  “In general, I think it’s a good policy to hire from within – to look outside probably means you’re not completely comfortable choosing someone from inside.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;“Naturally, you want this department to be as strong as it possibly can be, so you want the strongest candidate.  I feel that I can fill that bill because…(then recap your strongest qualifications that match up with his greatest needs).”&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364776&quot;&gt;Question 63         &lt;/a&gt;Tell me something negative you’ve heard about our company…&lt;br /&gt;TRAPS:  This is a common fishing expedition to see what the industry grapevine may be saying about the company.  But it’s also a trap because as an outsider, you never want to be the bearer of unflattering news or gossip about the firm.  It can only hurt your chances and sidetrack the interviewer from getting sold on you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Just remember the rule – never be negative – and you’ll handle this one just fine.&lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;a name=&quot;_Toc33364777&quot;&gt;Question 64         &lt;/a&gt;On a scale of one to ten, rate me as an interviewer.&lt;br /&gt;TRAPS:  Give a perfect “10,” and you’ll seem too easy to please.  Give anything less than a perfect 10, and he could press you as to where you’re being critical, and that road leads downhill for you.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;BEST ANSWER:  Once again, never be negative.  The interviewer will only resent criticism coming from you.  This is the time to show your positivism.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;However, don’t give a numerical rating. Simply praise whatever interview style he’s been using.&lt;br /&gt;If he’s been tough, say “You have been thorough and tough-minded, the very qualities needed to conduct a good interview.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;If he’s been methodical, say, “You have been very methodical and analytical, and I’m sure that approach results in excellent hires for your firm.”&lt;/p&gt;&lt;p&gt;&lt;br /&gt;In other words, pay him a sincere compliment that he can believe because it’s anchored in the behavior you’ve just seen.&lt;/p&gt;</description><link>http://gurukanagaraj.blogspot.com/2008/06/hrinterviewquestions.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-6217084901349644109.post-1174260534444003245</guid><pubDate>Thu, 26 Jun 2008 18:15:00 +0000</pubDate><atom:updated>2014-01-17T11:00:15.939-08:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Interview</category><title>php questions</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
1. What Is PHP ?
&lt;br /&gt;
&lt;br /&gt;
2. How can I disable the output of error messages inside the HTML page?
&lt;br /&gt;
&lt;br /&gt;
3. Can I return other file formats (like Word, Excel, etc) using PHP?
&lt;br /&gt;
&lt;br /&gt;
4. Is there any way to force PHP to do garbage collection before the end of the request?
&lt;br /&gt;
&lt;br /&gt;
5. Why does require($file_name) in a loop just include the first file repeatedly?
&lt;br /&gt;
&lt;br /&gt;
6. Can you include and call C libraries in PHP scripts? How?
&lt;br /&gt;
&lt;br /&gt;
7. What&#39;s the best way to start writing a PHP program?
&lt;br /&gt;
&lt;br /&gt;
8. Passing variables with REQUIRE function (part II)
&lt;br /&gt;
&lt;br /&gt;
9. I use a /cgi-bin/ad.pl for displaying rotating banners at the top of my html files. How can I insert the output of this cgi in an &quot;included&quot; file ?
&lt;br /&gt;
&lt;br /&gt;
10. please tell me how to let a html document read content from a .txt file, spit this out in a table, and how to update the specific file with a form
&lt;br /&gt;
&lt;br /&gt;
11. How can I add authentication to my site with PHP? I have authentication working only with one page.
&lt;br /&gt;
&lt;br /&gt;
12. Where can I get documentation for the Zend API?
&lt;br /&gt;
&lt;br /&gt;
13. Does Php have anything similiar to Perl&#39;s $string = &amp;lt;&lt;end_of_data ...=&quot;&quot; br=&quot;&quot; end_of_data=&quot;&quot; lines=&quot;&quot; multiple=&quot;&quot; over=&quot;&quot; some=&quot;&quot; text=&quot;&quot;&gt;
&lt;br /&gt;14. I would like to create a user authentication system, but when they log in, how would i make it personalized.
&lt;br /&gt;
&lt;br /&gt;15. Is it possible to do a multisite hit counter that runs on a PHP enabled server but is accessed by non PHP servers?
&lt;br /&gt;
&lt;br /&gt;16. To offer users a direct download of a file that is a valid MIME type
&lt;br /&gt;
&lt;br /&gt;17. How can I display a number with thousand separator querying an SQLServer 7 table (number_format does not work with PHP 401 - error: unknown function)
&lt;br /&gt;
&lt;br /&gt;18. environmental variables such as query string are not passed to php code i.e. INCLUDE file=&quot;showacct.php&quot;
&lt;br /&gt;
&lt;br /&gt;19. Lost Last-Modified when set apache to use PHP4 module for all .htm/.html files. Can one have PHP4 parse .htm/.html and keep the Last-Modified header?
&lt;br /&gt;
&lt;br /&gt;20. When i include a txt file the html page ignores the end of lines. And i get one long line with text. I would have multiple lines with hard breaks.
&lt;br /&gt;
&lt;br /&gt;21. Why does PHP4 (windows) tell me that my module doesn´t exist when it does? I´m talking about php_mssql70.dll.
&lt;br /&gt;
&lt;br /&gt;22. In windows PHP, when I load php_mssql70.dll as an extension, PHP stops working. why?
&lt;br /&gt;
&lt;br /&gt;23. Can a local PHP page be parsed using a remote installation of PHP?
&lt;br /&gt;
&lt;br /&gt;24. Looking to create resizable tables based on viewer screen size and amount of text to be displayed. Used on php.net, but can&#39;t find code to do this - ?
&lt;br /&gt;
&lt;br /&gt;25. Why do I receive a message &quot;cant fork ...&quot; if I try to execute an external program (PassThru, System, Exec) - running PHP4, WinNT SP 5, PWS.
&lt;br /&gt;
&lt;br /&gt;26. using a LAMP setup with a Flash interface. How do I set up a chat using PHP that updates all the browsers viewing the chat page?
&lt;br /&gt;
&lt;br /&gt;27. How can I get in PHP the value of variable coming from a WML &amp;lt; input &amp;gt; or &amp;lt; select &amp;gt;?
&lt;br /&gt;
&lt;br /&gt;28. I wrote a script, but when searched brings only one set of results. How do I make it so if there is more than one result, it will display them all.
&lt;br /&gt;
&lt;br /&gt;29. Is it worth creating files, like a log, for each new member or simply pull from a database.
&lt;br /&gt;
&lt;br /&gt;30. How can I call a command line executable from within PHP?
&lt;br /&gt;
&lt;br /&gt;31. Where can I get a documentation for creating my own dll for php3 with VC 6.0?
&lt;br /&gt;
&lt;br /&gt;32. running php4 on a Data General Unix platform, and getting the same error, any help for this prob
&lt;br /&gt;
&lt;br /&gt;33. Unable to execute linux command=&quot;pppd call isp&amp;amp;&quot;, using exec() and system(), consider that httpd.conf configured as nobody.
&lt;br /&gt;
&lt;br /&gt;34. How to erase $REMOTE_USER in the browser created with the htaccess authentication scheme
&lt;br /&gt;
&lt;br /&gt;35. What does PHP stand for?
&lt;br /&gt;
&lt;br /&gt;36. How do you convert this perl code unpack(&#39;s&#39;, pack(&#39;s&#39;, hex($x))) to PHP
&lt;br /&gt;
&lt;br /&gt;37. Is there any possible method of creating a dialogue box as a help option similar to the one in Microsoft Word Help dialogue boxes with keyword search
&lt;br /&gt;
&lt;br /&gt;38. about &quot;php3?id=xxxxx&quot; OUTPUT RESULT TO HTML ...
&lt;br /&gt;
&lt;br /&gt;39. in Non_Server Client Site to get a variable from Server Client Site e.g. HTML get a result from PHP
&lt;br /&gt;
&lt;br /&gt;40. How do I handle frames and window openings in PHP, for instance if I have a frames page and I want to eliminate the frames, how do I do this using PHP ?
&lt;br /&gt;
&lt;br /&gt;41. How do I call and pass variables to a compiled C function using PHP?
&lt;br /&gt;
&lt;br /&gt;42. Why do multiple echo and printf functions, used to display a table, display newline charachers before the table in Netscape but not in IE?
&lt;br /&gt;
&lt;br /&gt;43. How do I stop a previous url?mode=del&amp;amp;cust=name being repeated when the user hits their back button?
&lt;br /&gt;
&lt;br /&gt;44. I know this next/previous script (http://px.sklar.com/code-pretty.html?code_id=77) but, is not there any easyer way/script?
&lt;br /&gt;
&lt;br /&gt;45. Is it possible to make a yahoo-like site without MySQL or any other db, but plain text? Something like Links 2.0 in Perl.
&lt;br /&gt;
&lt;br /&gt;46. How to extract data from database and display it in the list box?
&lt;br /&gt;
&lt;br /&gt;47. Is there a mean to get the entries of an EXCEL sheet with PHP (to include this in a database, by Example
&lt;br /&gt;
&lt;br /&gt;48. Does PHP support document objects (similar to javascript)
&lt;br /&gt;
&lt;br /&gt;49. Is it possible to have MySQL and Php run with one provider and the &quot;database driven website&quot; with the other ? Say with the help of only SSI / CGI?
&lt;br /&gt;
&lt;br /&gt;50. Hello, does anyone know where we can find a course on php for beginners that can be taken via the internet. We are just getting into php from scratch.
&lt;br /&gt;
&lt;br /&gt;51. How i can set a time expire page in PHP.
&lt;br /&gt;
&lt;br /&gt;52. is it possible to search newsgroups with php
&lt;br /&gt;
&lt;br /&gt;53. Does anyone else have problems using the \n newline escape character? why is not it rendering for me?
&lt;br /&gt;
&lt;br /&gt;54. What is the scope of a global (page, session or otherwise).
&lt;br /&gt;
&lt;br /&gt;55. How do I present a form with two buttons - each doing a submit for different things (ie - log in or change password). Can I call PHP from an onclick.
&lt;br /&gt;
&lt;br /&gt;56. How do I insert a user loaded &amp;lt; input type=file&amp;gt; image into a database table (&amp;amp;&amp;amp; checking for size constraints).
&lt;br /&gt;
&lt;br /&gt;57. Why wont PHP 3 excute shell commands??? I have tried $string = system(&quot;/bin/tar -cf /home/www/backups/backup.tar /home/www/functions&quot;);
&lt;br /&gt;
&lt;br /&gt;58. How can I populate a pull down with with a few data fields from one table and then upon selection then intire row fills out the apropiate form fields?
&lt;br /&gt;
&lt;br /&gt;59. How do I insert a user loaded image &amp;lt; input type=file&amp;gt; into a database table (MYSql or M/S SQL)
&lt;br /&gt;
&lt;br /&gt;60. What is the best policy? Connect once, store the query results in several arrays to use later or p_connect and query at the moment I need the results?
&lt;br /&gt;
&lt;br /&gt;61. Is there some PHP code that takes the output of one file, and placing it in another?
&lt;br /&gt;
&lt;br /&gt;62. When i press the submit button,the selected name in the list should be displayed in the new popup window for further processing.How to do this?. pl
&lt;br /&gt;
&lt;br /&gt;63. Do member functions within a class incur any memory penalty when an object of that class is instantiated.
&lt;br /&gt;
&lt;br /&gt;64. Can someone show me how to extract information from another site and put it on my webpage... Thanks
&lt;br /&gt;
&lt;br /&gt;65. What does parsing means in PHP?
&lt;br /&gt;
&lt;br /&gt;66. How can I use plain txt files instead of a database for a backend of a site, ie managing news posts, uploading files, message boards etc...
&lt;br /&gt;
&lt;br /&gt;67. How can you include the same information you would normally call via SSI in a .shtml file in PHP?
&lt;br /&gt;
&lt;br /&gt;68. how do i include a remote file using php
&lt;br /&gt;
&lt;br /&gt;69. Can someone explain me how PHP interacts with Java ?
&lt;br /&gt;
&lt;br /&gt;70. How to make a GoBackButton with a picture?
&lt;br /&gt;
&lt;br /&gt;71. how can I take a list and make each row a value in an array?
&lt;br /&gt;
&lt;br /&gt;72. can i simulate php on windows(not a server)?
&lt;br /&gt;
&lt;br /&gt;73. I am using PHP4. I used to draw gifs in PHP3, but now I get an error (i think because PHP only supports PNGs). What should I do?
&lt;br /&gt;
&lt;br /&gt;74. How can I prevent re-&quot;post&quot;-ing data when a user returns to a posted page using the back button?
&lt;br /&gt;
&lt;br /&gt;75. Is their a way, in PHP, to strip-out the content of a web page of bad JavaScript? ex. Javascript that open a new window when you juste closed one.
&lt;br /&gt;
&lt;br /&gt;76. How can I display the output of passthru or system with newline chars? i.e. passthru(&quot;ps ax&quot;)
&lt;br /&gt;
&lt;br /&gt;77. I try to display a word document which is stored in a blob field in a mysql db-I get the document always with binary code pieces-how can I avoid this?
&lt;br /&gt;
&lt;br /&gt;78. Fatal error: Call to unsupported or undefined function page_open() ? How do I fix this please...?
&lt;br /&gt;
&lt;br /&gt;79. Is it possible to access the Active Directory of a Windows 2000 Server with PHP ? Maybe via LDAP ?
&lt;br /&gt;
&lt;br /&gt;80. I was sent a php file and am unable to view it. What software will run it?
&lt;br /&gt;
&lt;br /&gt;81. How could one php-script call some other php-script and how could give the first one to the second one the values of the variables?
&lt;br /&gt;
&lt;br /&gt;82. I want some while cycle in one script to call (x-times) the other script and give him the values of variables (which are each time other).
&lt;br /&gt;
&lt;br /&gt;83. Is possible to generate, send &amp;amp; receive back ICMP messages directly in PHP instead of external execution of ping?
&lt;br /&gt;
&lt;br /&gt;84. I have images on my site that when a thumnail is clicked the larger image appears In a pop-up. Is there a better way to do this in PHP instead of html
&lt;br /&gt;
&lt;br /&gt;85. I have PHP under Windows and Apache . How can I send some file to STDIN of PHP script?
&lt;br /&gt;
&lt;br /&gt;86. How to insert in a javascript array the elements of a php array ?
&lt;br /&gt;
&lt;br /&gt;87. I am using PHP4 and a MS Access DB for my website. My provider tells me that the IIS-Server (NT) does not support PHP. Is that correct?
&lt;br /&gt;
&lt;br /&gt;88. How to run execute files on client machines?
&lt;br /&gt;
&lt;br /&gt;89. What is the error access violation? Why does it happen?
&lt;br /&gt;
&lt;br /&gt;90. How can I pass information from a membership database (text file) into the Chat Client. Using PHP?
&lt;br /&gt;
&lt;br /&gt;91. How can I save php output to the browser and a file?
&lt;br /&gt;
&lt;br /&gt;92. Can PHP be malicious like Javascript? As a surfer do I have any security concerns? I can disable Java, can I disable PHP?
&lt;br /&gt;
&lt;br /&gt;93. I need to know if there is a program that you can write code in html and convert it to php. I run windows 2000
&lt;br /&gt;
&lt;br /&gt;94. How can i add the First,Previous,Next, Last,Update,Delete,Modify buttons in the same form?(I am using MYSQL as a backend in my server)
&lt;br /&gt;
&lt;br /&gt;95. Is there a limit to the size of a PHP script plus included() and required() scripts that it loads? How can I change this limit?
&lt;br /&gt;
&lt;br /&gt;96. Why am I getting a &quot;/&quot; added at the end of a PHP generated HREF link?
&lt;br /&gt;
&lt;br /&gt;97. How I get XSLT support with PHP on Windows platform?
&lt;br /&gt;
&lt;br /&gt;98. I am new to PHP, and would like to know if there is a code snippet for emailing a lost password to a customer. Thank you!
&lt;br /&gt;
&lt;br /&gt;99. How can I write a web page (program) to check that does webserver support PHP, ASP and PERL ?
&lt;br /&gt;
&lt;br /&gt;100. Can the PHP include command be used with a virtual path?
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;101. How do I write a php script within a php script to a file without escaping everything?
&lt;br /&gt;
&lt;br /&gt;102. How can I create a dropdown for date field showing past 3 months, present month and the 12 months in the future?
&lt;br /&gt;
&lt;br /&gt;103. Can I read NT registry info from PHP? How?
&lt;br /&gt;
&lt;br /&gt;104. How and when to use $php_self and $query_string????
&lt;br /&gt;
&lt;br /&gt;105. Can i define $QUERY_STRING? Meaning when the query string is menu/news, it will display just news.
&lt;br /&gt;
&lt;br /&gt;106. How can I list files in a specific directory and hyperlink to them?
&lt;br /&gt;
&lt;br /&gt;107. Warning: Nesting level too deep - recursive dependency? in Unknown on line 0. What does it mean?
&lt;br /&gt;
&lt;br /&gt;108. If I have developed a dll using Visual Basic which contains the Application logic, how can I create objects of the classes in this dll in PHP?
&lt;br /&gt;
&lt;br /&gt;109. How to handle special char&#39;s like É , Ü . I am passing company name in a system command but when there is a special char like Ü then command fails.
&lt;br /&gt;
&lt;br /&gt;110. How can I open with fopen() a file in an machine of local networks. Ex.: fopen(\machine\sharing name,...,...)?
&lt;br /&gt;
&lt;br /&gt;111. How do i save php output sequentially by date so that i may move forwards and backwards in order by date of creation &quot;next/previous etc&quot;
&lt;br /&gt;
&lt;br /&gt;112. Is it possible to make PHP output a gif/png (eg a photo) as well as the desired data output?
&lt;br /&gt;
&lt;br /&gt;113. How to post binary data in write() with PHP socket?
&lt;br /&gt;
&lt;br /&gt;114. How can I use PHP to create XML documents with data from a database e.g Sybase, Mysql. Does it exsist any tutorials on this ? Thanks.
&lt;br /&gt;
&lt;br /&gt;115. Hello, I have an error: unable to load dinamic library &#39;c:\php/php_oci8.dll no se puede encontrar el modulo especificado. I&#39;m beginning with PHP.
&lt;br /&gt;
&lt;br /&gt;116. How can I run SSI commands like #INCLUDE etc. in my PHP pages?
&lt;br /&gt;
&lt;br /&gt;117. How to call from within a PHP extension other extension&#39;s functions ?
&lt;br /&gt;
&lt;br /&gt;118. how can you insert a mysql field into a link tag using php?
&lt;br /&gt;
&lt;br /&gt;119. how can i pass 2 variables from php and include it in a hyperlink? eg: &lt;a href=&quot;https://www.blogger.com/($variable1)&quot;&gt;$variable2&lt;/a&gt;
&lt;br /&gt;
&lt;br /&gt;120. what the difference behind the implement mechanism between the common CGI and php_based application?
&lt;br /&gt;
&lt;br /&gt;121. Diffrence in outcome of formula 1.08^12 PHP=13 Visual Basic=2.51817011681898
&lt;br /&gt;
&lt;br /&gt;122. How to covert web input (PHP) to XML format?
&lt;br /&gt;
&lt;br /&gt;123. Switching an input from web (built using PHP)to XML format
&lt;br /&gt;
&lt;br /&gt;124. Is it possible to run a php script from an .swf and then return a few variables back to the .swf.
&lt;br /&gt;
&lt;br /&gt;125. Can PHP send an update signal (popup screen) to other users when a user makes a request on a game?
&lt;br /&gt;
&lt;br /&gt;126. Can anyone offer advice on making a web poll that has a different no. of answers for each question?
&lt;br /&gt;
&lt;br /&gt;127. What is PHTML ? Is it the same thing as PHP ?
&lt;br /&gt;
&lt;br /&gt;128. How i can pass variables to a cgi usin passthru?, i need an example
&lt;br /&gt;
&lt;br /&gt;129. How do I link in an external file containing common php functions for calling from within the page?
&lt;br /&gt;
&lt;br /&gt;130. How can i cut tags from getting into a database
&lt;br /&gt;
&lt;br /&gt;131. I wish to call a /usr/local/bin/pgp program and then put the output into a variable, which way best?
&lt;br /&gt;
&lt;br /&gt;132. A php game. How to broadcast a message to other players when one player make his selection?
&lt;br /&gt;
&lt;br /&gt;133. how can i make an html form that will search a mysql database?
&lt;br /&gt;
&lt;br /&gt;134. how to redirect from php page to another php page? 2. how to refresh a page?
&lt;br /&gt;
&lt;br /&gt;135. i want to make a place where users must supply their username and password, i havent found anything.
&lt;br /&gt;
&lt;br /&gt;136. using the header function to redirect a script to a PDF file I am getting junk characters?
&lt;br /&gt;
&lt;br /&gt;137. How can I generate redirect to other html page from PHP page when the PHP server is down?
&lt;br /&gt;
&lt;br /&gt;138. I tried to load Blob Image from MSSQL using php but the 25% of the image is displayed only?
&lt;br /&gt;
&lt;br /&gt;139. How do I include a .jpg (from outside the web srvr docs dir) in a page with other html content?
&lt;br /&gt;
&lt;br /&gt;140. How do you make a page expire after it has been idle for a period of time?
&lt;br /&gt;
&lt;br /&gt;141. How do I make make a session counter without using a database, aka using application level variable?
&lt;br /&gt;
&lt;br /&gt;142. How can i save an image from a remote web server to my web server?
&lt;br /&gt;
&lt;br /&gt;143. Is there a place to post *really* nice ASP apps in hopes that people convert them to PHP?
&lt;br /&gt;
&lt;br /&gt;144. Looking for ideas on how to include file &quot;color.txt&quot; but only if it contains the word &quot;green&quot;.
&lt;br /&gt;
&lt;br /&gt;145. How do I get a page to automatically print its contents when it loads?
&lt;br /&gt;
&lt;br /&gt;146. how do you &quot;protect&quot; a page using .htaccess file
&lt;br /&gt;
&lt;br /&gt;147. how can a session be destroyed when user closed window without logging out?
&lt;br /&gt;
&lt;br /&gt;148. Question about settings of using PHP under Windows platform???
&lt;br /&gt;
&lt;br /&gt;149. How to do attachment if I want to use a file as background?
&lt;br /&gt;
&lt;br /&gt;150. How to pass a string that contain character &quot;&amp;amp;&quot; between words that display on the url
&lt;br /&gt;
&lt;br /&gt;151. How can i sort asc, thereafter desc by click on the same button (like in excel)
&lt;br /&gt;
&lt;br /&gt;152. how can i convert a php file to exe format
&lt;br /&gt;
&lt;br /&gt;153. How can I search a different site &amp;amp; show the results in my site,with out giving links to the orginal
&lt;br /&gt;
&lt;br /&gt;154. Can you use PHP to acces databases over the internet?
&lt;br /&gt;
&lt;br /&gt;155. I can only get the last record from a database to be displayed, how do I get all records to display?
&lt;br /&gt;
&lt;br /&gt;156. Is there any way that i can show the content of a mysql DB into a excel file using php?
&lt;br /&gt;
&lt;br /&gt;157. How to call a remote procedure in PHP?(like RPC)
&lt;br /&gt;
&lt;br /&gt;158. How can I generate graphs in PHP?
&lt;br /&gt;
&lt;br /&gt;159. I&#39;m writing a news posting script, and my sessions aren&#39;t working! Somone explain how to use them!!!
&lt;br /&gt;
&lt;br /&gt;160. I need to create a customer id for a mysql database from the info contained in the html form.
&lt;br /&gt;
&lt;br /&gt;161. How can I insert a snipet of code in my table and then echo it on a page without it getting parsed,
&lt;br /&gt;
&lt;br /&gt;162. Can anybody suggest a logic to parse an html page to get the news titles using PHP script?
&lt;br /&gt;
&lt;br /&gt;163. I´m new to php and would like to know if theres a script that automatic updates and shows cpu uptime
&lt;br /&gt;
&lt;br /&gt;164. How can I write visitor&#39;s screen resolution to a log file (text file) with PHP?
&lt;br /&gt;
&lt;br /&gt;165. How do I forward a GET/POST request to another file without notifying the users browser to redirect?
&lt;br /&gt;
&lt;br /&gt;166. How do I read data from a windows .txt file and display it on a web-page ?
&lt;br /&gt;
&lt;br /&gt;167. Can you set up MVC using PHP like in Servlets, JSPs and JavaBeans?
&lt;br /&gt;
&lt;br /&gt;168. How do you redirect from one PHP file to another without notifying the user&#39;s browser to redirect?
&lt;br /&gt;
&lt;br /&gt;169. how can I redirect a user with wildcards like 213.* or hostname like *.isp.net
&lt;br /&gt;
&lt;br /&gt;170. how can i archive a set of remote files, about 10 on my own server?
&lt;br /&gt;
&lt;br /&gt;171. How can I query MX Record from DNS Server for particular domain ?
&lt;br /&gt;
&lt;br /&gt;172. How do u explode a string of content and then call each individual bit by it&#39;s own, new, variable???
&lt;br /&gt;
&lt;br /&gt;173. How can I use apache to set PHP Environment variables?
&lt;br /&gt;
&lt;br /&gt;174. How can I use apache to set PHP Environment variables?
&lt;br /&gt;
&lt;br /&gt;175. I&#39;m running PHP&#39;s on a IIS Server... The server is limiting the number of sessions
&lt;br /&gt;
&lt;br /&gt;176. How do I set a text field so that it outputs the inserted text to a PHP variable?
&lt;br /&gt;
&lt;br /&gt;177. How can I check remote file dates, to later use to print how old a file is?
&lt;br /&gt;
&lt;br /&gt;178. Why won&#39;t my php script see the variables passed to it from the previous page in the url? ie: http://yoururl?arg1=value
&lt;br /&gt;
&lt;br /&gt;179. how do i make a var set in the query string available to another file ?? eg to a css
&lt;br /&gt;
&lt;br /&gt;180. How can i execute and php with javascript and how should be the php code?
&lt;br /&gt;
&lt;br /&gt;181. is it possible to launch an executable(C++) from excel on remote cluster via PHP?
&lt;br /&gt;
&lt;br /&gt;182. How can I get user via PHP after .htaccess login?
&lt;br /&gt;
&lt;br /&gt;183. How can I get users via PHP after .htaccess login?
&lt;br /&gt;
&lt;br /&gt;184. I want to store the contents of a directory(.jpg files) in an array then echo the values. HELP!
&lt;br /&gt;
&lt;br /&gt;185. How can I fill in fields in WinWord from PHP variables
&lt;br /&gt;
&lt;br /&gt;186. Without using &lt;/end_of_data&gt;&lt;br /&gt;
&lt;pre&gt;, how do I get textarea to save format of entered text into MySQL field?



187. How do I include pre-formatted text into a PHP page?



188. How do I get (ctime &amp;amp; mtime) on a remote file (http) without downloading it. &quot;fstat&quot;, didn&#39;t help



189. How do I populate an array from a SELECT string?



190. how to rctify this warning Cannot send session cache limiter - headers already sent



191. how do I refresh and redirect a page using PHP?



192. Is it possible to multiple web application platforms on the same server? ex: PHP and JSP on Apache



193. How do I get the Windows NT $DOCUMENT_ROOT? The variable is blank.



194. How can I search in Excel file for a specific keyword and then print in a HTML format ?



195. How to make included htm use the correct path for showing images?



196. In what way can I use &quot;namespaces as in C++&quot; in PHP?



197. I have an exe file on a server, can I launch it with PHP with command line parameters?If not, how?



198. How do you refresh a PHP page into itself?



199. How to export table data from browser to local disk in .rtf/.txt format?



200. How can be avoided the popup dialog with htaccess passing the login and password with PHP?



201. What is the PHP equivelent of ColdFusion&#39;s &lt;cfhttp&gt; tag? (Both GET and POST operations)



202. What I do wrong to connect to a mysql DB-&amp;gt; Call to unsupported or undefined function mysql_connect()



203. When I create a file/dir the owner/group is &quot;www&quot; is there sonthing I can put in the .htaccess file



204. I did exactly from the book. It comes up as &quot; Undefined variable.&quot; What&#39;s going on here?



205. When i click on a link, it believes that the address is e.g &quot;http://bob/php4/php.exe?mode=admin&quot;



206. will testing with dreamweaver work or do I have to upload the page to the server?



207. What achine is local when using ftp-commands in PHP on a web server?



208. Is there a program to convert PHP script to another language?



209. How do I acsess NetBIOS with sockets (PHP server is running on Windows)



210. how to input data from txt file into table where columns are separated with pipe ?



211. How and you split string into different arrays and save what they were split on?



212. How do I retrieve a single variable value from another file?



213. How to automatic download/upload a file from client machine to server with using FTP function



214. Is there a way to use php to embed html in e-mails? Can you do this without php



215. I need copy from urls inserted on my site using php - sites link will be present



216. Warning: Cannot send session cookie - headers already sent by (output started at /home/fishing/publi



217. &quot;Parse error: parse error in /var/www/html/results.php on line 20&quot; -- Why?



218. Does anyone know if there is any way to pull info from an &quot;avery&quot; scale connected to the serial port



219. How can I get the remote PC&#39;s MAC Address?



220. i am calling an external C file but the output doesn&#39;t appear. Sometimes it does but it is incorrect



221. How to Make an RTF Document with PHP



222. How do we execute .cpp or .c file, ( stored as BLOB in db) upon reading them



223. how do I call class method: $func=&quot;SomeClass::someMethod&quot;; $func()



224. How can i catch into a variable an error message of a server? for example 404 File not found



225. How can I do to not use session_start() in every page where I redirect a main page with &quot;redirect&quot;?



226. I can&#39;t display display images retrieving from a database. Can somebody help me?



227. Can I get path-informations of a frame (getcwd())....?



228. Displaying Excel files in PHP



229. How can I avoid getting a error when I click a link in a page while it is loading a big record list?



230. How do u pass a variable (multiple select) from a pop up window to the main window?



231. *how do u you pass a variable(multiple select) from a pop up window to the main window?



232. I have the error 403 when I try to run a PHP script. How can I fix the problem??



233. How can I pass an array of randomized elements through back and next button without repeatation?



234. is there a function to echo unique variables from a db when there are multiple similar entries?



235. is there a function to echo unique variables from a db when there are multiple similar entries?



236. solved or not?? zend entry point and php_sablot.dll



237. I have a &#39;recent news&#39; page that I would like to be able to update via the browser. Any ideas?



238. Is there a way to email the actual HTML form (same format) after a visitor has completed it?



239. How do I retrieve pasword protected area with PHP?



240. How can I pass a variable with a button(in objective question--A,B,C,D)?



241. Using PHP, how do I send a http POST without using a form?



242. How can I set a time limit for a form made by PHP (i.e.the value will auto transfer after a time)



243. In my search engine result outputs, how can I make it to show page title?



244. How do I lock and unlock tables using PHP and Access via ODBC?



245. Any hints for implementing forms in a wizard style, where answers influence subsequent questions?



246. How can windows (XP Pro) be shut down/ restarted via PHP?



247. Can I fopen a remote url that requires form variables to be POSTed?



248. When I start PHP 4.1.1 it return error &quot;the PHP4TS.DLL file is linked to mising export OLE32.DLL...&quot;



249. ODBC32 not found (win95 &amp;amp; php 4.1.1) what shall I do?



250. if i want to use a c function in php programmar ,what should i do ?



251. What is the essence of PHP encryption(using crypt(),mcrypt(),etc)if data on transit isn&#39;t safe?



252. How do you run a script as a certain user such as root?



253. Why cant I get my session..the session is there but the browser dont collect it!



254. How do I display an error for a signup form in the same page instead of having user to click return?



255. Get 404 error when trying to use .php file in browser



256. How can I add text (const or var) in a textarea by click in a image or Href ?.



257. How do I add text in a textarea by &quot;clicking&quot; an image or HREF?



258. Hi, How do I go about saving username and password values in the client...



259. How can I extract metatag keywords from pages serving longtext mysql column info?



260. Need a way to call a function only when the form is closed. Not register_shutdown_function.



261. Why is my webbrowser opening my php file instead of running it?



262. How do you use spaces in Question-Mark queries with non-standard browsers like AIM Profiles?



263. Before a form is closed down (close icon &#39;X&#39;) how can I send a message to another program



264. How can I run two PHP4 versions (ie 4.0.6 and 4.1.2) with two PHP-ini on IIS without recompiling?



265. Is there a way to determine the first time a page loads?



266. I want to to auth users, then show the rest of the page. What is the best way to do this?



267. How can you determine if another website is active (The server is running) or not?



268. I am having trouble installing PHP on my solaris 8 sun server.



269. Using the exec function, how can I call and start a java program. What is the command statment used?



270. What is the best way to send an &#39;unknown&#39; number of form fields and access them on the text page?



271. Can you send an array through a url (getting info without a form)?



272. how do you access/use other web pages on the fly?incorporateThemIntoYours?justPointMeInTheRightDirec



273. how do i get a directory listing on a server without displaying any of the subdirectories?



274. How do I make a news script that only saves/prints the last X entries with an admin section/flatfile



275. COM does not work with PHP... not getting any error messages... php just &quot;hangs&quot;



276. How can I add a file to the $data? As in a form containg an &lt;input type=&quot;file&quot; /&gt;



277. How do i force PHP to flush already printed lines, on a script still running on the server?



278. How to install PHP in windows xp?



279. How to READ a directory of PDF files that display as links to open the pdf



280. *what is the pdf function to change text color?*



281. Binary files get couupted when uploaded with a php script - even if content-type is specified. Why?



282. How do I download PHP File from other site? I heard that it can be downloaded in it&#39;s source code.



283. does anyone know how I can work out the x,y coordinates on a map from a given postcode?



284. Does REMOTE_ADDR give the user&#39;s IP or proxy&#39;s IP?



285. How can I store an image path in PostgreSQL and dispaly it in PHP



286. Can PHP websites be co-hosted on Apache servers in the same manner that Microsoft ASP sites can be ?



287. How can I extract just the domain name out of HTTP_REFERER?



288. Security Alert! PHP CGI cannot be accessed directly



289. Simple PHP/MySQL page, all page data is displayed... but page won&#39;t stop loading- why?



290. When i do this why do i get the file content + 1 retuned : echo include(&quot;content/news.txt&quot;)? Fix?



291. This may be a stupid question, but why choose PHP over an Access database?



292. Hello, I have an error: unable to load openssl.dll but i can load such as zlib.dll(IIS5+PHP4.1.1)



293. can php load an image in place of a flash movie for users without the flash plugin?



294. Can I embed a PHP file in an HTML file. Similar to the &lt;script src=&quot;abc.js&quot;&gt;&lt;/script&gt; for Javascript



295. PHP not seeing variables from WML



296. Why can&#39;t php 4 on my apache 2 server find the $HTTP_USER_AGENT variable (it says undefined)?



297. How can I sort data out of my MYSQL database in monthly Stats format and display it in an html page?



298. increment in date variable



299. Trying to configure php4 for apache 1.3.24 when i create my test page i receive an Error404. WHY?



300. Is there a company that offers a support contract to the PHP product?



301. How can I download the database tables from the server using PHP?



302. I need to be able to increase the count for defined field



303. How can i auto update php?



304. how to read pdf files stored on a LOB in Oracle?



305. Need a php script to post data to a host and get the response content from this host.



306. I have a table of users. Can I count how many males and how many females without multiple queries?



307. How to get print out for a remote file ?



308. under win XP (IIS 5.x) the function &quot;filetype($file)&quot; always retns &quot;block&quot; whatever it is, why??



309. undefined symbol - mysql_field_count error - has nayone come across this and what is the solution?



310. How do you use a hidden field in wml?



311. How portable is php across browser and server platforms?



312. How to do Browser, JavaScript, and CSS detection using PHP?



313. How do I make a member area in my site? I have around 700 pages and don&#39;t want to change them all.



314. Sambar Server says:&quot; File not found&quot;.where do you usually save php files?any change in php.ini neccs



315. Mysql: fetch and print the value of a single cell



316. help in building a meta search engine



317. How can I use the header: Location: method and open a new browser window with a specific size?



318. How can i uninstall PHP4.0 ??DELETING folder, givesmeassge &#39;Cannot find php4isapi.dll,may be in use&#39;



319. mail() not working, I have just upgraded the php version and now mail() will not function?



320. Using session_start() to save/restore global vars, but SOMETIMES get error &quot;....permission denied&quot;??



321. Is is possible use functions from the PHP library in a C / C++ program? If so, how?



322. What file path do I use to update (append) a file on the same server as my web server(/files/*.txt)?



323. What versions of Ingres II are supported by PHP ?



324. I have 100 sites on a 1 virtual server. I need to display all the images in a directory to each site



325. Can comments be added to a cell in an Exel file with PHP?



326. I&#39;m having problems to parse textarea values over more than 2 forms.



327. Why are my php apps slow in my Win98SE server than other website&#39;s?



328. How can I execute local programs as root from PHP? I want to use UNIX commands adduser and passwd.



329. I need php.exe to output the contents of a script without &#39;X-powered-by&#39; and the other headers. How?



330. using include_path for unix



331. How to generate &#39;base&#39; strings in PHP (base16 / base36 / base64 etc)?



332. How can I view my own php files on my Windows XP computer? I don have a web host...



333. Is there a way in PHP that I can run a script locally on a machine from a remote location?



334. I can&#39;t pass variables from an htm to php page - do i need to change a setting in php.ini?



335. I can&#39;t pass variables from an htm to php page - do i need to change a setting in php.ini?



336. When I process a form by a .php file, the variables from the form are not availbale in the .php file



337. How can I start up the mysql server on my windows server using PHP?



338. How can I print to client printer by PHP? I can only print to server or share client printer .



339. permission denied when executing script from apache server for file open



340. How do i get a list of filenames from a directory?



341. working with PHP-Nuke. how do you setup a link to a CGi script, and have that show into a Nuke block



342. How do you push a url with PHP?



343. I have a string $string=&quot;Fred.html|Sanu|Sachin.html&quot;.I need to seprate the .html extensions?I



344. Can PHP automatically update auto incremented numbers in MYSQL?



345. Undefined variable error? Code runs on fine one site and not on the other!



346. I am selecting a userid from form and i want to display info from database, based on my selection.



347. is there a way to count the number of currently active sessions?



348. How to format an array so the variables on it have a 
 as separator?



349. How can i embed a .swf in a PHP script?? without using Ming



350. How do I create a self-advancing slide show of pictures in PHP?



351. How to get the name of the current PHP file? to print its modification date in a global footer.



352. How to get the name of the current PHP file? to print its modification date in a global footer.



353. I need to get a result of confirn() (Javascript function) to use it in a PHP function, can I do it?



354. When I use php script to create new file or folder, the owner of new file and folder is not me how I



355. how can I create a search engine to my MySQL database such as the existing in this web site?



356. how can i remove the www.pdflib.com when i use the pdflib function?



357. How do I use, inline, the elements of an array returned from a function? ie. myFun()[&#39;returnedEl&#39;]



358. Is there any struts-like framework for php??



359. &quot;Parse Error: parse error, unexpected T_SL&quot; What does that mean?



360. How do I use PHP to &quot;print&quot; data on an HTML page from a comma delimited text file?



361. How do I call a c program from php, it has to pass a string with it and have ti return a string?



362. how do I run a process in the background?



363. Can I write a 15 product database website in php without mysql?



364. how can I let the user specify his own &quot;page id&quot; in order for it to be defined as the &quot;any string&quot;?



365. How to disable HTML, Javascript, etc in a TEXTAREA ?



366. How to change the ? character in the PHP query string into / character?



367. How do I format a timestamp(length 8) date into YYYY-MM-DD when I display them with echo function?



368. How can i join two values to form a single value by using a seprator character?



369. How can i join two values to form a single value by using a seprator character?



370. Why using VARCHAR with BINARY attribute for a field within MySQL doesn&#39;t ensure case-sensitive?



371. How can I determine the client path of file uploaded through an html form ?



372. How can i join two values to form a single value by using a seprator character?



373. I can&#39;t display display images retrieving from a database. Can somebody help me?



374. how do I post an XML request to an external URL?



375. What is the mean of isset in this line: if(!isset($mainfile)) { include(&quot;mainfile.php&quot;); }



376. How can I add .php extension to IIS5.1 as my OK button shaded out



377. can i use rsync in php



378. How do I save form data to a file, as with perl cgi.pm query-&amp;gt;save(FILE) ?



379. How do I save form data to a file, as with perl cgi.pm query-&amp;gt;save(FILE) ?



380. Does anyone know where I can find a list of supported databases? Please



381. I can&#39;t use the $REMOTE_ADDR variable: it just shows a 0. But in  it shows up properly



382. Can somebody please tell me when to use fsockopen() etc...and when to use socket_create() etc...



383. Why might I be getting &#39;garbage&#39; characters before my output?



384. How to calculate the distance between two locations on the earth?



385. How to calculate distances based on latitude and longitude?



386. How to implement a &quot;store locator&quot; based on a user&#39;s ZIP code, which lists the closest dealers from our database?



387. how can i display different logos depending on the login after a user has logged on???



388. How do I get php to display first 6 characters on third line of a txt file, and nothing else?



389. why this &lt;a href=&quot;https://www.blogger.com/index.php?fuseaction=a_value&quot;&gt;Link&lt;/a&gt; doesn&#39;t work on php 4.2.3?



390. When looping with a mysql_fetch_array($result) how do I change the font and size of the results.



391. What does it mean -&quot;php encountered a stack overflow



392. Making a third option in this code ($gender == &quot;1&quot; ? L_REG_46 : L_REG_47); i want to make 3 L_REG_48



393. how can i store php code &amp;amp; query in mysql database and get all to execute when retrieved



394. Do anyone know how much load a php script create on apache server when server runs it?



395. How can PHP access VSAM files??



396. is there any standard user input available in php other than forms



397. I am sending emails one at a time using foreach. How do I outout to html as each one is processed?



398. How do I access net pages behind the squid proxy by using php codes on my php installed computer?



399. PHP 4.2.3 Problem-Why can&#39;t I pass values via URL as in: href=&quot;page.php?var1=value1&amp;amp;var2=value2&quot; ?



400. PHP 4.2.3 Problem-Why can&#39;t I pass variables with set values to another page.php?



401. How can i include a PHP PAGE on a non-php server?... I mean i want include a SIMPLE php page...



402. Why can&#39;t I get PHPSESSID to work (PWS on NT WorkStation 4.0, PHP 4.2.2)?



403. My next link won&#39;t go to the next page to view my mysql data record?



404. how do I have a php stand alone script call a new html document????



405. How do i count the number of times a hyperlink is clicked using Php?



406. How can I reload a sql query in the same page without opening a new page and using a submit button?



407. Why can&#39;t I install php in windows2000?



408. How do I log an IP Address on site to protect against fradulant behaviour?



409. Line breaks in a PHP script



410. In the following script, how do I get hard line breaks? $GrabURL = &quot;http://www.geocities.com/michael



411. How can I use the XML HTTP Request object with PHP?



412. How can I pass a value from php to php?



413. how to enable the ssl from php with apache



414. I have a PHP/MySQL web site that only works when accessed from computers outside my office! Help.



415. php installation problem - my_tempnam tempnam is dangerous



416. How to read just the last, let&#39;s say, 15 lines from a file?



417. Can PHP automate Form entries and retrieve the resulting data (as if someone pressed &quot;submit&quot;)?



418. ColdFusion allows automated Form entry and retrieval of resulting data with CFHTTPPARAM--is there a



419. I am trying to use the UPS online tools. How do I post them some XML and get an XML response back?



420. What is this mean: Warning: Use of undefined constant



421. how do i make a link open a template and insert content into it from the peramaters set by the link?



422. Does PHP has something similar to the forward() method in Java? ( RequestDispatcher.forward() )



423. How to encode my php code so i can distribute my code to other without seeing my code?



424. Using the same MVC model as J2ee how do you pass information to the forwarded php w/o storing the da



425. How do you get the HTTP_REFERER if the 404 page is set to be a php page



426. Is there a &quot;goto&quot;-like function in PHP like in Q-BASIC or VB or VBScript?



427. I need to read a text file &amp;amp; display the contents on the web page from which the php script executed



428. shell variables like $HTTP_USER_AGENT dont return value



429. How can I keep a part of an address such as ?id=blah from showing in the browsers address bar?



430. An example please of how to use the mail() function to include 2 or more file attachements



431. Can I call a PHP function from Javascript?



432. how do i get gettext support for a windows php based machine?



433. PHP - openssl_pkey_get_private - How to export public key to file or string?



434. Can i use PHP aplication wrtiten in Win2000 on linux ???? whats need to be changed???



435. How input in the URL the &quot;id&quot;?



436. How to perform multiple records updates in PHP?



437. How to get an object result from web service



438. Block direct access



439. How do I block direct access



440. How to link 2 forms together by using a submit button?



441. How can i connect Oracle 9i with PHP?



442. how to Retrieve Information Using a Hyperlink with Parameters in PHP? PLease help me.....



443. I was send files w/ php extension, how do I poen them? thanks



444. Apostrophe in a database input - magic quotes or something?



445. how do I pass session variables to another page



446. How would it be possible to send a page (images included) from a form with the mime classes?



447. how to call javascript functions which are located different ip then php running.



448. How difficult would it be to use PHP/SQL to count when people click on an email or web link?



449. Is there a way to stop passwords from being POSTED in clear text?



450. Is CCSLIDE Database compatible with PHP or not ??



451. How do I convert a hex longint(4 bytes, little-endian) as a string to a decimal integer?



452. How do I display the output of a .php file in a table on/within html in a table?



453. How can I direct php output to its calling html page?



454. Is is possible to redirect a User to another URL and send some variable with the post method?



455. Where is php.ini in the Mac OS 10.2.3 release? In PHP 4.3.0, the phpinfo() returns /usr/local/lib



456. How to do email read notification in PHP



457. How to recomplie php from windows 2000



458. Is there any way to execute a PHP file (like with include) but direct its output to a variable?



459. how to register the variables automatically by default in php?



460. To use ob_gzhandler() is zlib needed?



461. Does anyone know how to connect to Active Directory using PHP maybe with LDAP???



462. How can I publish a php generated website on a cd rom?



463. Can&#39;t include or fopen: &quot;http://www.ndbc.noaa.gov/data/realtime/62107.txt?



464. why? -- Notice: Undefined variable: badExts &amp;amp; dirs



465. how can I refresh a page using a radiobutton???Just Clicking It.Without SUBMIT



466. I have a php site that works on IIS/Windows, I decided to move it to Apache/linux and it broke



467. how can I keep data on a php page that gets passed from a html form from, say, 4 different users



468. I keep getting this when trying to install Warning: open_basedir restriction in effect. File is in w



469. How do I get at $HTTP_SERVER_VARS[&#39;PHP_AUTH_USER&#39;] variable under Apache, PHP on WinXP?



470. i want to send via echo a formated text in php, how does this work?



471. Fatal error: Call to undefined function: getmxrr()



472. how can I show a fake address on the address bar?



473. how I can set cookies for authentication



474. Force PHP-created graphic to be fresh/not cached? How?



475. Why can&#39;t IE6 in WinXP open any .PHP file? (by File-&amp;gt;Open)



476. I get this error when testing with mysql ....Parse error: parse error, unexpected T_ECHO



477. Is It possible to make text flash using PHP or any other language that can be embedded into HTML?



478. how to delete multiple records using a checkbox



479. I want to install a PHP library on my server. When I execute phpinfo the library hasn&#39;t been added??



480. Can I pass variables from one script to another?



481. I had encountered thi s error &quot;Fatal error: Call to undefined function: imap_open()&quot;. Please help.



482. How do I pass a variable coming from a form to make up an sql query? (ie=create table &lt;variable&gt;)



483. How do I pass a variable coming from a form to make up an sql query? (ie=create table &lt;variable&gt;)



484. how to unzip or untar any .tar or .tar.gz file using only php script, no shell access?



485. how to unzip or untar any .tar or .tar.gz file using only php script, no shell access?



486. Passing a variable from one .php to another WITHOUT using require() ...is it possible, and how?



487. Passing a variable from one .php to another WITHOUT using require() ...is it possible, and how?



488. What is the PHP equiv. of the ASP Request.QueryString



489. How can i send a password using fsocketopen?



490. How can I pass values (images &amp;amp; text) from a mysql field with php into a javascript script?



491. 1 - How can i change win-1256 charset to utf-8 encoding?



492. How can I use CTRL+N (new page on IE6) whitout copying the session id to the new page?



493. How do I add an HTML link to a page with php graph?



494. When I run my php script everything works fine but it always shows the closing tag (?&amp;gt;). Why?



495. What does this mean &quot;failed to create stream: HTTP wrapper does not support writeable connections&quot; ?



496. How should I configure my PWS (and/or php.ini) to see PHP-results in my browser?



497. Problems with Curl and Telnet.....please Help



498. how can i add pagging in php ??? is there any object like in asp ????



499. How do I calculate the number of hours between two dates in PHP?



500. when calling urls from a mysql database how do you make them active links on screen in php



501. How do I change this into a link? 



502. How can I calculate sha1 in raw binary format without php5?



503. How can I only collect information from checkboxes that are checked and then e-mail it?



504. How can I read from a cookie from within an included file?



505. EASY QUESTION. translation problem



506. EASY QSTION. php pages show up from local files as code, not translated to display. Apache,mysql,php



507. I edited php.ini, but does not changed that show in phpinfo?



508. How can I conect to an Informix database with ODBC in PHP?



509. I am wanting to call 1 script from another,then return to the next line of code in the 1st script ?



510. Formatting User&#39;s Input



511. Can&#39;t Get PHP on IIS5



512. Can&#39;t Get PHP on IIS5



513. Can&#39;t Get PHP on IIS5



514. How do I configure PHP (on my local PC) to connect to Sybase (on a Solaris server) ?



515. how can i send an attachment with my mail form to email id



516. Where can I find error information for &quot;Fatal error Maximum execution time of 30 seconds exceeded&quot;?



517. does PHP do documentation, like javadoc creates documentation?



518. How can I display the output from  to an html textarea box?



519. how can i execute linux OS commands like &#39;adduser&#39; from a php web page



520. How to sort a multidimensional array ?



521. how can i update xml node values via php?



522. mkdir problem



523. what areDesign patterns ?



524. what areDesign patterns ?



525. How can I successfully return data from a CGI script? It works in HTML using Virtual Includes.



526. PHP: Is there an editor (like FrontPage is for HTML) for PHP?



527. PHP: Does it allow me to translate a website to another language at the click of a button?



528. how can i add objectclass to an entry for a ldap record



529. how can i add objectclass to an entry for a ldap record



530. how can i get Visual Basic&#39;s grid like effect in php



531. how can i get Visual Basic&#39;s grid like effect in php



532. How do you install PHP in CGI Mode??? There is no doco on the subject!!!



533. Can you tell me why I always get ?PHPSESSID=9ki86 attached to all my link on the opening page



534. How do I use a html form within the php script. I am using a form that gets the input from a PH GET



535. Javascript is not working in a php file on windows system. Why?



536. File security on an intranet



537. how do i get the info from my html form into a text file similar to my order form using php?



538. How do I turn a php script into index.html



539. How do I create alternating-color repeated regions with PHP?



540. What are all the common php file extensions?



541. I need to run an external command that it isn´t native of the operating system (AIX).



542. I get an error when i use SMTP server to send mail by php.I&#39;m using win XP



543. How would i make a simple counter with text? (ie visitors: 17319)



544. How can i prevent a php page being cached in browser?



545. How can I change a field name in mysql database by using PHP?



546. How do I correct error &quot;Unable to parse configuration file&quot;?



547. How to create a separate PHP-File to predefine a table to give my sites a similar look?



548. php.ini will not load



549. php.ini will not load/parse/process in Windows 2003 Server + PHP 4.3.3RC2 + MySQL v4.0.14b



550. Using mail () , how do do smtp authentication ?



551. How can I include a php file in to a html file so that it is shown in a table that is in the html???



552. How to replace with pattern matching?



553. can i send FAX from php or using PHP script



554. Is there any file size limite with PHP for sending a file from client side to Apache server ?



555. I want to use imagecreate how do I get it to work? I have downloaded the gd 2.0.15 what do I do with



556. I want to call a user defined PHP function on buttons event like onClick. How can i do that ?



557. I am querying a mySQL database for names and addresses, how do I not pull any NULL values



558. How can a generate wed-based barcode, I want to use only the browser connecting to the backend.



559. Can php files be put in a directory other than the root dir.?



560. I get the error - Fatal error: Call to undefined function: mysql_connect() - what is wrong?



561. Detect &quot;Too many connections&quot; error and show alternate web page?



562. If i write the code for uploading in PHP, will the same code work on Windows, MAcintoshOSX, Linux?



563. How do i recompile PHP, Apache on RedHat Linux 9? I am trying to connect to SQL Server using freetds



564. I can&#39;t find Internet Services Manager, pls help!! I use Windows XP Home Edit.



565. Is there a way to check if an e-mail address is not fake?



566. How can convert Java Servlet into PHP?



567. what is in_array



568. How do I code a link from a sql query, such as an email link?



569. How do I install 4.3.3 on Freebsd..step by step for dummy



570. Installing or upgrading php with CURL support on Cobalt Raq



571. How can I display a PHP hit counter within a HTML form input text box?



572. How can I create a function to return the nº of weekends in a time interval(beg and End:yyyy/mm/dd)



573. How do I validate a Windows user and password?



574. How do I change an NT password (IIS)?



575. I can get the PHP code to show in my html. Its correct and im using Apache and mysql, please help.



576. I have a problem with is_dir(): Is doesn&#39;t return anything!



577. can not loading php_oci.dll at php started



578. php_oci .dll loading at php start ( i remove the comment from php.ini of extenstion =php_oci.dll)



579. How can I tell if a script is running from the command line (cli) or in a browser?



580. How do you authenticate if you use NTLM (IIS, PHP)



581. How to check if a newer entry id in mysql db? If yes, use 1 field in latest record as a variable.



582. how com i can not add item to httpd.conf to make php work with apache on windows?



583. I want to know how to make a page accessible only by a password: url/page.htm?pass=PASSWORD etc



584. I want to know how to make a page accessible only by a password: url/page.htm?pass=PASSWORD etc



585. I keep getting redirected to the login screen whenever I install a php package and I try to login



586. What changes in the file-function from PHP 3 to PHP 4.3.4?



587. SHMOP_open it allows me to open only 128 segments after that it throws an error (HELP)



588. How to Fix Err: Variable passed to reset() is not an array or object.



589. How do I set the order of the output from a database to the display?



590. How can I calculate the load time of a page?



591. i Installed php4 on IIS 5. Whenexecute an php script, it just come as it as like IIS not parsing it.



592. What is suggested procedure for upgrading from 4.3.2 to 4.3.4 using Windows binaries?



593. Is there a limitation to the file size when using move_uploaded_file? Returns false with files&amp;gt;2mb..



594. I´ve trouble with the debugger



595. I&#39;ve set up a php server, but it will not display any information through a web browser.



596. How do I send values to a mySQL database?



597. how can I execute .exe file(stored as blob in db) upon reading them



598. PHP setup with Apache Server - no errors but no display on browsers



599. How do I stop a space-seperated string from being truncated when it is passed using a form construct



600. I need to draw the plane of a house. I have data needed in a database table. Can I do it with PHP



601. Does PHP support foreign Language such as Thai, chienese



602. Can anybody answer me if exist a module for php which allows work with RAR archives like php_zip.dll



603. How to stream mp3s with out giving out the directory. I had it working except in Win Media Player 9



604. Are there generally agreed best practice coding recommendations for PHP?



605. Warning: fopen(../mycalendar.csv): failed to open stream: Permission denied in



606. How do I avoid having the SESSIONID come up in my links?



607. I want to define &quot;$DROOT = $_SERVER[&#39;DOCUMENT_ROOT&#39;]&quot; once only for all &quot;include($DROOT.&#39;/&#39;)&quot;. How?



608. What is PHP ?



609. Can i use PHP in Zope?



610. i want a register script than stores peoples username, password for them to login



611. If I append to a file, but if I hit refresh, the same info gets appended again. How do I fix that?



612. How can I transmit the session information to a script opened using fopen(&quot;http://localhost&quot;); ?



613. Can CLI and CGI modules of php be both installed ?



614. how to connect mysql database from pc1 and I&#39;m using php5 from pc2 on windows platform.



615. how to replace an image (possibly jpg ) with another one with out refreshing the browser



616. Can I use an image link that when clicked opens up a php file and inserts a specified image into it?



617. How can I access a JavaScript array with PHP??



618. How can I make a voting booth / poll for my site that runs off my server, using PHP?



619. What is the difference between include() and @include()?



620. What exactly is the use of PHPSESSID in a URL???



621. Will+the+mail+function+work+if+use+in+intranet+envirnoment%3F



622. how do i update mysql db with form variables using php?



623. How do I make a webcounter that I can call from a non-php HTML site ? (I can do easy mysql/php part)



624. How to change where sessions save to? Changing in php.ini doesn&#39;t work.



625. hi , can anybody tell me where i can download php_printer.dll



626. hi can anybody tell me where i can download php_printer.dll



627. how can i show the content of a mysql DB into a excel file using php (plz give code example)



628. O&#39;Reilly and PHP will not work



629. mail()



630. How can I insert dynamic info in my website (eg. exchange rate) taken from other site? Any scripts?



631. Is there any possibility to get the page from client browser?



632. Is there any possibility to get the page from client browser?



633. Why PhP does not recognize mysql_connect()Fatal error: Call to undefined function mysql_connect()



634. How do I open a new form and display data base on a value of a pull down list on current form



635. How can I send XML Attributes via Soap?



636. Is there a tutorial for interfacing a PHP page with a cvs file?



637. PHP



638. Can&#39;t find php.ini to update file_upload size only find a directories under /opt/php/lib/php/pear so



639. how can I configure apache so that I can run  commands in files that don&#39;t end in .php?



640. PHP mail() needs 40Sek to generate the mail. Sendmail works correct. System Cobalt RaQ550



641. How can I use InternetExplorer.Application to access the contents of specific frames?



642. How can I read data in from a USB Barcode Scanner using PHP???



643. How do I get PHP on Linux to work with Oracle on Windows?



644. XML brainbuster



645. Dynamic Code



646. Dynamic Code



647. PHP not accessing MySQL



648. Installed Apache, PHP and MySQL all working but when I try to connect to MySQL through PHP nothing..



649. I send a mail to a person. How I can keep track of when that person opens the mail?



650. How to convert decimal values to characters?



651. How do I get a submit button to print the current page?



652. define(&#39;DIR_WS_ICONS&#39;, DIR_WS_IMAGES . &#39;icons/&#39;); What does this means? It is from Zen-cart coding



653. PQescapeByte



654. have names as 2004aj,2004ad,2004A and need to list them but when do list 2004A it lists all the rest



655. How can make a Specefic MIME header



656. Are there any problems using COM functions with PHP5, WinXP and Excel 2003?



657. Can I reference PHP from a JSP page with &lt;a br=&quot;&quot; href=&quot;https://www.blogger.com/filename.php%3E&quot;&gt;

658. I&#39;m new to PHP, where should I start.?



659. Is there anyway I can specifiy in which frame to open a specific file using header(fileme),includ(f)



660. PHP: Operation:Get:Form: Variable: All: How to get all your form variables? [$_POST/$_GET/$_REQUEST]



661. Can PHP perform a scheduled task triggered without having a PHP page being loaded into a browser?



662. Is it possible to use PHP code in the onChange feature of the html select tag? If so, how?



663. Is any way to pass a variable from one .php to another WITHOUT using require()? How?



664. PHP: HTML: Convert: Where to convert automatically HTML to PHP print or echo text?



665. how to write code to access an AIML suing php



666. Instead of www.xyz.com/index.php?country=usa I&#39;d like www.xyz.com/usa



667. How can I echo the pagetop immediate, eg if php is doing a heavy job.



668. i need to use &lt;/a&gt;&lt;a 13=&quot;&quot; br=&quot;&quot; call=&quot;&quot; can=&quot;&quot; how=&quot;&quot; href=&quot;https://www.blogger.com/page.php?ref=13...&quot; i=&quot;&quot; new=&quot;&quot; on=&quot;&quot; page=&quot;&quot; tha=&quot;&quot; the=&quot;&quot; use=&quot;&quot; values=&quot;&quot;&gt;

669. i need to use &lt;/a&gt;&lt;a 13=&quot;&quot; br=&quot;&quot; call=&quot;&quot; can=&quot;&quot; how=&quot;&quot; href=&quot;https://www.blogger.com/page.php?ref=13...&quot; i=&quot;&quot; new=&quot;&quot; on=&quot;&quot; page=&quot;&quot; tha=&quot;&quot; the=&quot;&quot; use=&quot;&quot; values=&quot;&quot;&gt;

670. can i call an function in a executable file from php and get the result back to php



671. ASCII



672. why the  did not work?



673. i need a php script that will retrieve information about a user just by clicking a name on the page



674. i need a php script that will retrieve information about a user just by clicking a name on the page



675. i need a php script that will retrieve information about a user just by clicking a name on the page



676. Error: Access denied for user: &#39;apache@localhost&#39; (Using password: NO)



677. how can I disable cgi in php 5.3.9?



678. System() command not executing. Error thrown is &#39;Unable to fork system () &#39;



679. If I enter a text of 21K long in a text area form, hitting submit button doesn&#39;t do anything. Help



680. how do i manually configure php with apache server?? and then how do i run my scripts??



681. how to untar file using php script?  not work



682. Is PHP based on orther languages,and are there any based on PHP?( research papper for school)



683. How can I put URL &amp;amp;variables= into php generated javascript?



684. can require() or include() contain Http path? How can we include files in http path format?



685. Is it possible to issue a command to windows xp command-line through a php script?



686. What is PHP-GTK



687. Why is it not working with the browser/web server?



688. How do I install PHP-GTK on Win32?



689. Can I use Themes under Win32?



690. How do I know which GTK Classes are supported?



691. How do I use the buttons in GtkFileSelection?



692. How to install PHP on Apache?



693. How to install Apache, MySQL, PHP on Linux



694. Test Question



695. can i get the full url of site (including the http:// and www) i want know if they came from www2



696. What is the relation between the versions



697. Can I run several versions of PHP at the same time?



698. What did the initials PHP originally stand for?



699. What is the name of the new scripting engine that powers PHP?



700. Name a new feature introduced with PHP4?



701. Where can you find the PHP on line?



702. From a UNIX operating system,how would you get help on configuration options(the options that you pass to the configure script in your PHP distribution)?



703. What is Apacheâ€™s configuration file typically called?



704. What line should you add to the Apache configuration file to ensure that the .php extension is recognized?



705. What is the PHPâ€™s configuration file called?



706. can a user read the source code of PHP script you have successfully installed?



707. What do the standard PHP delimiter tags look like?



708. What do the ASP PHP delimeter tags look like?



709. What do the script PHP delimeter tags look like?



710. What function would you use to output a string to the browser?



711. How would you create a regular method within a class?



712. Which of the following variable names is not valid?$_value_submitted_by_a_user;$666666xyz



713. Which of the following variable names is not valid?$the first,$file-name



714. .What will be the following statement output?



715. How would you use the string variable created in the assignment expression $my_var + ‘dynamic”;to create a “variable” variable,assigning the integer 4 to it



716. Which of the following statements contain an operator?4;gettype(44);5/12:



717. How can you access and set properties or methods from within a class?



718. How would you access an object’s properties and methods from outside the object’s class?



719. What should you add to a class definition if you want to make it inherit functionally from another class



720. Which environment variable could you use to determine the IP address of a user?



721. Which environment variable could you use to find out about the browser that called your script?



722. What should you name your form fields to access their submitted values from an array variable called $form_array?



723. Which built-in associative array contains all values submitted as part of a GET request?



724. .How must you limit he size of a file that a user can submit via a particular upload form?



725. How can you ste a limit to the size of upload files for all forms and scripts?



726. What functions could you use to add library code to the currently running script?



727. What functions could you use to add library code to the currently running script?



728. What functions could you use to add library code to the currently running script?



729. What function would you use to find out whether a file is present on your file system?



730. How would you determine the size of a file?



731. .What function would you use to open a file for reading or writing?



732. What function would you use to read a line of data from a file?



733. .How can you tell when you have reached the end of a file?



734. What function would you open a directory for reading?



735. What function would you use to read the name of a directory item after you have opened a directory for reading?



736. What function would you use to open a DBM database?



737. What function would you use to insert a record into a DBM database?



738. How would you access a record from a DBM database by name?



739. How would delete a named element from a DBM database?



740. How would you open a connection to a MySQL database server?



741. .What function would you use to select a database?



742. What function would you send a SQL query to a database



743. What does the mysql_insert_id()function do.



744. Assuming that yopu have sent a successful SELECT query to MySQL,name three functions that you might use to access each row returned.



745. Assuming that you have sent a successful UPDATE query to MySQL,what function might you use to determine how many rows have been updated?



746. What function would you call if you want to list all database available from a MySQL server?



747. .What function would you use to list all tables within a database?



748. How would you create a while statement that prints every odd number between 1 and 49?



749. .How would you convert the while statement you created in question 24 into a forestatement?



750. True or false.If a function doesnâ€™t require an argument,you can omit the parentheses in the function call.



751. how do you return a value from a function?



752. What functions can you use to define an Array?



753. Without using a function,what would be the easiest way of adding the element â€œSusanâ€ to trhe $users array defined previously?



754. Which function could you use to add the string â€œSusanâ€to the $users array?



755. How would you find out the number of elements in an array?



756. In PHP4,what is the simplest way of looping through an array?



757. What functions would you use to join two arrays?



758. How would you sort an associative array by its keys?



759. How would you declare a class called emptyClass( )that has no methods or properties?



760. Given a class called emptyClass( ),how would you create an object that is an instance of it?



761. How can you declare a property within a class?



762. .How would you choose a name for a constructor method?



763. How would you create a constructor method in a class?



764. What environment variable might give you the URL of the referring pageâ€?



765. Why can you not rely on the $REMOTE_ADDR variable to track an individual user across multiple visits to your script?



766. What does HTTP stand for?



767. What client header line tells the server about the browser that is making the request?



768. What does the server response code 404 mean?



769. Without making your own network connection,what function might you use to access a Web page on a remote server?



770. Given an IP address,what function could you use to get a hostname?



771. What PHP function would you use to send an email?



772. What header should you send to the browser before building and outputting a GIF image?



773. What function would you use to acquire an image identifier that you can use with other image functions?



774. What function would you use to output your GIF after building it?



775. What function could you use to acquire a color identifier?



776. With which functions would you draw a line on a dynamic image?



777. What function might you use to draw an arc?



778. .How might you draw a rectangle?



779. How would you draw a polygon?



780. What function would you use to write a string to a dynamic image(utilizing the FreeType library)?



781. How would acquire a UNIX time stamp representing the current date band time?



782. What function accepts a time stamo and returns an associative array representing the given date?



783. What function would you use to formate date information?



784. How would you acquire a time stamp for an arbitrary date?



785. What function could you use to check the validity of a date?



786. What single function could you use to convert any data type to any other data type?



787. Could you achieve the same thing without the function?



788. What will the following code print?print â€œfourâ€*200;



789. How would you determine whether a variable contains an array?



790. Which function is desired to return the integer value of its argument?



791. How would you test whether a variable has been set?



792. How would you test whether a variable contains an empty value,such as 0 or an empty string?



793. What function would you use to delete an array element?



794. What function could you use to custom sort a numerically indexed array?



795. conversion specifier would you use with printf( ) to formaqt an integer as a double? Write down the full syntax required to convert the integer 33.



796. How would you pad the conversation you effected in question 1 with Zeros so that the part before the decimal point is four characters long?



797. How would you specify a precision of two decimal places for the floating-point number we have been formating in the previous questions?



798. What function would you use to acquire the starting index of a substring within a string?



799. How might you remove white space from the beginning of a string?



800. How would you convert a string to uppercase characters?



801. .How would you break up a delimited string into an array of substrings?



802. What regular expression syntax would you use to match the letterâ€bâ€ at ;least once but not more than six times?



803. How would you specify a character range between â€œdâ€ and â€œfâ€?



804. .How would you negate the character range you defined in question 124?



805. What syntax would you use to match either any number or the wordâ€treeâ€?



806. What POSIX regular expression function would you use to replace a matched pattern?



807. What PCRE function could you use to match every instance of a pattern in a string?



808. Which modifier would you use in a PCRE function to match a pattern independently of a case?.



809. What function designed to allow you to set a cookie on a visitorâ€™s browser?



810. .How would you deletye a cookie?



811. What function could you use to escape a string for inclusion in a query string?



812. Which built-in variable contains the raw query string?



813. The name/value pairs submitted as part of a query string will become available as global variables.They will also be included in a built-in associative array.What is its name?



814. Which function would you use to start or resume a session?



815. Which function contains the current sessionâ€™s ID?



816. How can you associate a variable with a session?



817. How would you end a session and erase all traces of it for future visits?



818. .How would you destroy session variables both within the current script and the session?



819. What does the SID constant return?



820. How would you test whether a variable called $test is registered with a session?



821. Which function would you use to open a pipe to a process?



822. How can you write data to a process after you have opened a connection to it?



823. Will the exec( ) function print the output of a shell command directly to the browser?



824. What does the system ( ) function do with the output from an external command it executes?



825. What does the backtick operator return?



826. How can you escape user input to make it a little safer before passing it to a shell command?



827. How might you execute an external CGI script from within your script?



828. What function outputs useful information about your PHP configuration to the browser?



829. What function could you use to include a syntax-colored source listing of a PHP script?



830. Which php.ini directive enables you to control the strictness of error messages?



831. What function can be used to override this directive?



832. .Which function allows you to log errors?



833. What built-in variable will contain the error message if the php.ini track_errors option is allowed?



834. What PHP function do we use to make our connection to the MySQL database server?



835. What PHP function do we use to initiate or resume a session?



836. Which function do we use to include library files in our projectâ€™s pages?



837. What PHP function do we use to send SQL queries to the MySQL database?



838. What constant do we use to add a session ID to an HTML link?



839. How do we move the user on to a page?



840. What function do we use to format date information?



841. What function do you use to add an element to the end of an array?



842. What PCRE function could you use to match every instance of a pattern in a string?



843. How do i create a simple client login set-up?



844. If I have actions in a center frame, how do I refresh a different frame (not the whole page)?



845. How can I have a script run every few minutes on a server if I can only use daily or monthly crons?



846. how to post the recordset value like multidimensional array on submit the form



847. How to retrieve data from other pages(html)?



848. Is there a way that I can make the PHP auto generate thumbnail of videos/flash files that i upload?



849. How can i crypt my sourse code ?



850. how can i send a mail to an email address that is available in the database through php script



851. Complie Error in PHP 5.1.1



852. &quot;Maximum execution time of 30 seconds exceeded&quot; frequently shows up on pages that usually work fine.



853. All mail sent using mail or imap_mail goes to junk box. How do I correct this?



854. PHP: Windows XP: Apache how to get them working together?



855. how can i add security to my php formail form to stop spammers?



856. Is it possible to call a php function by using a hyperlink onclick event?



857. need to do a script using curl to measure speed from http://DomainA.com to http://domainB.com?



858. globals aspx equivalent in php



859. Is there any way to complie my own Php scripts to protect the source?



860. Could someone help with code that sends a number of variables to a php page when a link is clicked?



861. How do I set up SMTP server on my Windows computer, and how do I configure PHP to send mail()?



862. How do I specify php code for input onchange events



863. &quot;Fatal error: Call to undefined function mysql_connect().....&quot;getting this error



864. What are the Different PHP versions?Explain the changes among them?



865. What are the Different PHP versions?Explain the changes among them?



866. Email using php via lotus notes



867. i have used apc_clear_cache()to clear the cache but i got error call to undefiend function



868. Require Virtual Pathsrequire(&quot;/folder/filename.php&quot;);



869. Require Virtual Pathsrequire(&quot;/folder/filename.php&quot;);



870. How do you include virtual paths in PHP, ASP has &lt;!-- include virutal=&quot;/inc/file.asp&quot; --&gt;



871. How can I build Graph in PHP?



872. i am using mail() to send html but it shows as plain text at the client



873. blank pages



874. Please help. How can i CREATE and DROP oracle tables through a web page interface using html and php



875. what does var= mean



876. what is the difference between include once() require once()?



877. what is the difference between include once() require once()?



878. HTTP_SERVER_VARS



879. How to perform simple linear regression analysis with PHP?



880. How to compute trend equation from an array of data?



881. How to forecast future value using existing data?



882. can i get the value of a javascript variable in php code



883. I am trying to make the data of a file into a variable. How can I do this?



884. ereg_replace result includes backslash in search &#39;\141&#39; to &#39;\a&#39; should be &#39;a&#39;



885. how do use a browser to save the displayed HTML output of a PHP file?



886. No input file specified.



887. how to create a chart in PHP



888. Has anyone the correct Mysql connection string for GOdaddy.com? mine does not seem to work



889. How can i add all the values of a form in one field in a table using array



890. mail



891. How we communicate with the bar code scanner??



892. MySQL and PHP5, &quot;Access denied for user &#39;SYSTEM&#39;@&#39;localhost&#39; (using password: NO)



893. How can I extract the public key from a certificate file (.cer file)?



894. IIS and php



895. My html pages are not dipsplaying but php pages working correct



896. How do I create a functional thumbnail system for my art gallery? It just shrinks images right now.



897. HELP!



898. Which version has the time limitation (i.e., Dec 31, 1969) removed?



899. How to solve &quot;UX:sed: ERROR: Output line too long&quot; problem while doing make on unix(mpras flavour)?



900. does PHP do documentation, like javadoc creates documentation?



901. download file



902. test, mac



903. hide email address



904. How to submit form direct to email



905. How do I code a button that changes the value of a PHP variable?



906. xml php



907. How to runa php file without .php extension ?



908. How to catch and process a stream sent from a StreamWritter of a Window .Net application ?



909. how can i know that a page is using a GET method or POST method without checking the URL



910. While calling a form, it is displaying the PHP code instead of displaying the output .....



911. Function for checkavailablity of a username when a user click a hyperlink



912. Function for check-availablity of a username when a user click a hyperlink using javascript and php



913. my script does not get $_SERVER variables



914. Looking for a freeware PHP module/library to parse HTML files



915. can i sue onchange attribute for a textbox in php



916. How to make a site navigation (f.e. You look &amp;gt; blah &amp;gt; blah) for loading iframes without database?



917. who is the founder of PHP?



918. PHP/Apache setup/config problems... Also: PHP script showing up blank or displaying actual PHP source



919. Where can i get the library extensions like php_*.dll



920. execute external program



921. exec system external program



922. how can i use php to access a MSSQl linked server?



923. filesize



924. How to use the SSL context options capture_peer_cert and capture_peer_cert_chain?



925. downloding the file



926. How to upload/dowload big file?



927. apache integration



928. how to make paging?



929. How do I fix a: &quot;Your PHP install misses ZIP support&quot; ?



930. &quot;global variable&quot;



931. when tried to execute a php program IE gives me the dialog box asking &quot;Do u want to save this file?



932. how do i create a php script that i can install onto my webspace to give me the Base directory



933. Difference between require_once and require



934. How can I prevent users putting URLs in the text box of my form?



935. I want to make an update to a mysql tabel every 30 minutes.



936. Database with MySql



937. Help resolving an error message



938. Can anyone tell me what is this &quot;-&amp;gt;&quot; symbol? i see it so many times.



939. How would I merge two felds and show a quantity after the element



940. Unable to retrieve block names from database



941. How can I parse headers in http request and extract filename var and then save body to that var.



942. I want to download an XML file from it&#39;s source server to my own for parsing. How can I do this?



943. iis



944. I want to put an URL link to CLICK HERE IN: echo &quot;Click here&quot;. HOW TO DO?



945. How can I run PHP scripts by schedule?



946. How can I run PHP scripts from Command Line?



947. What is the difference between CLI and CGI SAPIs?



948. Please recommend wesites for PHP Freelancing. Thanks in advance.



949. Fatal error: Call to undefined function mysql_connect()



950. SOAP type extension



951. How do i split a single field value like &quot;news&quot; across many pages using php?



952. Is there an awesome php-based CMS for artists?



953. Any help &quot;C:\Program Files\Aspell\data/iso8859-1.dat&quot; is not i n the proper format.



954. what are the differences between PEAR and PECL?



955. How do I get a web page into my php script so as to extract data from it?



956. configure: error: apxs2: invalid package name



957. configure: error: apxs2: invalid package name



958. configure: error: apxs2: invalid package name



959. Need detailed intstructions on how to install and configure php to host phpbb2 forums



960. how to run script file xx.sh and execute linux command line without return string such tc command



961. resize a bmp file



962. Hyphen/Minus/Dash problem with JavaScript,HTML and PHP



963. Safemode - Local vs. Master. Why does the master show &quot;off&quot; but the local to &quot;on&quot;?



964. CLI



965. Updating information in an include file - I have an include file that shows information on many file



966. line break in php



967. How to determine &quot;Geo Location&quot;?



968. How to get country information from IP address



969. IP to Country calculation



970. but what if the session is closed because of a network problem



971. I get a CGI Timeout error when running a larg php script that is Pulling Information From a Website



972. CGI Time Out Error



973. Using cURL and get timeout error



974. I get a CGI Timeout error when running a larg php script that is Pulling Information From a Website



975. CGI Time Out Error



976. Using cURL and get timeout error



977. Is it posible to display only 10 records in a page?



978. PHP/MySQL - track impressions and click through rate for listed products?



979. When using DOM i got depressive Warning: domdocument::domdocument() [function.domdocument-domdocumen



980. Can I write a PHP script to load random external images?



981. How can I use PGP with PHP?



982. Unanswered Questions



983. building php with informix returns error: cannot find -lphpifx. Were can i get it?



984. How can I report searches, reporting search-words? (formsearch in my sql-database)



985. How can you include a CGI file in a PHP and have it stay in there when you use a link in the CGI



986. How can I configure php_value directives for mass virtual hosting? ie: equiv to VirtualDocumentRoot



987. why do I fails always after call gethostbyaddr, but right if there exit mapping in HOSTs(on win XP)



988. &quot;Total Noob&quot; how do I put a index.php script in an HTML page so it opens the file cont.- dif. frame?



989. I have created excel reports using php,html and header..But the sheet is editable..how to protect



990. I cant execute external programs &quot;Unable to fork ...&quot;. Why? I have PHP 4 and Windows 2000 with IIS 5



991. is it possible to post unicode data to DB via web form? Im using W2K/PHP/Apache/MS SQL.



992. How can you change two frames (submenu and welcome page) after someone logs in with a session?



993. How can I display the date a form was submitted using DATE as the col_type &amp;amp; how is DATE_FORMAT used



994. special characters (e.g. inverted exclamation) are being changed when using global &lt;form&gt;
vars
&lt;br /&gt;


995. strtotime fails using postgresql 7.2.1 and php 4.1.2 (redhat 7.3); floating point seconds not parsed
&lt;br /&gt;


996. Undefined function imap_open(). Installed --with-imap-ssl. Do I have to install --with-imap?
&lt;br /&gt;


997. I have a cgi which outputs Content-type: text/xml, how can I call this cgi, then parse the output ?
&lt;br /&gt;


998. How do I only read the 10 newest files in a text file?
&lt;br /&gt;


999. How to: shtml page includes php file that gets (and sets to var) the shtml page&#39;s path not it&#39;s own?
&lt;br /&gt;


1000. When a html page is process by PHP engine, I am seeing added characters placed into the html source?
&lt;br /&gt;


1001. How do I call a c program from php, it has to pass a string with it and have ti return a string?
&lt;br /&gt;


1002. How do I run a php interface to a java application, i.e. pass input in, receive output and format it
&lt;br /&gt;


1003. Error trying to view page ,WHY? &quot;Document contained no data&quot;-NS &quot;Page is currently unavailable&quot;-IE
&lt;br /&gt;


1004. How can I stop access to my server when remote computer has my ip in REMOTE_ADDR in his config file?
&lt;br /&gt;


1005. What is the most efficient regex to find all the email addresses in a string?
&lt;br /&gt;


1006. Help with this code... How can i Get Fcontents to not print the code but display it as a web page??
&lt;br /&gt;


1007. I have exif enabled in php 4.1.2 but exif_read_data() keeps returning errors. why?
&lt;br /&gt;


1008. It´s possible print a document (.txt.pdf) from Apache Server?
&lt;br /&gt;


1009. How to build a printer friendly page that have 480x600 resolution during runtime?
&lt;br /&gt;


1010. how do i quit the dos php window properly - windows doesn&#39;t like me using the close box ?
&lt;br /&gt;


1011. I installed LIBMCRYPT and now I am installing MCRYPT. The message appeared: libmcrypt was not found.
&lt;br /&gt;


1012. In my search engine result outputs, how can I display contents of the page within the body &lt;body---- br=&quot;&quot;&gt;

1013. how can i allow my users to attach files to emails.i have php 4.1.1 on apache and win98



1014. I write a message in a text area then i go to my preview page and it is not in the right order,help!



1015. How do I pass a string variable to a Blob Field in MySQL?



1016. How do I connect to an Oracle 9i database to verify &quot;username&quot; and &quot;password&quot;



1017. Does anyone know where I can find out more information on PHP&#39;s Lotus Notes functionality?



1018. Grouping outputted data from a table, products grouped together by orderid for eample?



1019. is there any way update the database by sending mail to that prticular id



1020. How to retrieve default email id from the client machine without asking for it?



1021. Hello, I have been working on a hockey score sheet web data entry page and have gotten to the point



1022. hi i am new in PHP i want to know can it give any Think Like applet



1023. How can I add xml capability to a already installed php setup?



1024. Is it possible for PHP to communicate with TWAIN complient devices?



1025. Cannot open for read file1 open and write file2 remotely on one system but can on another.Why?



1026. Is there a function to allow authenticated acess through a proxy with fsockopen functionality?



1027. How can I write a mainform/subform screen in PHP that access a MySQL database?



1028. I have a database with a date field with values &amp;lt; 1/1/1970. How do I extract these values correctly



1029. Linux PHP 4.2.1&amp;amp;Apache, my PHP code is ignored when html code is present in a php file.



1030. I have a php 4.2.1 pop on my computer ~ leads to a porn page!! I can not find it on my C drive help



1031. How to use PHP to distribute software package to workstations?



1032. how to create a form just like when you going to sign up at certain website with userID, password



1033. where do you find php source directories in Mandrake Linux to enable sockets and recompile?



1034. how to connect to internet through PHP?i have tried exec(&quot;wvdial&quot;)but it wont&#39; work



1035. Why are variables not passing (PHP43,IIS5.0,Win2000Server)?



1036. How do you get the mHash() function on a Windows install of PHP 4? (it doesn&#39;t seem to be built in)



1037. I am trying to create a link that, when clicked, changes the data attribute of an &lt;object&gt; tag
&lt;br /&gt;
&lt;br /&gt;1038. I am trying to create a link that, when clicked, changes the data attribute of an &lt;object&gt; tag
&lt;br /&gt;
&lt;br /&gt;1039. hi, I have a problems with passing arrays with indexes in PHP
&lt;br /&gt;
&lt;br /&gt;1040. I want to start using PHP for DB sites but aren&amp;#39;t sure about writing PHP in MacOS. Starting points w
&lt;br /&gt;
&lt;br /&gt;1041. XP with IIS and PHP not returning complete set of headers... why?
&lt;br /&gt;
&lt;br /&gt;1042. How display a matrix dependant on other cells? ie fixture matrix dependant on entered results.
&lt;br /&gt;
&lt;br /&gt;1043. How can I see where the memory is going in my PHP-cli application?
&lt;br /&gt;
&lt;br /&gt;1044. php menu says mssql_connect requires &amp;#39;interfaces&amp;#39; file;what &amp;amp; where are they?
&lt;br /&gt;
&lt;br /&gt;1045. I changed my .httaccess to Errordocument 404 /404mail.php .It is not edirecting to this page.
&lt;br /&gt;
&lt;br /&gt;1046. working from the php book when i run the script at the end of chap 12 i get SQL syntax errors
&lt;br /&gt;
&lt;br /&gt;1047. In a self-processing form, is there a way to return to the same point in the page that you left from
&lt;br /&gt;
&lt;br /&gt;1048. In a self-processing form, is there a way to return to the same point in the page that you left from
&lt;br /&gt;
&lt;br /&gt;1049. How do i redirect to other php or web pages and the new URL not shows up in the address bar.
&lt;br /&gt;
&lt;br /&gt;1050. How do i redirect to other php or web pages and the new URL not shows up in the address bar.
&lt;br /&gt;
&lt;br /&gt;1051. I started with a php file and tried to call a tpl file which called a php file. It didn&amp;#39;t work. Why?
&lt;br /&gt;
&lt;br /&gt;1052. How should I configure my PWS (and/or php.ini) to see PHP-results in my browser?
&lt;br /&gt;
&lt;br /&gt;1053. How do I run an ASP program on my Windows server within PHP
&lt;br /&gt;
&lt;br /&gt;1054. Will be there a version conflict problem for functions written in earlier versions of php
&lt;br /&gt;
&lt;br /&gt;1055. How can I add &amp;quot;preprocessor&amp;quot; to PHP, e.g. replace all &amp;quot;--&amp;quot; with &amp;quot;−&amp;quot; before PHP starts parsing?
&lt;br /&gt;
&lt;br /&gt;1056. Is there a way to query a text file using php? If so how? need to bring back individual results ?
&lt;br /&gt;
&lt;br /&gt;1057. How do I get a variable to pass into an included file that is located in a different directory?
&lt;br /&gt;
&lt;br /&gt;1058. how can i make that an PHP sript to run in background?
&lt;br /&gt;
&lt;br /&gt;1059. It is posible to download a directory (including all files a subdir) using PHP4.3.1?
&lt;br /&gt;
&lt;br /&gt;1060. I am uploading to a hosted server using Dwr MX. do i need to install php or will MX handle it.
&lt;br /&gt;
&lt;br /&gt;1061. im new to php and need to know how to calculate BMI, body mass index with php or mysql
&lt;br /&gt;
&lt;br /&gt;1062. I need the PHP syntax for adding mysql field values from a table and then echo the result.
&lt;br /&gt;
&lt;br /&gt;1063. How can I write different data into two separate frames on a form user submitting the form?
&lt;br /&gt;
&lt;br /&gt;1064. Where can I get more info about PHP Access violations such as 011929AE, 77FC8DA5 &amp;amp; 024529AE?
&lt;br /&gt;
&lt;br /&gt;1065. what can be done for generating setup program for php files on linux platform
&lt;br /&gt;
&lt;br /&gt;1066. What is the &amp;quot;official&amp;quot; communication method 4 html 2 javascript 2 php
&lt;br /&gt;
&lt;br /&gt;1067. How can i build and draw a tree with 3 childs for each node and for 10 levels, from a database.
&lt;br /&gt;
&lt;br /&gt;1068. How do you directly download a file into the Temporary Internet Files directory?
&lt;br /&gt;
&lt;br /&gt;1069. How do you use php to pull data from the database, like on jokes.com when you go into a section?
&lt;br /&gt;
&lt;br /&gt;1070. Can you use PHP to see if another e-mail server accepts HTML or text only email?
&lt;br /&gt;
&lt;br /&gt;1071. How do you display info from a database in a menu dependant on another menu recalled from the table
&lt;br /&gt;
&lt;br /&gt;1072. How do I put data into a list box dependant on another list box
&lt;br /&gt;
&lt;br /&gt;1073. I can not get my php scripts to work on an apache 2.0.40 to work, ie formmail and forums, help
&lt;br /&gt;
&lt;br /&gt;1074. How do I get the paragraphs to show, pulled from mySQL db, instead of one long text paragraph?
&lt;br /&gt;
&lt;br /&gt;1075. Is there a big difference if you use { } in your &amp;quot;if&amp;quot; condition instead of using &amp;quot;:&amp;quot; and &amp;quot;endif;&amp;quot; ?
&lt;br /&gt;
&lt;br /&gt;1076. I cannot run a commend from PHP scripts using exec(). This command can be run from command line.
&lt;br /&gt;
&lt;br /&gt;1077. I can no longer pass variables between pages using php4.06 and isapi with iis5
&lt;br /&gt;
&lt;br /&gt;1078. PHP code is running on Linux but not on Windows. Why?
&lt;br /&gt;
&lt;br /&gt;1079. How can I restrict access to certain files on an intranet using php?
&lt;br /&gt;
&lt;br /&gt;1080. I am trying to get Oracle 9i working with PHP. Having problems know what to compile.
&lt;br /&gt;
&lt;br /&gt;1081. Have all sort of problems using &amp;quot;?&amp;quot; within a &amp;quot;echo(&amp;#39;form&amp;#39;)&amp;quot; posting. Can someone show me correct way
&lt;br /&gt;
&lt;br /&gt;1082. how do i get the info from my html form into a text file similar to my order form using php?
&lt;br /&gt;
&lt;br /&gt;1083. is there any function that can print a web page with just one click in php???
&lt;br /&gt;
&lt;br /&gt;1084. CLASS: Can a property of a class be an Array datatype. Example please
&lt;br /&gt;
&lt;br /&gt;1085. How to use formfeed character &amp;#39;\f&amp;#39; in a .php file
&lt;br /&gt;
&lt;br /&gt;1086. A select box with diff. people&amp;#39;s names how do I send form to dif. emails depending on name selected?
&lt;br /&gt;
&lt;br /&gt;1087. What is the easiest way to use PHP to extract email addresses from a text file?
&lt;br /&gt;
&lt;br /&gt;1088. How do I terminate access to page in certain amount of entries and time using sessions and MySQL?
&lt;br /&gt;
&lt;br /&gt;1089. does anybody have problems by using css in php pages
&lt;br /&gt;
&lt;br /&gt;1090. is there a distribution of php, or a way to configure so that one might use it under Mac OS 8.6
&lt;br /&gt;
&lt;br /&gt;1091. User interaction via dialog box from PHP script?
&lt;br /&gt;
&lt;br /&gt;1092. How can I include a php file in to a html file so that it is shown in a table that is in the html???
&lt;br /&gt;
&lt;br /&gt;1093. Can I get Visual Interdev (6.0) to use syntax highlighting for PHP files?
&lt;br /&gt;
&lt;br /&gt;1094. Doing my tree in, how to i number summit
&lt;br /&gt;
&lt;br /&gt;1095. PHP will not work with IIS (xp). ASP and HTML work fine, but PHP just sits there. Any ideas?
&lt;br /&gt;
&lt;br /&gt;1096. alter table BOOKS add id_books int unsigned not null auto_increment first,add index (id_carte); msql
&lt;br /&gt;
&lt;br /&gt;1097. How do I send a file (that is on the server) as an attachment with mail()?
&lt;br /&gt;
&lt;br /&gt;1098. How can I modify .htaccess to enable both SSI and PHP?
&lt;br /&gt;
&lt;br /&gt;1099. Any web-based report writer available ? I am using Windows client IE and Linux PHP / PostgreSQL.
&lt;br /&gt;
&lt;br /&gt;1100. How do I get data to automatically come up in other fields when a user selects an option from a drop
&lt;br /&gt;
&lt;br /&gt;1101. File Download appears for .php files. Php.ini in \windows on XP.
&lt;br /&gt;
&lt;br /&gt;1102. How can I pass objects from one php file to another?
&lt;br /&gt;
&lt;br /&gt;1103. How to create a web page that refreshes its tabled contents against mySQL database?
&lt;br /&gt;
&lt;br /&gt;1104. function_exists doesn&amp;#39;t appear to work on class member functions, regardless if static or not???
&lt;br /&gt;
&lt;br /&gt;1105. can you determine whether your script is running at the console or was requested remotely?
&lt;br /&gt;
&lt;br /&gt;1106. I want printing on continous paper according to my requirement. Wanted to control the printer
&lt;br /&gt;
&lt;br /&gt;1107. Sessions won&amp;#39;t die. I tried evertything. I&amp;#39;m regitering using the $_SESSION superglobal. Please h
&lt;br /&gt;
&lt;br /&gt;1108. how to resubmit the information automatically without pressing the refresh button?
&lt;br /&gt;
&lt;br /&gt;1109. How to check if a newer entry is in mysql db? If yes, use 1 field in latest record as a variable.
&lt;br /&gt;
&lt;br /&gt;1110. Is there a function like file_exists in PHP Version 2 ?
&lt;br /&gt;
&lt;br /&gt;1111. how com i can not add item to httpd.conf to make php work with apache on windows?
&lt;br /&gt;
&lt;br /&gt;1112. How does one define the path to non-windows executables like cat.exe?
&lt;br /&gt;
&lt;br /&gt;1113. How does one define the path to non-windows executables like cat.exe?
&lt;br /&gt;
&lt;br /&gt;1114. Help! What do I do Php files opening as Ps files?
&lt;br /&gt;
&lt;br /&gt;1115. need to use [web] as a wildcard: elseif ($check == &amp;quot;go: [web]&amp;quot;) {$url = &amp;quot;[web]&amp;quot;;} is it possible?
&lt;br /&gt;
&lt;br /&gt;1116. What is the advantage to using &amp;quot;url/index.php?i69=members&amp;quot; over &amp;quot;url/index.php&amp;quot; to &amp;quot;url/members.php&amp;quot;
&lt;br /&gt;
&lt;br /&gt;1117. Why don&amp;#39;t works including of remote files under IIS 5.1 and PHP 4.3.2?
&lt;br /&gt;
&lt;br /&gt;1118. How can I parse a .csv file to a .ldf file , only parsing the particular information that I need?
&lt;br /&gt;
&lt;br /&gt;1119. where do i outsource php or get php experts for development ?
&lt;br /&gt;
&lt;br /&gt;1120. Can anyone please tell me why .php files will work for me but the same php files in HTML do not work
&lt;br /&gt;
&lt;br /&gt;1121. Populating a dropdown list field with data fetched from Oracle
&lt;br /&gt;
&lt;br /&gt;1122. How do I display New mysql database info without refreshing the page?
&lt;br /&gt;
&lt;br /&gt;1123. is there a course on how to write force matrix in php scripts?
&lt;br /&gt;
&lt;br /&gt;1124. SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specifi
&lt;br /&gt;
&lt;br /&gt;1125. i am getting msg&amp;quot;Can not open output stream {localhost:110/pop3}INBOX when i am calling imap_open()
&lt;br /&gt;
&lt;br /&gt;1126. I CAN&amp;#39;T RUN PHP AS MODULE IN APACHE ON WINDOWS XP (PHP-4.3.6 AND APACHE-2.0.49)
&lt;br /&gt;
&lt;br /&gt;1127. how do i get information from a plain text file as data for a marqee/ticker/scroller?
&lt;br /&gt;
&lt;br /&gt;1128. How can I set up my web browser to show Php designated sites?
&lt;br /&gt;
&lt;br /&gt;1129. How i can find number of record retuned in select statement usin Access odbc driver.
&lt;br /&gt;
&lt;br /&gt;1130. When i try to exec a program on a webserver i get 127 as an return value. What does it mean?
&lt;br /&gt;
&lt;br /&gt;1131. PHP4 will not connect to my Apache server. I&amp;#39;m using an IBserver program.
&lt;br /&gt;
&lt;br /&gt;1132. form subbmitted to csv, how do you remove file if form submitted and file already exists
&lt;br /&gt;
&lt;br /&gt;1133. form subbmitted to csv, how do you remove file if form submitted and file already exists
&lt;br /&gt;
&lt;br /&gt;1134. Is there a known issue with O&amp;#39;Reilly Website and PHP not working together?
&lt;br /&gt;
&lt;br /&gt;1135. is it possible to capture a swf and export it to jpg?
&lt;br /&gt;
&lt;br /&gt;1136. How can I insert dynamic info in my website (eg. exchange rate) taken from other site? Any scripts?
&lt;br /&gt;
&lt;br /&gt;1137. How do i connect php5 to mysql4? I get &amp;quot;Class &amp;#39;mysqli&amp;#39; not found&amp;quot; in the apache error log?
&lt;br /&gt;
&lt;br /&gt;1138. I tried to call mysql_connect(), but got the error &amp;quot;Call to undefined function mysql_connect() Idea?
&lt;br /&gt;
&lt;br /&gt;1139. How do I include a &amp;quot;news.php&amp;quot; file into an index.php file, I&amp;#39;ve tried 
&lt;br /&gt;1140. How to support PHP? no IIS,no apache,it is my develope server...it support CGI now.
&lt;br /&gt;
&lt;br /&gt;1141. How to support PHP? no IIS,no apache,it is my develope server...it support CGI now.
&lt;br /&gt;
&lt;br /&gt;1142. How can I adjust local date time in a PHP Calendar script?
&lt;br /&gt;
&lt;br /&gt;1143. How can I call or use a dll writen in Visual Basic 6.0
&lt;br /&gt;
&lt;br /&gt;1144. how to redirect a page, and how to use querystring
&lt;br /&gt;
&lt;br /&gt;1145. when i open file by using this command ($fp=fopen(&amp;quot;hello.txt&amp;quot;,&amp;quot;w&amp;quot;) i get message &amp;quot;permission denied&amp;quot;
&lt;br /&gt;
&lt;br /&gt;1146. i am using Windows 2000 Server with PHP 4 and Apache 2 , i am trying use scrrun.dll with PHP but fail to use any body suggest me how to use it?
&lt;br /&gt;
&lt;br /&gt;1147. Are php scripts secure? i.e. is it possible to open my .php file and get my db userid/password etc?
&lt;br /&gt;
&lt;br /&gt;1148. Why am I getting a blank screen when I try using the imagecreatefromjpeg function? (PHP 5.0.2)
&lt;br /&gt;
&lt;br /&gt;1149. Problem logging hits to PHP pages when PHP runs as CGI wrapped in Apache to appear as module.
&lt;br /&gt;
&lt;br /&gt;1150. Is it possible to make a template in which any called text file can be inserted into a specific area
&lt;br /&gt;
&lt;br /&gt;1151. I need to get my php date() time to update live, is there away, and how do I do it?
&lt;br /&gt;
&lt;br /&gt;1152. How would I make a template system for a blog?????
&lt;br /&gt;
&lt;br /&gt;1153. Error &amp;quot;server unwilling to perform&amp;quot; when changing password in an AD server using LDAP and PHP.
&lt;br /&gt;
&lt;br /&gt;1154. How can I read data in from a USB Barcode Scanner using PHP???
&lt;br /&gt;
&lt;br /&gt;1155. How can I read data in from a USB Barcode Scanner using PHP???
&lt;br /&gt;
&lt;br /&gt;1156. How can I update the options for a select menu based on a value selected in a previous select menu?
&lt;br /&gt;
&lt;br /&gt;1157. php.exe posting data vir commandline how to?
&lt;br /&gt;
&lt;br /&gt;1158. How can I code a simple form with textboxes so users can view what others posted?
&lt;br /&gt;
&lt;br /&gt;1159. why my scripts is showing warning mail over quota mail not send when new user register
&lt;br /&gt;
&lt;br /&gt;1160. how can I make something like php editor in php and the script is in colored
&lt;br /&gt;
&lt;br /&gt;1161. I&amp;#39;m having a problem compiling php with 2 versions of posgresql. Configuring with-pgsql=/usr (pg ver
&lt;br /&gt;
&lt;br /&gt;1162. How do I automatically display the number of listings next to category links using mySQL or no datab
&lt;br /&gt;
&lt;br /&gt;1163. PHP 4.3.4, parse_ini_file() returns a cannot open `FILE` for reading?
&lt;br /&gt;
&lt;br /&gt;1164. how can I set a quantity that reduces to zero in my eshop as orders are placed
&lt;br /&gt;
&lt;br /&gt;1165. Is it possible to copy a tar file from another server using fopen?
&lt;br /&gt;
&lt;br /&gt;1166. Iwant to make register (login and password) to my site but with php
&lt;br /&gt;
&lt;br /&gt;1167. how to use onchange method of listboxes in php?
&lt;br /&gt;
&lt;br /&gt;1168. Can I make a transparent HTTP(carry SOAP body) proxy with PHP? Here PHP is to determine the dest.
&lt;br /&gt;
&lt;br /&gt;1169. how can i use PHP mail() function to send mail to an address like info@academia-intl.com...?
&lt;br /&gt;
&lt;br /&gt;1170. How do I test that a remoter server has php working?
&lt;br /&gt;
&lt;br /&gt;1171. is there a way to import php in a mysql and export it?
&lt;br /&gt;
&lt;br /&gt;1172. Trouble allowing people to upload picture to yahoo hosted site
&lt;br /&gt;
&lt;br /&gt;1173. Best script to pull an series of integers from various offsets in a binary file to PHP variables?
&lt;br /&gt;
&lt;br /&gt;1174. Problem with php 5.0.3 on Apace 2 on WIN: It works but version sais: 4.3.10? Is it really 5.0.3 in..
&lt;br /&gt;
&lt;br /&gt;1175. I&amp;#39;m getting a pair of characters( 3D ) in my PHP Generated E-Mails, any suggestions?
&lt;br /&gt;
&lt;br /&gt;1176. Can someone tell me why my &lt;script&gt; tags and onClick attributes in &lt;a&gt; tag are being removed.?
&lt;br&gt;
&lt;br&gt;1177. How do you declare a variable so the variable will retain any HTML code imbedded in the string?
&lt;br&gt;
&lt;br&gt;1178. Does PHP support video streaming? I am working on an e-learning project. Thanks
&lt;br&gt;
&lt;br&gt;1179. why php variable names are case sensitive and why not function names?
&lt;br&gt;
&lt;br&gt;1180. How do I change the default account that mail is being sent from when using the mail () function?
&lt;br&gt;
&lt;br&gt;1181. &lt;form action=&amp;quot;dbtest2.php&amp;quot;&gt;
when form is submitted,browser opens the php file instead of executing
&lt;br&gt;
&lt;br&gt;1182. write a one-line expression to test whether a number is a power of 2. this question is asked in inte
&lt;br&gt;
&lt;br&gt;1183. How to set headers for images delivered through php scripts so that images are cached locally?
&lt;br&gt;
&lt;br&gt;1184. How do I only allow a PHP script to be accessed from the same server.
&lt;br&gt;
&lt;br&gt;1185. how do i create keywords that will autolink throughout my website
&lt;br&gt;
&lt;br&gt;1186. How can I get the included file names in a php file while I&amp;#39;m navigating?
&lt;br&gt;
&lt;br&gt;1187. why are sessions working on remote server but not localhost
&lt;br&gt;
&lt;br&gt;1188. PHP and MySQL problem with out putting data to a .txt file
&lt;br&gt;
&lt;br&gt;1189. Why are three bytes being added to my data?
&lt;br&gt;
&lt;br&gt;1190. Is it possible in php to draw/show a calendar-month as an image?
&lt;br&gt;
&lt;br&gt;1191. How can I do a &amp;#39;page scrape&amp;#39; and capture all of the existing form fields and values?
&lt;br&gt;
&lt;br&gt;1192. How can I redirect the output of a UNIX command executed in background from exec ( &gt;&gt; does not work
&lt;br&gt;
&lt;br&gt;1193. How to export public key to file or string in php&amp;#39;s openssl library?
&lt;br&gt;
&lt;br&gt;1194. How do I display the rows and time it took to execute the query? ( 132 rows fetched in .0679s)
&lt;br&gt;
&lt;br&gt;1195. why it hangs whenever i open my lotus 123
&lt;br&gt;
&lt;br&gt;1196. How can call a C function with PHPScript.can you give me an example
&lt;br&gt;
&lt;br&gt;1197. How can call a C function with PHPScript.can you give me an example
&lt;br&gt;
&lt;br&gt;1198. Besides connecting again is there absolutly no other diffrence between mysql_connect and pconnect?
&lt;br&gt;
&lt;br&gt;1199. How do you display multiple ticked checkboxes from a form in a database??
&lt;br&gt;
&lt;br&gt;1200. How do you display multiple ticked checkboxes from a form in a database??
&lt;br&gt;
&lt;br&gt;1201. How do you display multiple ticked checkboxes from a form in a database??
&lt;br&gt;
&lt;br&gt;1202. How do I insert a MySQL database with greek characters in dreamweaver?Greek characters are shown ???
&lt;br&gt;
&lt;br&gt;1203. How can I write to php.ini from a remote function
&lt;br&gt;
&lt;br&gt;1204. Urgent: How can I write and change the configs of php.ini from a remote function?
&lt;br&gt;
&lt;br&gt;1205. If I enter a text of 21K long in a text area form, hitting submit button doesn&amp;#39;t do anything. Help
&lt;br&gt;
&lt;br&gt;1206. ´What is the meaning of -&gt; example for this:($this-&gt;form-&gt;flugInited)
&lt;br&gt;
&lt;br&gt;1207. how do i make a php script run ?? i mean how do i test if its working.
&lt;br&gt;
&lt;br&gt;1208. how to untar file using php script? &lt;? system(&amp;quot;tar -zxvf file.tar.gz&amp;quot;) ?&gt; not work
&lt;br&gt;
&lt;br&gt;1209. How can we create a page with 2 web pages displayed,giving look like frames w/o actually using them
&lt;br&gt;
&lt;br&gt;1210. How can i retreive Content between the Name tag in nested html file bu regular expression ?
&lt;br&gt;
&lt;br&gt;1211. How do I direct pages to open within specific divs using php includes?
&lt;br&gt;
&lt;br&gt;1212. How to control the Printer using PHP
&lt;br&gt;
&lt;br&gt;1213. i want to retrive data in an HTML form,from mysql database ,using PHP ,Please tell me how is it poss
&lt;br&gt;
&lt;br&gt;1214. can require() or include() contain Http path? How can we include files in http path format?
&lt;br&gt;
&lt;br&gt;1215. How can i create a domain email account through php?
&lt;br&gt;
&lt;br&gt;1216. How can I detect the dimensions of a Form? I have a $form_block that stores HTML lines and tables.
&lt;br&gt;
&lt;br&gt;1217. Why &lt;?phpinclude(&amp;quot;http://www.dtcc.com/ThoughtLeadership/menu.htm&amp;quot;);?&gt; doesn&amp;#39;t display menu in html?
&lt;br&gt;
&lt;br&gt;1218. Why &lt;?phpinclude(&amp;quot;http://www.dtcc.com/ThoughtLeadership/menu.htm&amp;quot;);?&gt; doesn&amp;#39;t display menu in html?
&lt;br&gt;
&lt;br&gt;1219. Include statement in an echo statement
&lt;br&gt;
&lt;br&gt;1220. Can I change the speed of uploads and downloads with PHP5?
&lt;br&gt;
&lt;br&gt;1221. Can I change the speed of uploads and downloads with PHP5?
&lt;br&gt;
&lt;br&gt;1222. system(&amp;quot;crontab crontabs/crontabs.txt&amp;quot;); fails under 4.3.11 but worked on earlier versions any fix?
&lt;br&gt;
&lt;br&gt;1223. system(&amp;quot;crontab crontabs/crontabs.txt&amp;quot;); fails under 4.3.11 but worked on earlier versions any fix?
&lt;br&gt;
&lt;br&gt;1224. How to read from a .txt file on the client?
&lt;br&gt;
&lt;br&gt;1225. I installed PHP, but output doesn&amp;#39;t show on webpage - tried other commands 2. What should I do?
&lt;br&gt;
&lt;br&gt;1226. I installed PHP, but output doesn&amp;#39;t show on webpage - tried other commands 2. What should I do?
&lt;br&gt;
&lt;br&gt;1227. While extension is ok, it says it can&amp;#39;t find the module php_mysql.dll while it really exists
&lt;br&gt;
&lt;br&gt;1228. While extension is ok, it says it can&amp;#39;t find the module php_mysql.dll while it really exists
&lt;br&gt;
&lt;br&gt;1229. how would I have info sent from html form to a web page in numeric order..such as in area code
&lt;br&gt;
&lt;br&gt;1230. how would I have info sent from html form to a web page in numeric order..such as in area code
&lt;br&gt;
&lt;br&gt;1231. how would I have info sent from html form to a web page in numeric order..such as in area code
&lt;br&gt;
&lt;br&gt;1232. How are PHP, PWS and MySQL intergrated?
&lt;br&gt;
&lt;br&gt;1233. I am having an extremely hard time sending a html form email. No format seems to work. please help
&lt;br&gt;
&lt;br&gt;1234. How to prevent the system() command from dumping output to browser
&lt;br&gt;
&lt;br&gt;1235. how can I use php to place a query on another site, then parse results into my results page?
&lt;br&gt;
&lt;br&gt;1236. Inserting more than one records in a table using the same form
&lt;br&gt;
&lt;br&gt;1237. Is there a way to grab a single frame from a video file using php?
&lt;br&gt;
&lt;br&gt;1238. I have windowsxp, apache, php, mysql, how do I host people, and limit filesystem access?
&lt;br&gt;
&lt;br&gt;1239. How can I build 10 rows-each to have 1 dynamic select menu (part #) which prints related desc.?
&lt;br&gt;
&lt;br&gt;1240. i want to print out database results using php..if someone know, pls help me..
&lt;br&gt;
&lt;br&gt;1241. What do you think about developing PHP-Based desktop application with gambArt? (www.klorofil.org)
&lt;br&gt;
&lt;br&gt;1242. My php site runs slow on iis6.0. How to make it run faster?
&lt;br&gt;
&lt;br&gt;1243. Where do I find a usegroup or forum avaiable to help me with a specific PHP problem ??
&lt;br&gt;
&lt;br&gt;1244. How do I connect and search through multiple MySQL databases for info and then display it?
&lt;br&gt;
&lt;br&gt;1245. How do I write the HTML TITLE tag to contain the result of an SQL query ?
&lt;br&gt;
&lt;br&gt;1246. is there any project in related to video conferencing in PHP for open source ?
&lt;br&gt;
&lt;br&gt;1247. using mail( ) function with error checking but robots are submitting blank emails.
&lt;br&gt;
&lt;br&gt;1248. How can I convert PHP into executable code to prevent change by user with Windows platform?
&lt;br&gt;
&lt;br&gt;1249. How can i increase the amount of time php, apache, mssql wait to execute a very large query?
&lt;br&gt;
&lt;br&gt;1250. I have a problem in uploading the files across the network it dies saying&amp;quot;Page Cannot be Displayed&amp;quot;?
&lt;br&gt;
&lt;br&gt;1251. is there any jar equivalent of java in PHP??
&lt;br&gt;
&lt;br&gt;1252. How we open multilple connection with different username, password &amp;amp; different database
&lt;br&gt;
&lt;br&gt;1253. is it possible to track down all php included/required files.. on a lower level php core, C/C++ api?
&lt;br&gt;
&lt;br&gt;1254. is it possible to track down all php included/required files.. on a lower level php core, C/C++ api?
&lt;br&gt;
&lt;br&gt;1255. Apache2,PHP5,WinXP. All php pages show about 1/2 the page when loaded over net, but fully over LAN.
&lt;br&gt;
&lt;br&gt;1256. Emails not displaying as HTML
&lt;br&gt;
&lt;br&gt;1257. I currently using the php installation kits,may i know how to upgrade php 4.2.3 to php 4.3.10 or 4.4
&lt;br&gt;
&lt;br&gt;1258. How do you add actions in php files? Say if I have a horoscope section, but I only want one page...
&lt;br&gt;
&lt;br&gt;1259. How do you insert multiple values using the same insert statement, especially using hash password
&lt;br&gt;
&lt;br&gt;1260. How can I set a SESSION &lt;after&gt; i click a link
&lt;br&gt;
&lt;br&gt;1261. have php got function for static such as mean,sd , kurtosis, skewness , etc.
&lt;br&gt;
&lt;br&gt;1262. How do I tell php to link two tables in a query so it will return linked data from both tables
&lt;br&gt;
&lt;br&gt;1263. How can increment my hour to get my local(Singapore) date &amp;amp; time which currently now is USA time ?
&lt;br&gt;
&lt;br&gt;1264. Can any body tell me how to get exact world time when i pass city id or state id as an argument?
&lt;br&gt;
&lt;br&gt;1265. How can I make PHP process directives within HTML code that resides in a variable?
&lt;br&gt;
&lt;br&gt;1266. i uploaded my php page up to the free host but it did not worked help me please
&lt;br&gt;
&lt;br&gt;1267. i have got free space and i want to publish my php page ..help me please
&lt;br&gt;
&lt;br&gt;1268. How to access an object reference and its variables present in a Javascript file in a PHP file ?
&lt;br&gt;
&lt;br&gt;1269. When running command line, php loads GD, yet when apache interprets a php file, GD not loaded...why?
&lt;br&gt;
&lt;br&gt;1270. Is it possible to use lineair lists with objects in PHP and how.
&lt;br&gt;
&lt;br&gt;1271. Does PHP support MSSQL linked servers queries? If so, is there any special way of doing this?
&lt;br&gt;
&lt;br&gt;1272. How can I use Global Variables? So they can be accessed between two or more php files?
&lt;br&gt;
&lt;br&gt;1273. Can you upload a file using visual basic to a php page
&lt;br&gt;
&lt;br&gt;1274. Translating the contents of a PHP file in greek and then save as php,it does show ??? .How to solve?
&lt;br&gt;
&lt;br&gt;1275. How can I call a program(for example C:\Program\DC++\DCPlusPlus.exe) with php?
&lt;br&gt;
&lt;br&gt;1276. How can I access Apache mod_status variables in php? E.g. number of children serving requests.
&lt;br&gt;
&lt;br&gt;1277. what does var=&lt;?=$php_var?&gt; mean
&lt;br&gt;
&lt;br&gt;1278. Why is $mydate = date(&amp;#39;Y-m-d H:i:s&amp;#39;, strtotime($item[&amp;#39;pubdate&amp;#39;])); returning wrong date in PHP5
&lt;br&gt;
&lt;br&gt;1279. How do I call a COM DLL written in VC 6.0 from PHP 4? Can you provide an example?
&lt;br&gt;
&lt;br&gt;1280. how to execute a .pl program from php
&lt;br&gt;
&lt;br&gt;1281. como insertar controles a una celda en ejecucion
&lt;br&gt;
&lt;br&gt;1282. how can i direct the output of a system command in php into a MySql Database in a php script?
&lt;br&gt;
&lt;br&gt;1283. How can you compare a number of strings retrieved as a result of an SQL query?
&lt;br&gt;
&lt;br&gt;1284. it would be helpful if someone knew how to redirect the output from php exec() commands to databases
&lt;br&gt;
&lt;br&gt;1285. When using echo, why is there a distinction between a single quote and double quote?
&lt;br&gt;
&lt;br&gt;1286. When I use echo &amp;amp; single quotes to output \n char, it outputs the chars, instead of a newline. Why?
&lt;br&gt;
&lt;br&gt;1287. I want to get a value of variable in one php file to other php file(only the value of variable)
&lt;br&gt;
&lt;br&gt;1288. Can I open, show, an existing PDF document being passed to a php page?
&lt;br&gt;
&lt;br&gt;1289. How can I get PHP to retrieve XML datatype as an XML file from MSSQL 2005
&lt;br&gt;
&lt;br&gt;1290. How can I find out who is logged onto a particular machine and customize appropriately?
&lt;br&gt;
&lt;br&gt;1291. How do I call an HTML page into another frame from within my PHP code, without reloading the caller?
&lt;br&gt;
&lt;br&gt;1292. how to connect to oracle with odbc and aslo code to get result from view table in oracle
&lt;br&gt;
&lt;br&gt;1293. how to connect to oracle with odbc and aslo code to get result from view table in oracle
&lt;br&gt;
&lt;br&gt;1294. My php V4.4.2 run as CGI mode on windows server 2003 and i got The specified CGI application
&lt;br&gt;
&lt;br&gt;1295. How can I get line breaks while passing data separated by enter key from forms elements
&lt;br&gt;
&lt;br&gt;1296. test if a checkbox is checked with html and php
&lt;br&gt;
&lt;br&gt;1297. IIS. PHPScripts which grab files on win2k svr get &amp;quot;Permission Denied&amp;quot; with IntAuth. Basic works.Why?
&lt;br&gt;
&lt;br&gt;1298. how can i save the swf files while use onclick property&gt;
&lt;br&gt;
&lt;br&gt;1299. how can i save the swf files while use onclick property&gt;
&lt;br&gt;
&lt;br&gt;1300. How can i display all the rows of the particular table in the browser
&lt;br&gt;
&lt;br&gt;1301. I want to upload CSV through PHP script and want capibility to match the colums of tables and DB bef
&lt;br&gt;
&lt;br&gt;1302. can event handling can be done via PHP
&lt;br&gt;
&lt;br&gt;1303. how check half-byte,single-byte or double byte japanese characters
&lt;br&gt;
&lt;br&gt;1304. this: financiÃ«le rightly en/decoded to financieËle. many words with these characters are wrong
&lt;br&gt;
&lt;br&gt;1305. How can I enable browser cache when using session?
&lt;br&gt;
&lt;br&gt;1306. can we use crystal report for report generation in my php application and how?
&lt;br&gt;
&lt;br&gt;1307. http://www.freelancebusinessman.com/info.php I need someone to explain all this
&lt;br&gt;
&lt;br&gt;1308. in the user_wellcome.inacktive.tpl is a tag:{WELCOME_MSG} where find i these text, to change this?
&lt;br&gt;
&lt;br&gt;1309. can you require() a string variable, as if the content of this variable is saved to a file?
&lt;br&gt;
&lt;br&gt;1310. what does this mean Parse error: parse error, unexpected T_VARIABLE in /home/clanfuzi/public_html/th
&lt;br&gt;
&lt;br&gt;1311. Can I make an executable binary (elf) file from a php code?
&lt;br&gt;
&lt;br&gt;1312. through php programming how can i down load a file
&lt;br&gt;
&lt;br&gt;1313. Can a class determine if it&amp;#39;s (public) variables have been changed, and react? If so, how?
&lt;br&gt;
&lt;br&gt;1314. How do I paginate a search result given as a multi-dimensional array?
&lt;br&gt;
&lt;br&gt;1315. I m getting error pl. check that oracle_home is set &amp;amp; points to the right directory in my script.
&lt;br&gt;
&lt;br&gt;1316. How to create form with file attachement using php and action email to me?
&lt;br&gt;
&lt;br&gt;1317. How to create form with file attachement using php and action email to me?
&lt;br&gt;
&lt;br&gt;1318. how to fix a problem with $_POST ?
&lt;br&gt;
&lt;br&gt;1319. Is there a php command to query a host (dom.com) to determine .asp, php or .aspnet. Variable upload
&lt;br&gt;
&lt;br&gt;1320. I need to create continuous login so after login user can access multiple pages
&lt;br&gt;
&lt;br&gt;1321. What is the easiest way to transfer a file through PHP?
&lt;br&gt;
&lt;br&gt;1322. How to transfer a file through php using soap?
&lt;br&gt;
&lt;br&gt;1323. how do I prevent an email address being stripped by spam spiders
&lt;br&gt;
&lt;br&gt;1324. What is the syntax for the if/then construct that contains : and ?
&lt;br&gt;
&lt;br&gt;1325. how to create a directory in dreamweaver using php?
&lt;br&gt;
&lt;br&gt;1326. How do I connect to an other server using NTLM?
&lt;br&gt;
&lt;br&gt;1327. How can i store an extended ascii character in a variable?
&lt;br&gt;
&lt;br&gt;1328. # how can I use php to place a query on another site, then parse results into my results page?
&lt;br&gt;
&lt;br&gt;1329. how can i search for a querystring on a different page using php?
&lt;br&gt;
&lt;br&gt;1330. where do i put &amp;quot;-with-mysql=c:\mysql&amp;quot; for php. in the ini file? if so, where?
&lt;br&gt;
&lt;br&gt;1331. I need help to install php on Apache 2.2?
&lt;br&gt;
&lt;br&gt;1332. Passing parameters to a function from a link
&lt;br&gt;
&lt;br&gt;1333. How to do Advanced messaging to mobile phones?
&lt;br&gt;
&lt;br&gt;1334. How to use echo date(&amp;quot;l dS of F Y h:i:s A&amp;quot;); to display a 14 digit timestamp field $r[&amp;#39;dstamp&amp;#39;]?
&lt;br&gt;
&lt;br&gt;1335. Is function having similar functionality related to mysql_insert_id in oci?
&lt;br&gt;
&lt;br&gt;1336. Can a data structure be dumped straight to disk in binary format (ie. without using serialize)
&lt;br&gt;
&lt;br&gt;1337. Problem with persistent connection and oracle sessions
&lt;br&gt;
&lt;br&gt;1338. what are the whole process of using upload functiolity when dealing with files in windows
&lt;br&gt;
&lt;br&gt;1339. Anybody know how to implement a captcha picture in a php form
&lt;br&gt;
&lt;br&gt;1340. Want to make zip file at serverside for backup,but facing memory limit problem (set at serverside)
&lt;br&gt;
&lt;br&gt;1341. How to specify query string from the command line php (CLI) ?
&lt;br&gt;
&lt;br&gt;1342. All of my PHP files show as picture files. How can I change that and what file association should I
&lt;br&gt;
&lt;br&gt;1343. multiple commands in an if statement
&lt;br&gt;
&lt;br&gt;1344. how can plugin a RSSFeed into my php code
&lt;br&gt;
&lt;br&gt;1345. how can plugin a RSSFeeder (ie Reading for RSS contents) into my php code
&lt;br&gt;
&lt;br&gt;1346. how to auto generate or auto update a record in php
&lt;br&gt;
&lt;br&gt;1347. how to display data from database in table form at pdf format using php
&lt;br&gt;
&lt;br&gt;1348. Use mysql database or opendir php function to display images in folder which is better?
&lt;br&gt;
&lt;br&gt;1349. My server states that I need to run PHP 5.0.0 or higher, how do i update PHP on the hosting server?
&lt;br&gt;
&lt;br&gt;1350. what is GD is it support image functions in php?
&lt;br&gt;
&lt;br&gt;1351. How to use the SSL context options capture_peer_cert and capture_peer_cert_chain?
&lt;br&gt;
&lt;br&gt;1352. How do i insert streaming media into my php-nuke©
&lt;br&gt;
&lt;br&gt;1353. Is it possible to display a videos file attributes through Php?
&lt;br&gt;
&lt;br&gt;1354. will PHP 4 works with mySQL 5 and apache on AIX 4.3?
&lt;br&gt;
&lt;br&gt;1355. how do i create a php script that i can install onto my webspace to give me the Base directory
&lt;br&gt;
&lt;br&gt;1356. how can i call c extension dll from php script . i want to run it on apache 2.Warning: dl() [functio
&lt;br&gt;
&lt;br&gt;1357. On web site text for Spanish is coming out wrong, ie. ba&amp;#258;&amp;#261;os should be baños http://71.18.137.151/
&lt;br&gt;
&lt;br&gt;1358. Why is server downloading index.php instad of displaying it?
&lt;br&gt;
&lt;br&gt;1359. How can you run a function by clicking on a graphic?
&lt;br&gt;
&lt;br&gt;1360. Can anyone tell me what is this &amp;quot;-&gt;&amp;quot; symbol? i see it so many times.
&lt;br&gt;
&lt;br&gt;1361. How would I merge two felds and show a quantity after the element
&lt;br&gt;
&lt;br&gt;1362. Is it possible to use PHP to convert Word Documents to HTML and output the result?
&lt;br&gt;
&lt;br&gt;1363. How can I echo the request body at the server in a php script, which came with post method.
&lt;br&gt;
&lt;br&gt;1364. how do i avoid the opening of an intermediate page without the authentication? can i use sessions?
&lt;br&gt;
&lt;br&gt;1365. [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. Fix???
&lt;br&gt;
&lt;br&gt;1366. How do I capture the AD login name in my script for authentication
&lt;br&gt;
&lt;br&gt;1367. registration to a lan party: name&amp;amp; nick in site -from where? come with adult? bring your pc?
&lt;br&gt;
&lt;br&gt;1368. How to link webcam to php script? Library file need to install? Statement to show the interface
&lt;br&gt;
&lt;br&gt;1369. Are there any browser settings that could affect session variables?
&lt;br&gt;
&lt;br&gt;1370. Why am I getting &amp;quot;111 Connection Refused&amp;quot; when doing a PHP fsockopen() request to smpt-mx8.mac.com?
&lt;br&gt;
&lt;br&gt;1371. What system information can I get from php.(platform independent)
&lt;br&gt;
&lt;br&gt;1372. I want to put an URL link to CLICK HERE IN: echo &amp;quot;Click here&amp;quot;. HOW TO DO?
&lt;br&gt;
&lt;br&gt;1373. how to make a popup window that have form inside and will close it after the form submit?
&lt;br&gt;
&lt;br&gt;1374. how to delete record when we tick it checkbox?
&lt;br&gt;
&lt;br&gt;1375. Why can&amp;#39;t a website be opened from an array?
&lt;br&gt;
&lt;br&gt;1376. Is there an equivalent in php for ASP&amp;#39;s &amp;quot;session_on_start&amp;quot; and &amp;quot;session_on_end&amp;quot; events?
&lt;br&gt;
&lt;br&gt;1377. CURLOPT_RETURNTRANSFER
&lt;br&gt;
&lt;br&gt;1378. I wrote a simple servet TCP.... I used telnet ip port to connect it... but socket_read doesn&amp;#39;t work
&lt;br&gt;
&lt;br&gt;1379. even we are having different web scripting.how it is has become popular
&lt;br&gt;
&lt;br&gt;1380. HOW CAN I VIEW PHP FILES ON MY WINDOWS XP COMPUTER
&lt;br&gt;
&lt;br&gt;1381. What function should I use to fill an array with file names from a directory?
&lt;br&gt;
&lt;br&gt;1382. refresh button it adds another quantit
&lt;br&gt;
&lt;br&gt;1383. basename issues - need to echo query url as well - index.php?id=3 etc
&lt;br&gt;
&lt;br&gt;1384. how do I find the mod_php.conf file for Novell Netware 6.5
&lt;br&gt;
&lt;br&gt;1385. what text goes into the mod_php.conf file to make it work
&lt;br&gt;
&lt;br&gt;1386. what are the differences between pecl and pear?
&lt;br&gt;
&lt;br&gt;1387. Having to use &lt;?php instead of just &lt;? how can i just use &lt;? ?
&lt;br&gt;
&lt;br&gt;1388. Can I use a function instead of a separate file(php) to return an Image blob to an HTML &lt;img&gt; tag?
&lt;br&gt;
&lt;br&gt;1389. how do i get part after # sign of url, like http://example.com/page.php?var1=xxx&amp;amp;var2=yyy#abcd.
&lt;br&gt;
&lt;br&gt;1390. what is the full form of php and how we&amp;#39;ll use it for web pages.
&lt;br&gt;
&lt;br&gt;1391. what is the full form of php and how we&amp;#39;ll use it for web pages.
&lt;br&gt;
&lt;br&gt;1392. how can i validate an xml document vs an xdr schema using domxml?
&lt;br&gt;
&lt;br&gt;1393. How do I configure Oracle HTTP Server (Apache) for PHP? Example?
&lt;br&gt;
&lt;br&gt;1394. How do you go about setting univeral variables? Example: != &amp;quot;(U*)&amp;quot; where * could be anything.
&lt;br&gt;
&lt;br&gt;1395. how we can parse HTML files from another site and extract information to store it
&lt;br&gt;
&lt;br&gt;1396. Can i call a PHP script which sits below public_html with another PHP script from within public_html
&lt;br&gt;
&lt;br&gt;1397. Can i call a PHP script which sits below public_html with another PHP script from within public_html
&lt;br&gt;
&lt;br&gt;1398. How to transform the long raw field of a oracle table to a jpg type? I have photo stored in it.
&lt;br&gt;
&lt;br&gt;1399. Get this error...does anyone have any ideas [Thu Nov 23 21:59:21 2006] [error] PHP Warning: require
&lt;br&gt;
&lt;br&gt;1400. what is the speacial features in PHP compare to other languages?
&lt;br&gt;
&lt;br&gt;1401. I need to delete a tag and all child tags from an XML file using PHP. How do I go about ?
&lt;br&gt;
&lt;br&gt;1402. Was Bug #37483 ever resolved?
&lt;br&gt;
&lt;br&gt;1403. How can i make a script in PHP to automatically send an email to a user who has just registered?
&lt;br&gt;
&lt;br&gt;1404. eval( ) function error, template error how can i solve this error
&lt;br&gt;
&lt;br&gt;1405. GD library - is TGA file format supported? If not, is there a library that does support?
&lt;br&gt;
&lt;br&gt;1406. how i can i install ffmpeg on windows
&lt;br&gt;
&lt;br&gt;1407. parse error, unexpected $end in \Apache Group\Apache2\htdocs\ScopeDemo.php on line 35
&lt;br&gt;
&lt;br&gt;1408. How can I hide the name of a file when passing a session?
&lt;br&gt;
&lt;br&gt;1409. Why do I see the content of the compiled script instead of the script executing, IIS 5.1?
&lt;br&gt;
&lt;br&gt;1410. Why do I see the content of the compiled script instead of the script executing, IIS 5.1?
&lt;br&gt;
&lt;br&gt;1411. Was Bug #37483 ever resolved? If so, what is the fix?
&lt;br&gt;
&lt;br&gt;1412. how to install horde in user directory another then the web server root directory?
&lt;br&gt;
&lt;br&gt;1413. Please recommend websites for PHP Freelancing. Thanks in advance.
&lt;br&gt;
&lt;br&gt;1414. How can I extract xml information from a email folder, then display it onto a web page using php? ch
&lt;br&gt;
&lt;br&gt;1415. I want to install my app in another server, but don&amp;#39;t want to leave de source code there, what 2 do?
&lt;br&gt;
&lt;br&gt;1416. What are all the changes between PHP 4.4 and 5.1?
&lt;br&gt;
&lt;br&gt;1417. How to use PHP to strip out character \ from the data entered by user from web form?
&lt;br&gt;
&lt;br&gt;1418. when submit textarea value with quotes are replaced with \&amp;#39; how to change it?
&lt;br&gt;
&lt;br&gt;1419. utf-8 cvs files download
&lt;br&gt;
&lt;br&gt;1420. How do i convert htmlentities to Hex Entities like &amp;#x20AC; (euro sign) instead of &amp;euro; ?
&lt;br&gt;
&lt;br&gt;1421. how can i run a php script with closing the browser?
&lt;br&gt;
&lt;br&gt;1422. how to insert images in ms access using oledb extension
&lt;br&gt;
&lt;br&gt;1423. i want the php program logic for decimal to hexadecimal conversion
&lt;br&gt;
&lt;br&gt;1424. i want the php program logic for decimal to hexadecimal conversion
&lt;br&gt;
&lt;br&gt;1425. Server Upgrade: I am going to be upgrading my Win2k Server to Win2k3..anything to watch out for?
&lt;br&gt;
&lt;br&gt;1426. to send email from local system connected via broadband to yahoo accounts
&lt;br&gt;
&lt;br&gt;1427. &lt;a HREF=&amp;quot;http://www.aldeadelcafe.com&amp;quot;&gt; WWW.ALDEADELCAFE.COM&lt;/A&gt;
&lt;br&gt;
&lt;br&gt;1428. Is anyone else having issues getting PHP 5.2.0 and Apache 2.2.3 to work together?
&lt;br&gt;
&lt;br&gt;1429. how can we show records at the time of delete confirmation while using delete button
&lt;br&gt;
&lt;br&gt;1430. How do get the currently running webserver&amp;#39;s information using php?
&lt;br&gt;
&lt;br&gt;1431. Why is it that PHP does not allow the the first character of a label (variable name) to be a digit?
&lt;br&gt;
&lt;br&gt;1432. how do i compare 2 string variables in php 4.3.10?
&lt;br&gt;
&lt;br&gt;1433. what is the script for conducting a chat room with enabled privacy between users?
&lt;br&gt;
&lt;br&gt;1434. Does anyone know how to set up a php server on a windows vista platform?
&lt;br&gt;
&lt;br&gt;1435. Does anyone know how to set up php in ISS for windows vista?
&lt;br&gt;
&lt;br&gt;1436. In linux system what is the specific entry for session? I have problem in incrementing Session var?
&lt;br&gt;
&lt;br&gt;1437. i setup root admin as administrator and i cant get root admin back
&lt;br&gt;
&lt;br&gt;1438. I setup php5 and IIS on xp it running but does not give me any error message give blank page
&lt;br&gt;
&lt;br&gt;1439. how to modify the order of precedence in an expression
&lt;br&gt;
&lt;br&gt;1440. is there any think like sstab control in vb for php
&lt;br&gt;
&lt;br&gt;1441. i m new to php. how to connect oracle d/b with php?? plzz help m stuck
&lt;br&gt;
&lt;br&gt;1442. whn i m send a data frm one page to othr by &amp;quot;get&amp;quot; method.data coming in url with a blank pg.. help
&lt;br&gt;
&lt;br&gt;1443. what is this Warning: mail() [function.mail]: SMTP server response: 550 5.7.1 Unable to relay for ?
&lt;br&gt;
&lt;br&gt;1444. statement &amp;#39;switch&amp;#39; for multiple include.are they(all include file write down) load all?
&lt;br&gt;
&lt;br&gt;1445. when using the system() command how do you make it able to use CTRL key combinations
&lt;br&gt;
&lt;br&gt;1446. high session data
&lt;br&gt;
&lt;br&gt;1447. session
&lt;br&gt;
&lt;br&gt;1448. Can I login to another site from my project without entering Username &amp;amp; password. Is there any way t
&lt;br&gt;
&lt;br&gt;1449. I have a script that checks the server up time, However it only show text , How can i show a .gif ?
&lt;br&gt;
&lt;br&gt;1450. How do I upload, resized and strore a picture with the new reduced size in a databse?
&lt;br&gt;
&lt;br&gt;1451. how can i set url like www.yoursite.com/member to view details of member from db
&lt;br&gt;
&lt;br&gt;1452. When my form is submitted successfully I want to redirect users to a &amp;#39;thank-you&amp;#39; page. All in PHP.
&lt;br&gt;
&lt;br&gt;1453. Output browser contents that are displayed as text from a url to txt file, How ?
&lt;br&gt;
&lt;br&gt;1454. If I fork a child how do I pass information back to an array I have defined in the parent?
&lt;br&gt;
&lt;br&gt;1455. How Can I Use Light Pen In PHP for example for signature?
&lt;br&gt;
&lt;br&gt;1456. The session_start is not working in PHP 5.2.1.
&lt;br&gt;
&lt;br&gt;1457. PHP CONNECT TO ODBC (DB2 ON AS400) TRUNCATE WORDS WITH ACCENT, HOW CAN I FIX THIS???????
&lt;br&gt;
&lt;br&gt;1458. How can I extract the width and height of a .flv file using PHP?
&lt;br&gt;
&lt;br&gt;1459. How can a web server have its own php.ini on each domain?
&lt;br&gt;
&lt;br&gt;1460. Can &amp;quot;elseif&amp;quot; statements be applied to dynamic text fields?
&lt;br&gt;
&lt;br&gt;1461. i want my users to have a personal photo gallery and browse other user, how do i do that ?
&lt;br&gt;
&lt;br&gt;1462. how do i create a user page so that they can upload photos and let people browse them ?? HELP PLEASE
&lt;br&gt;
&lt;br&gt;1463. when upload runs gave file not specify error
&lt;br&gt;
&lt;br&gt;1464. How to consume web services through SOAP or NUSOAP protocal?
&lt;br&gt;
&lt;br&gt;1465. --enable-debug
&lt;br&gt;
&lt;br&gt;1466. MSDE
&lt;br&gt;
&lt;br&gt;1467. I have problem with header coding for IE browser. My code is export the data to excel.
&lt;br&gt;
&lt;br&gt;1468. failing to create COM object in windows2003 server
&lt;br&gt;
&lt;br&gt;1469. retrive data to publish particular information using session id
&lt;br&gt;
&lt;br&gt;1470. if i click a radio button it should insert teh values of the fields in the from in a table
&lt;br&gt;
&lt;br&gt;1471. What is the difference between echo &amp;amp; print?
&lt;br&gt;
&lt;br&gt;1472. Why don&amp;#39;t I use htmlentities funtion? .
&lt;br&gt;
&lt;br&gt;1473. how to increase session expiry in php through htaccess or iniset
&lt;br&gt;
&lt;br&gt;1474. ii7 install
&lt;br&gt;
&lt;br&gt;1475. install php vista iis7
&lt;br&gt;
&lt;br&gt;1476. how to implement validator field in php like asp.net
&lt;br&gt;
&lt;br&gt;1477. I&amp;#39;m using PHP5.0.5 on Novell. I&amp;#39;m getting a &amp;quot;Call to undefined function simplexml_load_file()&amp;quot;.
&lt;br&gt;
&lt;br&gt;1478. What is major diffrence between php4 and php5?
&lt;br&gt;
&lt;br&gt;1479. How to store the Search results of a search Engine?
&lt;br&gt;
&lt;br&gt;1480. browser window size
&lt;br&gt;
&lt;br&gt;1481. Is there a method in php for data streaming of large documents in chunks in a php web service
&lt;br&gt;
&lt;br&gt;1482. how can i restrict the user to upload a specific extension files and the size of their upload?
&lt;br&gt;
&lt;br&gt;1483. How does one export BLOG type data from MySQL to display as images in excel?
&lt;br&gt;
&lt;br&gt;1484. Do you know any (really) working example of a soap (wsdl based) server implementation with PHP5 ?
&lt;br&gt;
&lt;br&gt;1485. How we can make a printscreen(image) from a web page?Please suggest.
&lt;br&gt;
&lt;br&gt;1486. how can i call txt files (with http links and titles) from php, so I can change this file often.
&lt;br&gt;
&lt;br&gt;1487. how to divide the PHP concepts; which are most valuable?
&lt;br&gt;
&lt;br&gt;1488. how to divide the PHP concepts; which are most valuable?
&lt;br&gt;
&lt;br&gt;1489. how to pass php array into javascript for validation??
&lt;br&gt;
&lt;br&gt;1490. ffmpeg with php not working using IIS/6.0 server in windows NT system.
&lt;br&gt;
&lt;br&gt;1491. how do i send mail through the mail function of php in zend, each and every try i had was fail
&lt;br&gt;
&lt;br&gt;1492. How I can give access to my friend to some page for limit time? I store the date in database
&lt;br&gt;
&lt;br&gt;1493. How do I execute code that includes two classes with the same name from different libraries?
&lt;br&gt;
&lt;br&gt;1494. upload files
&lt;br&gt;
&lt;br&gt;1495. How do i put a checkbox for usernames retrieved from the database and to display in the next page?
&lt;br&gt;
&lt;br&gt;1496. How to write an array result to a comma separated txt file?
&lt;br&gt;
&lt;br&gt;1497. how to store the form data in the database after submitting the form ,by using PHP5.2, MSACCESS,IIS
&lt;br&gt;
&lt;br&gt;1498. how to change name of file\path
&lt;br&gt;
&lt;br&gt;1499. call a oracle procedure with PHP
&lt;br&gt;
&lt;br&gt;1500. How do I build PHP scripts and include it in a nightly build process
&lt;br&gt;
&lt;br&gt;1501. What is difference between the copy and move_uploaded_file
&lt;br&gt;
&lt;br&gt;1502. Website I&amp;#39;ve taken over has files ending in &amp;quot;.phtml&amp;quot;
&lt;br&gt;
&lt;br&gt;1503. Can I write a PHP script to load random external images?
&lt;br&gt;
&lt;br&gt;1504. how to integrate more than one URL in IE
&lt;br&gt;
&lt;br&gt;1505. How can I implement a php wrapper which checks if a user is logged in and secures my html files?
&lt;br&gt;
&lt;br&gt;1506. how to print data from database pressing print button on the page?
&lt;br&gt;
&lt;br&gt;1507. I have a form that makes a file, &amp;#39;output.txt&amp;#39;. how do I have following submissons add onto file
&lt;br&gt;
&lt;br&gt;1508. Netscape &amp;amp; mozilla i am unable to open a pdf it shows an alert &amp;quot;This operation is not allowed&amp;quot;
&lt;br&gt;
&lt;br&gt;1509. how to link an exe file to a web page using php?urgent plz help......
&lt;br&gt;
&lt;br&gt;1510. I ran the code provided on this site to get the IP address but received unknown variable.
&lt;br&gt;
&lt;br&gt;1511. how to create a link for a data as pdf
&lt;br&gt;
&lt;br&gt;1512. Rotating Banner Ads Guidance Requested
&lt;br&gt;
&lt;br&gt;1513. how to display live value or get it from another website (eg live share market)?
&lt;div dir=&amp;quot;ltr&amp;quot; style=&amp;quot;text-align: left;&amp;quot; trbidi=&amp;quot;on&amp;quot;&gt;
&lt;strong&gt;&lt;strong&gt;&lt;strong&gt;&lt;span style=&amp;quot;color: #3333ff;&amp;quot;&gt;1. What are the differences between Get and post methods in form submitting, give the case where we can use get and we can use post methods?&lt;br /&gt;2. Who is the father of PHP and explain the changes in PHP versions?&lt;br /&gt;3. How can we submit a form without a submit button?&lt;br /&gt;4. In how many ways we can retrieve the date in the result set of mysql using PHP?&lt;br /&gt;5. What is the difference between mysql_fetch_object and mysql_fetch_array?&lt;br /&gt;6. What is the difference between $message and $$message?&lt;br /&gt;7. How can we extract string ‘theWalkin.com ‘ from a string ‘http://www.TheWalkin.com’ using regular expression of PHP?&lt;br /&gt;8. How can we create a database using PHP and mysql?&lt;br /&gt;9. What are the differences between require and include, include_once?&lt;br /&gt;10. Can we use include (”TheWalkin.php”) two times in a PHP page “makeit.PHP”?&lt;br /&gt;11. What are the different tables present in mysql, which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10)) ?&lt;br /&gt;12. Functions in IMAP, POP3 AND LDAP?&lt;br /&gt;13. How can I execute a PHP script using command line?&lt;br /&gt;14. Suppose your Zend engine supports the mode Then how can u configure your PHP Zend engine to support mode ?&lt;br /&gt;15. Shopping cart online validation i.e. how can we configure Paypal, etc.?&lt;br /&gt;16. What is meant by nl2br()?&lt;br /&gt;17. Draw the architecture of Zend engine?&lt;br /&gt;18. What are the current versions of apache, PHP, and mysql?&lt;br /&gt;19. What are the reasons for selecting lamp (linux, apache, mysql, PHP) instead of combination of other software programmes, servers and operating systems?&lt;br /&gt;20. How can we encrypt and decrypt a data present in a mysql table using mysql?&lt;br /&gt;21. How can we encrypt the username and password using PHP?&lt;br /&gt;22. What are the features and advantages of object-oriented programming?&lt;br /&gt;23. What are the differences between procedure-oriented languages and object-oriented languages?&lt;br /&gt;24. What is the use of friend function?&lt;br /&gt;25. What are the differences between public, private, protected, static, transient, final and volatile?&lt;br /&gt;26. What are the different types of errors in PHP?&lt;br /&gt;27. What is the functionality of the function strstr and stristr?&lt;br /&gt;28. What are the differences between PHP 3 and PHP 4 and PHP 5?&lt;br /&gt;29. How can we convert asp pages to PHP pages?&lt;br /&gt;30. What is the functionality of the function htmlentities?&lt;br /&gt;31. How can we get second of the current time using date function?&lt;br /&gt;32. How can we convert the time zones using PHP?&lt;br /&gt;33. What is meant by urlencode and urldocode?&lt;br /&gt;34. What is the difference between the functions unlink and unset?&lt;br /&gt;35. How can we register the variables into a session?&lt;br /&gt;36. How can we get the properties (size, type, width, height) of an image using PHP image functions?&lt;br /&gt;37. How can we get the browser properties using PHP?&lt;br /&gt;38. What is the maximum size of a file that can be uploaded using PHP and how can we change this?&lt;br /&gt;39. How can we increase the execution time of a PHP script?&lt;br /&gt;40. How can we take a backup of a mysql table and how can we restore it. ?&lt;br /&gt;41. How can we optimize or increase the speed of a mysql select query?&lt;br /&gt;42. How many ways can we get the value of current session id?&lt;br /&gt;43. How can we destroy the session, how can we unset the variable of a session?&lt;br /&gt;44. How can we destroy the cookie?&lt;br /&gt;45. How many ways we can pass the variable through the navigation between the pages?&lt;br /&gt;46. What is the difference between ereg_replace() and eregi_replace()?&lt;br /&gt;47. What are the different functions in sorting an array?&lt;br /&gt;48. How can we know the count/number of elements of an array?&lt;br /&gt;49. What is the PHP predefined variable that tells the What types of images that PHP supports?&lt;br /&gt;50. How can I know that a variable is a number or not using a JavaScript?&lt;br /&gt;51. List out some tools through which we can draw E-R diagrams for mysql.&lt;br /&gt;52. How can I retrieve values from one database server and store them in other database server using PHP?&lt;br /&gt;53. List out the predefined classes in PHP?&lt;br /&gt;54. How can I make a script that can be bilanguage (supports English, German)?&lt;br /&gt;55. What are the difference between abstract class and interface?&lt;br /&gt;56. How can we send mail using JavaScript?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. How can we repair a MySQL table?&lt;br /&gt;2. What are the advantages of stored procedures, triggers, indexes?&lt;br /&gt;3. What is maximum size of a database in MySQL?&lt;br /&gt;4. Give the syntax of Grant and Revoke commands?&lt;br /&gt;5. Explain Normalization concept?&lt;br /&gt;6. What is the maximum length of a table name, database name, and fieldname in MySQL?&lt;br /&gt;7. How many ways we can we find the current date using MySQL?&lt;br /&gt;8. What are the advantages and disadvantages of Cascading Style Sheets?&lt;br /&gt;9. What type of inheritance that PHP supports?&lt;br /&gt;10. How can increase the performance of MySQL select query?&lt;br /&gt;11. How many values can the SET function of MySQL take?&lt;br /&gt;12. What are the other commands to know the structure of table using MySQL commands except explain command?&lt;br /&gt;13. How many tables will create when we create table, what are they?&lt;br /&gt;14. What is the purpose of the following files having extensions 1) .frm 2) .myd 3) .myi? What do these files contain?&lt;br /&gt;15. How can we find the number of rows in a table using MySQL?&lt;br /&gt;16. How can we find the number of rows in a result set using PHP?&lt;br /&gt;17. The structure of table view buyers is as follows:&lt;br /&gt;18. +----------------+-------------+------+-----+---------+----------------+&lt;br /&gt;19.  Field  Type  Null  Key  Default  Extra &lt;br /&gt;20. +----------------+-------------+------+---–+---------+----------------+&lt;br /&gt;21.  user_pri_id  int(15)   PRI  NULL  auto_increment &lt;br /&gt;22.  userid  varchar(10)  YES   NULL  &lt;br /&gt;23. +----------------+-------------+------+---–+---------+----------------+&lt;br /&gt;the value of user_pri_id the last row 2345 then What will happen in the following conditions?&lt;br /&gt;Condition1: Delete all the rows and insert another row then. What is the starting value for this auto incremented field user_pri_id ,&lt;br /&gt;Condition2: Delete the last row(having the field value 2345) and insert another row then. What is the value for this auto incremented field user_pri_id&lt;br /&gt;24. What are the advantages/disadvantages of MySQL and PHP?&lt;br /&gt;25. What is the difference between GROUP BY and ORDER BY in Sql?&lt;br /&gt;26. What is the difference between char and varchar data types?&lt;br /&gt;27. What is the functionality of md5 function in PHP?&lt;br /&gt;28. When viewing an HTML page in a Browser, the Browser often keeps this page in its cache. What can be possible advantages/disadvantages of page caching? How can you prevent caching of a certain page (please give several alternate solutions)?&lt;br /&gt;29. What are the different methods of passing data or information between two calls of a web page? What are the advantages/disadvantages of these methods?&lt;br /&gt;30. An Apache web server is running on a Linux system. Suddenly, the web server delivers the pages very slow. How could you find out possible reasons for that (when using system commands, please specify their names)?&lt;br /&gt;31. What are the different ways to login to a remote server? Explain the means, advantages and disadvantages?&lt;br /&gt;&lt;br /&gt;33. How can I load data from a text file into a table?&lt;br /&gt;34. How can we know the number of days between two given dates using MySQL?&lt;br /&gt;35. How can we know the number of days between two given dates using PHP?&lt;br /&gt;36. How can we change the name of a column of a table?&lt;br /&gt;37. How can we change the name and data type of a column of a table?&lt;br /&gt;38. What are the differences between drop a table and truncate a table?&lt;br /&gt;39. When you want to show some part of a text displayed on an HTML page in red font color, what different possibilities are there to do this? What are the advantages/disadvantages of these methods?&lt;br /&gt;40. A select query over a large table runs very slow because of the growing number of entries in that table. What different measures could be taken to improve speed?&lt;br /&gt;41. A company wants to store their invoices in a database. They already have their customers and articles in that database. Both customer and article are each identified by an unique integer value. Please create the SQL statements for creating the necessary table(s) for storing the invoices in a MySQL database. An invoice should hold information like invoice number, customer, date, article(s) and quantity etc.&lt;br /&gt;42. For the database from the previous question, please give an SQL query which returns the invoice number of all invoices which contain the article with the number “1234″. The query should be able to run under a MySQL 4.0 database.&lt;br /&gt;43. How would you backup and restore a big MySQL database? What are the advantages of the approach which you have taken over the others?&lt;br /&gt;44. How can I find what type of images that the PHP version supports?&lt;br /&gt;45. The table tbl_sites contains the following data:&lt;br /&gt;46. -----------------------------------------------------&lt;br /&gt;47. Userid sitename country&lt;br /&gt;48. ------------------------------------------------------&lt;br /&gt;49. 1 Ilyas indian&lt;br /&gt;50. 2 thewalkin KarnaTaka&lt;br /&gt;51. 3 PHP.net usa&lt;br /&gt;52. 4 PHPtalk.com germany&lt;br /&gt;53. 5 MySQL.com usa&lt;br /&gt;54. 6 sureshbabu canada&lt;br /&gt;55. 7 PHPbuddy.com pakistan&lt;br /&gt;56. 8. PHPtalk.com austria&lt;br /&gt;57. 9. PHPfreaks.com sourthafrica&lt;br /&gt;58. 10. PHPsupport.net russia&lt;br /&gt;59. 11. sureshbabu australia&lt;br /&gt;60. 12. sureshbabu nepal&lt;br /&gt;61. 13. PHPtalk.com italy&lt;br /&gt;Write a select query that will displayed the duplicated site name and how many times it is duplicated? …&lt;br /&gt;62. Create a PHP web script with the following attributes: on start, three HTML form elements are shown: an string input field, a checkbox field, a dropdown/pull down list with 5 elements and a submit button. On submission, the form should be redisplayed (while remaining all options/inputs as the user has selected/entered them). Additionally, the selections/inputs of the user should be displayed in text. Please solve this without the use of any external libraries.&lt;br /&gt;63. What is MIME?&lt;br /&gt;64. What is PEAR in PHP?&lt;br /&gt;65. How can I use the COM components in PHP?&lt;br /&gt;66. How can I load the DLLs dynamically?&lt;br /&gt;67. How many ways we can give the output to a browser?&lt;br /&gt;68. How can we know that a session is started or not?&lt;br /&gt;69. What is the default session time in PHP and how can I change it?&lt;br /&gt;70. What changes I have to done in PHP.ini file for file uploading?&lt;br /&gt;71. What are the differences between MySQL_fetch_array(), MySQL_fetch_object(), MySQL_fetch_row()?&lt;br /&gt;72. How can I set a cron and how can i execute it in Unix, Linux, and windows?&lt;br /&gt;73. Steps for the payment gateway processing?&lt;br /&gt;74. How many ways I can register the variables into session?&lt;br /&gt;75. Explain different types of errors in PHP (i.e. arguments in errorreporting function)?&lt;br /&gt;76. How many ways I can redirect a PHP page?&lt;br /&gt;77. List out different arguments in PHP header function?&lt;br /&gt;78. What type of headers have to add in the mail function in which file a attached?&lt;br /&gt;79. What is the difference between&lt;br /&gt;80. What are the differences between PHP3 and PHP4 versions?&lt;br /&gt;81. What are the differences between include() and include_once() functions?&lt;br /&gt;82. Describe the importance of DABA BASE ABSTRACTION LAYERS in PHP and database connection?&lt;br /&gt;83. Explain MySQL optimization?&lt;br /&gt;84. What is the difference between using copy() and move() function in PHP file uploading?&lt;br /&gt;85. What is the difference between Reply-to and Return-path in the headers of a mail function?&lt;br /&gt;86. Explain about Type Juggling in PHP?&lt;br /&gt;87. How can I get the only name of the current executing file?&lt;br /&gt;88. How can I embed a java programme in PHP file and what changes have to be done in PHP.ini file?&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;/script&gt;&lt;/object&gt;&lt;/object&gt;&lt;/body----&gt;&lt;/form&gt;
&lt;/a&gt;&lt;/variable&gt;&lt;/variable&gt;&lt;/cfhttp&gt;&lt;/pre&gt;
&lt;/div&gt;
</description><link>http://gurukanagaraj.blogspot.com/2008/06/php-questions.html</link><author>noreply@blogger.com (Kanagaraj)</author><thr:total>1</thr:total></item></channel></rss>