<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6005609095967398158</id><updated>2024-11-01T04:15:45.578-07:00</updated><title type='text'>Fast Technology</title><subtitle type='html'>fast technology: mean of the power - speed - reliability - and performance learning.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default?start-index=26&amp;max-results=25'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>35</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-2300658549928713943</id><published>2013-11-14T03:52:00.001-08:00</published><updated>2013-11-14T03:52:49.862-08:00</updated><title type='text'>Make money fast with sharecash</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;http://www.youtube.com/v/PRJ5TX6cf4Q?autohide=1&amp;amp;version=3&amp;amp;autoplay=1&amp;amp;attribution_tag=jN5_qqm2QAEsqMjj7aopjg&amp;amp;feature=share&amp;amp;autohide=1&amp;amp;showinfo=1&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/2300658549928713943/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2013/11/make-money-fast-with-sharecash.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2300658549928713943'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2300658549928713943'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2013/11/make-money-fast-with-sharecash.html' title='Make money fast with sharecash'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-6930378860209918260</id><published>2013-11-02T02:25:00.001-07:00</published><updated>2013-11-02T02:25:04.690-07:00</updated><title type='text'>How You Made $500,000+ In One Year (+playlist)</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;&lt;a href=&quot;http://www.youtube.com/v/9JO_A3ANiUY?version=3&amp;amp;list=UUxdcL3x3hy9YgLwMA-4xt0w&amp;amp;autohide=1&amp;amp;showinfo=1&amp;amp;feature=share&amp;amp;autoplay=1&amp;amp;attribution_tag=qkmWMIdaZnp93wTKBDVBjw&quot;&gt;http://www.youtube.com/v/9JO_A3ANiUY?version=3&amp;amp;list=UUxdcL3x3hy9YgLwMA-4xt0w&amp;amp;autohide=1&amp;amp;showinfo=1&amp;amp;feature=share&amp;amp;autoplay=1&amp;amp;attribution_tag=qkmWMIdaZnp93wTKBDVBjw&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/6930378860209918260/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2013/11/how-you-made-500000-in-one-year-playlist.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6930378860209918260'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6930378860209918260'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2013/11/how-you-made-500000-in-one-year-playlist.html' title='How You Made $500,000+ In One Year (+playlist)'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-1341510671275553478</id><published>2013-11-02T01:08:00.001-07:00</published><updated>2013-11-02T01:08:38.999-07:00</updated><title type='text'>how to blog and make money online</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;http://www.youtube.com/v/bqbn7jDq9fE?version=3&amp;amp;autohide=1&amp;amp;feature=share&amp;amp;autoplay=1&amp;amp;autohide=1&amp;amp;attribution_tag=VehVKg0NFlKWkF1xTuWsag&amp;amp;showinfo=1&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/1341510671275553478/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2013/11/how-to-blog-and-make-money-online.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/1341510671275553478'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/1341510671275553478'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2013/11/how-to-blog-and-make-money-online.html' title='how to blog and make money online'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-3597296827059850907</id><published>2012-07-14T00:49:00.000-07:00</published><updated>2012-07-14T00:49:34.965-07:00</updated><title type='text'>Different ways to refresh or reload page using jQuery</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
different ways using which you can reload or refresh the webpage using 
jQuery. The first method is nothing to do with jQuery. It is a HTML tag 
which you need to put in the head section of your page and your page 
will get refreshed automatically after specified interval.
&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;
&lt;br /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_640413&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;div class=&quot;lines&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;meta http-equiv=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;refresh&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;content=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;10&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
The meta tag with &quot;http-equiv&quot; is used to refresh the page. This 
attribute tells the browser that this meta tag is sending an HTTP 
command rather than a standard meta tag. Refresh is an actual HTTP 
header used by the web server.The content attribute in the tag is having
 value in seconds. As per the above code, it is set to 10, which means 
after 10 seconds your page will get refreshed or reloaded.&lt;br /&gt;
&lt;br /&gt;
You can also use jQuery to refresh/reload the page automatically.  See below jQuery code.
&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;
&lt;div class=&quot;syntaxhighlighter  &quot; id=&quot;highlighter_70780&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;div class=&quot;lines&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;ReloadPage() { &lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;location.reload();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;};&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;$(document).ready(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;() {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;6&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;setTimeout(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;ReloadPage()&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, 10000); .&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;7&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;});&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
location.reload() will reload the page again. The advantage of location.reload() is that it works with all the major browsers.&lt;br /&gt;
&lt;br /&gt;
If you want to reload the page on click of button, then you can call 
location.reload() on button click event. See below jQuery code.
&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;$(document).ready(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;() {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;$(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;#btnReload&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;).click(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;() {&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt1&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&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;/code&gt;&lt;code class=&quot;plain&quot;&gt;location.reload();&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class=&quot;line alt2&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;table&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;});&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;table style=&quot;background-color: #f1c232;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;number&quot;&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;&lt;td class=&quot;content&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}); &lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/3597296827059850907/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/different-ways-to-refresh-or-reload.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3597296827059850907'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3597296827059850907'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/different-ways-to-refresh-or-reload.html' title='Different ways to refresh or reload page using jQuery'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-1003008402888950611</id><published>2012-07-07T05:10:00.002-07:00</published><updated>2012-07-07T05:12:24.149-07:00</updated><title type='text'>JQuery Mouse Events</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;520&#39; height=&#39;366&#39; src=&#39;https://www.youtube.com/embed/VpWnTQ1sIpM?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/1003008402888950611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/blog-post_07.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/1003008402888950611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/1003008402888950611'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/blog-post_07.html' title='JQuery Mouse Events'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-5331483359072040438</id><published>2012-07-06T14:07:00.001-07:00</published><updated>2012-07-06T14:07:38.818-07:00</updated><title type='text'>JQuery Basics Events</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;520&#39; height=&#39;366&#39; src=&#39;https://www.youtube.com/embed/oavtGjfa7bQ?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/5331483359072040438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/jquery-basics-events.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/5331483359072040438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/5331483359072040438'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/jquery-basics-events.html' title='JQuery Basics Events'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-7965902335649689989</id><published>2012-07-02T14:42:00.000-07:00</published><updated>2012-07-02T14:42:33.521-07:00</updated><title type='text'>Cloud computing</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Cloud computing&lt;/b&gt; is the delivery of computing and storage capacity &lt;sup class=&quot;reference&quot; id=&quot;cite_ref-0&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-0&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; as a service &lt;sup class=&quot;reference&quot; id=&quot;cite_ref-1&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-1&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; to a heterogeneous community of end-recipients. The name comes from the use of a cloud-shaped symbol&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-2&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; as an abstraction for the complex infrastructure it contains in system diagrams&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-3&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-3&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; Cloud computing entrusts services with a user&#39;s data, software and computation over a network.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;There are three types of cloud computing:&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-4&quot;&gt;&amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-4&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;ul dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;li&gt;Infrastructure as a Service (IaaS),&lt;/li&gt;
&lt;li&gt;Platform as a Service (PaaS), and&lt;/li&gt;
&lt;li&gt;Software as a Service (SaaS).&lt;/li&gt;
&lt;/ul&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Using Infrastructure as a Service, users rent use of servers (as many  as needed during the rental period) provided by one or more cloud  providers. Using Platform as a Service, users rent use of servers and  the system software to use in them. Using Software as a Service, users  also rent application software and databases. The cloud providers manage  the infrastructure and platforms on which the applications run.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
End users access cloud-based applications through a web browser or a light-weight desktop or mobile app while the business software and user&#39;s data are stored on servers  at a remote location. Proponents claim that cloud computing allows  enterprises to get their applications up and running faster, with  improved manageability and less maintenance, and enables IT to more  rapidly adjust resources to meet fluctuating and unpredictable business  demand.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-5&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-5&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-6&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-6&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Cloud computing relies on sharing of resources to achieve coherence and economies of scale similar to a utility (like the electricity grid) over a network (typically the Internet).&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-nist_7-0&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-nist-7&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt; At the foundation of cloud computing is the broader concept of converged infrastructure and shared services.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;span class=&quot;mw-headline&quot; id=&quot;Characteristics&quot;&gt;Characteristics&lt;/span&gt;&lt;/h2&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Cloud computing exhibits the following key characteristics:&lt;/div&gt;&lt;ul dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;li&gt;&lt;b&gt;Agility&lt;/b&gt; improves with users&#39; ability to re-provision technological infrastructure resources.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Application_programming_interface&quot; title=&quot;Application programming interface&quot;&gt;Application programming interface&lt;/a&gt;&lt;/b&gt;  (API) accessibility to software that enables machines to interact with  cloud software in the same way the user interface facilitates  interaction between humans and computers. Cloud computing systems  typically use &lt;a href=&quot;http://en.wikipedia.org/wiki/Representational_state_transfer&quot; title=&quot;Representational state transfer&quot;&gt;REST&lt;/a&gt;-based APIs.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Cost&lt;/b&gt; is claimed to be reduced and in a public cloud delivery model &lt;a href=&quot;http://en.wikipedia.org/wiki/Capital_expenditure&quot; title=&quot;Capital expenditure&quot;&gt;capital expenditure&lt;/a&gt; is converted to &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Operational_expenditure&quot; title=&quot;Operational expenditure&quot;&gt;operational expenditure&lt;/a&gt;&amp;nbsp; This is purported to lower &lt;a href=&quot;http://en.wikipedia.org/wiki/Barriers_to_entry&quot; title=&quot;Barriers to entry&quot;&gt;barriers to entry&lt;/a&gt;,  as infrastructure is typically provided by a third-party and does not  need to be purchased for one-time or infrequent intensive computing  tasks. Pricing on a &lt;a href=&quot;http://en.wikipedia.org/wiki/Utility_computing&quot; title=&quot;Utility computing&quot;&gt;utility computing&lt;/a&gt; basis is fine-grained with usage-based options and fewer IT skills are required for implementation (in-house).&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-idc_27-0&quot;&gt;&amp;nbsp;&lt;/sup&gt; The e-FISCAL project&#39;s state of the art repository&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-28&quot;&gt;&amp;nbsp;&lt;/sup&gt;  contains several articles looking into cost aspects in more detail,  most of them concluding that costs savings depend on the type of  activities supported and the type of infrastructure available in-house.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Device_independence&quot; title=&quot;Device independence&quot;&gt;Device&lt;/a&gt; and location independence&lt;/b&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-yarmis_29-0&quot;&gt;&amp;nbsp;&lt;/sup&gt;  enable users to access systems using a web browser regardless of their  location or what device they are using (e.g., PC, mobile phone). As  infrastructure is off-site (typically provided by a third-party) and  accessed via the Internet, users can connect from anywhere.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-idc_27-1&quot;&gt; &lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Virtualization&quot; title=&quot;Virtualization&quot;&gt;Virtualization&lt;/a&gt;&lt;/b&gt;  technology allows servers and storage devices to be shared and  utilization be increased. Applications can be easily migrated from one  physical server to another.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Multitenancy&quot; title=&quot;Multitenancy&quot;&gt;Multitenancy&lt;/a&gt;&lt;/b&gt; enables sharing of resources and costs across a large pool of users thus allowing for: &lt;ul&gt;&lt;li&gt;&lt;b&gt;Centralization&lt;/b&gt; of infrastructure in locations with lower costs (such as real estate, electricity, etc.)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Peak-load capacity&lt;/b&gt; increases (users need not engineer for highest possible load-levels)&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Utilisation and efficiency&lt;/b&gt; improvements for systems that are often only 10–20% utilised.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-amazon_14-1&quot;&gt; &lt;/sup&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Reliability_%28computer_networking%29&quot; title=&quot;Reliability (computer networking)&quot;&gt;Reliability&lt;/a&gt;&lt;/b&gt; is improved if multiple redundant sites are used, which makes well-designed cloud computing suitable for &lt;a href=&quot;http://en.wikipedia.org/wiki/Business_continuity&quot; title=&quot;Business continuity&quot;&gt;business continuity&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/Disaster_recovery&quot; title=&quot;Disaster recovery&quot;&gt;disaster recovery&lt;/a&gt;.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-30&quot;&gt; &lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;Scalability and Elasticity&lt;/b&gt; via dynamic (&quot;on-demand&quot;) &lt;a href=&quot;http://en.wikipedia.org/wiki/Provisioning&quot; title=&quot;Provisioning&quot;&gt;provisioning&lt;/a&gt; of resources on a fine-grained, self-service basis near real-time, without users having to engineer for peak loads.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-31&quot;&gt;&amp;nbsp;&lt;/sup&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-32&quot;&gt; &lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Computer_performance&quot; title=&quot;Computer performance&quot;&gt;Performance&lt;/a&gt;&lt;/b&gt; is monitored, and consistent and loosely coupled architectures are constructed using &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Web_services&quot; title=&quot;Web services&quot;&gt;web services&lt;/a&gt; as the system interface.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-idc_27-2&quot;&gt; &lt;/sup&gt;&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Computer_security&quot; title=&quot;Computer security&quot;&gt;Security&lt;/a&gt;&lt;/b&gt;  could improve due to centralization of data, increased security-focused  resources, etc., but concerns can persist about loss of control over  certain sensitive data, and the lack of security for stored kernels.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-33&quot;&gt;&amp;nbsp;&lt;/sup&gt;  Security is often as good as or better than other traditional systems,  in part because providers are able to devote resources to solving  security issues that many customers cannot afford.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-34&quot;&gt;&amp;nbsp;&lt;/sup&gt;  However, the complexity of security is greatly increased when data is  distributed over a wider area or greater number of devices and in  multi-tenant systems that are being shared by unrelated users. In  addition, user access to security &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Audit_log&quot; title=&quot;Audit log&quot;&gt;audit logs&lt;/a&gt;  may be difficult or impossible. Private cloud installations are in part  motivated by users&#39; desire to retain control over the infrastructure  and avoid losing control of information security.&lt;/li&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Software_maintenance&quot; title=&quot;Software maintenance&quot;&gt;Maintenance&lt;/a&gt;&lt;/b&gt;  of cloud computing applications is easier, because they do not need to  be installed on each user&#39;s computer and can be accessed from different  places.&lt;/li&gt;
&lt;/ul&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt; &lt;span class=&quot;mw-headline&quot; id=&quot;Service_Models&quot;&gt;Service Models&lt;/span&gt;&lt;/h2&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Cloud computing providers offer their services according to three fundamental models:&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-nist_7-1&quot;&gt; &lt;/sup&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-Buyya_35-0&quot;&gt;&amp;nbsp;&lt;/sup&gt;  Infrastructure as a service (IaaS), platform as a service (PaaS), and  software as a service (SaaS) where IaaS is the most basic and each  higher model abstracts from the details of the lower models.&lt;/div&gt;&lt;div class=&quot;floatright&quot; dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;a class=&quot;image&quot; href=&quot;http://en.wikipedia.org/wiki/File:Cloud_computing_layers.png&quot;&gt;&lt;img alt=&quot;Cloud computing layers.png&quot; height=&quot;322&quot; src=&quot;http://upload.wikimedia.org/wikipedia/commons/3/3c/Cloud_computing_layers.png&quot; width=&quot;348&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt; &lt;span class=&quot;mw-headline&quot; id=&quot;Infrastructure_as_a_service_.28IaaS.29&quot;&gt;Infrastructure as a service (IaaS)&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;rellink boilerplate seealso&quot; dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;See also: &lt;a href=&quot;http://en.wikipedia.org/wiki/Category:Cloud_infrastructure&quot; title=&quot;Category:Cloud infrastructure&quot;&gt;Category:Cloud infrastructure&lt;/a&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;In this most basic cloud service model, cloud providers offer computers – as physical or more often as &lt;a href=&quot;http://en.wikipedia.org/wiki/Virtual_machine&quot; title=&quot;Virtual machine&quot;&gt;virtual machines&lt;/a&gt; –, raw (block) storage, &lt;a href=&quot;http://en.wikipedia.org/wiki/Firewall_%28computing%29&quot; title=&quot;Firewall (computing)&quot;&gt;firewalls&lt;/a&gt;, &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Load_balancer&quot; title=&quot;Load balancer&quot;&gt;load balancers&lt;/a&gt;, and networks. IaaS providers supply these resources on demand from their large pools installed in &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Data_centers&quot; title=&quot;Data centers&quot;&gt;data centers&lt;/a&gt;. &lt;a href=&quot;http://en.wikipedia.org/wiki/Local_area_network&quot; title=&quot;Local area network&quot;&gt;Local area networks&lt;/a&gt; including IP addresses are part of the offer. For &lt;a href=&quot;http://en.wikipedia.org/wiki/Wide_area_network&quot; title=&quot;Wide area network&quot;&gt;wide area&lt;/a&gt; connectivity, the Internet can be used or -- in &lt;a href=&quot;http://en.wikipedia.org/wiki/Carrier_cloud&quot; title=&quot;Carrier cloud&quot;&gt;carrier clouds&lt;/a&gt; -- dedicated &lt;a href=&quot;http://en.wikipedia.org/wiki/Virtual_private_network&quot; title=&quot;Virtual private network&quot;&gt;virtual private networks&lt;/a&gt; can be configured.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;To deploy their applications, cloud users then install operating  system images on the machines as well as their application software. In  this model, it is the cloud user who is responsible for patching and  maintaining the operating systems and application software. Cloud  providers typically bill IaaS services on a &lt;a href=&quot;http://en.wikipedia.org/wiki/Utility_computing&quot; title=&quot;Utility computing&quot;&gt;utility computing&lt;/a&gt; basis, that is, cost will reflect the amount of resources allocated and consumed.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;IaaS refers not to a machine that does all the work, but simply to a  facility given to businesses that offers users the leverage of extra  storage space in servers and data centers.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Examples of IaaS include: Amazon CloudFormation (and underlying  services such as EC2), Rackspace Cloud, Google Compute Engine, and  RightScale.&lt;/div&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt; &lt;span class=&quot;mw-headline&quot; id=&quot;Platform_as_a_service_.28PaaS.29&quot;&gt;Platform as a service (PaaS)&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;rellink relarticle mainarticle&quot; dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Main article: Platform as a service&lt;/div&gt;&lt;div class=&quot;rellink boilerplate seealso&quot; dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;a href=&quot;http://www.blogger.com/goog_1397163379&quot;&gt;See also: &lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/goog_1397163379&quot; title=&quot;Category:Cloud platforms&quot;&gt;Category:Cloud platforms&lt;/a&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;In the PaaS model, cloud providers deliver a computing platform  typically including operating system, programming language execution  environment, database, and web server. Application developers can  develop and run their software solutions on a cloud platform without the  cost and complexity of buying and managing the underlying hardware and  software layers. With some PaaS offers, the underlying compute and  storage resources scale automatically to match application demand such  that cloud user does not have to allocate resources manually.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt; &lt;span class=&quot;mw-headline&quot; id=&quot;Software_as_a_service_.28SaaS.29&quot;&gt;Software as a service (SaaS)&lt;/span&gt;&lt;/h3&gt;&lt;div class=&quot;rellink relarticle mainarticle&quot; dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Main article: &lt;a href=&quot;http://en.wikipedia.org/wiki/Software_as_a_service&quot; title=&quot;Software as a service&quot;&gt;Software as a service&lt;/a&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;In this model, cloud providers install and operate &lt;a href=&quot;http://en.wikipedia.org/wiki/Application_software&quot; title=&quot;Application software&quot;&gt;application software&lt;/a&gt; in the cloud and cloud users access the software from &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Cloud_clients&quot; title=&quot;Cloud clients&quot;&gt;cloud clients&lt;/a&gt;.  The cloud users do not manage the cloud infrastructure and platform on  which the application is running. This eliminates the need to install  and run the application on the cloud user&#39;s own computers simplifying  maintenance and support. What makes a cloud application different from  other applications is its &lt;a href=&quot;http://en.wikipedia.org/wiki/Elasticity_%28data_store%29&quot; title=&quot;Elasticity (data store)&quot;&gt;elasticity&lt;/a&gt;. This can be achieved by cloning tasks onto multiple &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Virtual_machines&quot; title=&quot;Virtual machines&quot;&gt;virtual machines&lt;/a&gt; at run-time to meet the changing work demand.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-hamdaqa_36-0&quot;&gt;&amp;nbsp;&lt;/sup&gt; &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Load_balancer&quot; title=&quot;Load balancer&quot;&gt;Load balancers&lt;/a&gt;  distribute the work over the set of virtual machines. This process is  inconspicuous to the cloud user who sees only a single access point. To  accommodate a large number of cloud users, cloud applications can be &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Multitenant&quot; title=&quot;Multitenant&quot;&gt;multitenant&lt;/a&gt;,  that is, any machine serves more than one cloud user organization. It  is common to refer to special types of cloud based application software  with a similar naming convention: &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Desktop_as_a_service&quot; title=&quot;Desktop as a service&quot;&gt;desktop as a service&lt;/a&gt;, business process as a service, &lt;a href=&quot;http://en.wikipedia.org/wiki/Test_Environment_as_a_Service&quot; title=&quot;Test Environment as a Service&quot;&gt;Test Environment as a Service&lt;/a&gt;, &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Communication_as_a_service&quot; title=&quot;Communication as a service&quot;&gt;communication as a service&lt;/a&gt;.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;The pricing model for SaaS applications is typically a monthly or yearly flat fee per user.&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-Chou_37-0&quot;&gt; &lt;/sup&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Examples of SaaS include: Google Apps, Quickbooks Online and Salesforce.com.&lt;/div&gt;&lt;h2 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt; &lt;span class=&quot;mw-headline&quot; id=&quot;Cloud_clients&quot;&gt;Cloud clients&lt;/span&gt;&lt;/h2&gt;&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Users access cloud computing using networked client devices, such as &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Desktop_computers&quot; title=&quot;Desktop computers&quot;&gt;desktop computers&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Laptop&quot; title=&quot;Laptop&quot;&gt;laptops&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Tablet_computer&quot; title=&quot;Tablet computer&quot;&gt;tablets&lt;/a&gt; and &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Smartphones&quot; title=&quot;Smartphones&quot;&gt;smartphones&lt;/a&gt;. Some of these devices - &lt;i&gt;cloud clients&lt;/i&gt; - rely on cloud computing for all or a majority of their applications so as to be essentially useless without it. Examples are &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Thin_clients&quot; title=&quot;Thin clients&quot;&gt;thin clients&lt;/a&gt; and the browser-based &lt;a href=&quot;http://en.wikipedia.org/wiki/Chromebook&quot; title=&quot;Chromebook&quot;&gt;Chromebook&lt;/a&gt;. Many cloud applications do not require specific software on the client and instead use a &lt;a href=&quot;http://en.wikipedia.org/wiki/Web_browser&quot; title=&quot;Web browser&quot;&gt;web browser&lt;/a&gt; to interact with the cloud application. With &lt;a href=&quot;http://en.wikipedia.org/wiki/Ajax_%28programming%29&quot; title=&quot;Ajax (programming)&quot;&gt;Ajax&lt;/a&gt; and &lt;a href=&quot;http://en.wikipedia.org/wiki/HTML5&quot; title=&quot;HTML5&quot;&gt;HTML5&lt;/a&gt; these &lt;a class=&quot;mw-redirect&quot; href=&quot;http://en.wikipedia.org/wiki/Web_user_interface&quot; title=&quot;Web user interface&quot;&gt;Web user interfaces&lt;/a&gt; can achieve a similar or even better &lt;a href=&quot;http://en.wikipedia.org/wiki/Look_and_feel&quot; title=&quot;Look and feel&quot;&gt;look and feel&lt;/a&gt;  as native applications. Some cloud applications, however, support  specific client software dedicated to these applications (e.g., &lt;a href=&quot;http://en.wikipedia.org/wiki/Desktop_virtualization&quot; title=&quot;Desktop virtualization&quot;&gt;virtual desktop&lt;/a&gt;  clients and most email clients). Some legacy applications (line of  business applications that until now have been prevalent in thin client  Windows computing) are delivered via a screen-sharing technology.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot;&gt;&lt;/sup&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot;&gt;&lt;/sup&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot;&gt;&lt;/sup&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot;&gt;&lt;/sup&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;sup class=&quot;reference&quot; id=&quot;cite_ref-8&quot;&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Cloud_computing#cite_note-8&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/sup&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/7965902335649689989/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/cloud-computing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/7965902335649689989'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/7965902335649689989'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/07/cloud-computing.html' title='Cloud computing'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-3493299964192804048</id><published>2012-06-29T13:24:00.000-07:00</published><updated>2012-06-29T13:24:33.894-07:00</updated><title type='text'>Create MVC Website</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Before you can do anything with ASP.NET MVC, you have to create a website to work with. Fortunately, it is easy to do.&lt;/div&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Step 1: Find the Project Type in Visual Studio&lt;/h3&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Open up Visual Studio 2008. Go to File &amp;gt; New &amp;gt; Project in the menu. You will get a dialog much like the following image.     Pick the &quot;Web&quot; category.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;img alt=&quot;Picture of the add project dialog.&quot; src=&quot;http://www.howmvcworks.net/Content/Images/ViewImages/GettingStarted/CreatingAnMVCWebsite/ProjectSelectionScreen.jpg&quot; title=&quot;I try my best to be unique in my naming&quot; /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;You can, of course call the project whatever you want and put it wherever you want. Next step.&lt;/div&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Step 2: Create a Test Project&lt;/h3&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;This is not necessary but is highly recommended. After all, automating tests is a useful activity.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;img alt=&quot;Picture of the add test project dialog.&quot; src=&quot;http://www.howmvcworks.net/Content/Images/ViewImages/GettingStarted/CreatingAnMVCWebsite/CreateATestProject.jpg&quot; title=&quot;Test projects are da bomb&quot; /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;As you can see, there is a dropdown for selecting test frameworks other than that which comes with Visual Studio. If     you have another test framework that you use, feel free to use it.&lt;/div&gt;&lt;h3 dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;Take a Look at What You Get&lt;/h3&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;You now have an MVC project. So now let&#39;s take a look at what you have.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;&lt;img alt=&quot;Picture of solution explorer for a newly created project.&quot; src=&quot;http://www.howmvcworks.net/Content/Images/ViewImages/GettingStarted/CreatingAnMVCWebsite/SolutionExplorer.jpg&quot; style=&quot;float: right;&quot; title=&quot;As you can see, you get a lot by default when you create the project.&quot; /&gt;&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;A few things here. &lt;em&gt;The content folder&lt;/em&gt; is the place to put images and css. Putting such things     there is not necessary. That is simply the default recommendation. &lt;em&gt;The controllers folder&lt;/em&gt;      is where you put your controller classes. If you are     wondering what that is, well, that will be defined soon enough. This is actually one of the two core pieces     of what ASP.NET MVC really is. &lt;em&gt;The models folder&lt;/em&gt; is potentially a place to put any &quot;business logic&quot;     classes you want to use but it can, frankly, just be deleted. Unless you want to put code there, do not feel     constrained to do so. &lt;em&gt;The scripts folder&lt;/em&gt; is for javascript files. &lt;em&gt;The views folder&lt;/em&gt; is the     other super-important core pieces of the ASP.NET MVC framework, and contains your Html files.&lt;/div&gt;&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;In the next section we will discuss the pattern around which ASP.NET MVC is built,     the Model-View-Controller pattern. After that we will come back to solution explorer and see how that pattern     is applied to the project file, and how they expect code to be written using this framework.&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/3493299964192804048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-mvc-website.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3493299964192804048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3493299964192804048'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-mvc-website.html' title='Create MVC Website'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-223321069913255942</id><published>2012-06-25T06:30:00.000-07:00</published><updated>2012-06-25T06:30:00.505-07:00</updated><title type='text'>Consumerism and its antisocial effects can be turned on—or off</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;img alt=&quot;khg&quot; border=&quot;0&quot; src=&quot;http://www.zeitnews.org/images/stories/storypics/SocialSciences/shopping%20trauma.jpg&quot; style=&quot;margin: 8px;&quot; title=&quot;Credit: Les Chatfield, Flickr&quot; /&gt;&amp;nbsp; &lt;b&gt;&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Money doesn&#39;t buy happiness. Neither does&amp;nbsp; materialism: 
Research shows that people who&amp;nbsp; place a high value on wealth, status, and
 stuff are more depressed and anxious and less sociable than those who 
do not. Now new research shows that materialism is not just a personal 
problem. It&#39;s also environmental.&lt;/b&gt;&lt;br /&gt;
&quot;We found that 
irrespective of personality, in situations that activate a consumer 
mindset, people show the same sorts of problematic patterns in 
wellbeing, including negative affect and social disengagement,&quot; says 
Northwestern University psychologist Galen V. Bodenhausen. The study, 
conducted with colleagues Monika A. Bauer, James E. B. Wilkie, and Jung 
K. Kim, appears in Psychological Science, a journal of the Association 
for Psychological Science.&lt;br /&gt;
In two of four experiments, university 
students were put in a materialistic frame of mind by tasks that exposed
 them to images of luxury goods or words mobilizing consumerist values 
(versus neutral scenes devoid of consumer products or words without such
 connotations). Completing questionnaires afterwards, those who looked 
at the pictures of cars, electronics, and jewelry rated themselves 
higher in depression and anxiety, less interested in social activities 
like parties, and more in solitary pursuits than the others. Those 
primed to materialism by exposure to certain words evinced more 
competitiveness and less desire to invest their time in pro-social 
activities like working for a good cause.&lt;br /&gt;
In two other 
experiments, participants completed tasks that were framed as 
surveys—one of consumer responses, another of citizens.&#39; The first 
experiment involved moving words toward or away from the participant&#39;s 
name on a computer screen—positive and negative emotion words and 
&quot;neutral&quot; ones that actually suggested materialism (wealth, power), 
self-restraint (humble, discipline), transcendence of self, or 
self-indulgence. The people who answered the &quot;consumer response survey&quot; 
more quickly &quot;approached&quot; the words that reflected materialistic values 
than those in the &quot;citizen&quot; survey. The last experiment presented 
participants with a hypothetical water shortage in a well shared by four
 people, including themselves. The water users were identified either as
 consumers or individuals. Might the collective identity as consumers—as
 opposed to the individual role—supersede the selfishness ordinarily 
stimulated by the consumer identity? No: The &quot;consumers&quot; rated 
themselves as less trusting of others to conserve water, less personally
 responsible and less in partnership with the others in dealing with the
 crisis. The consumer status, the authors concluded &quot;did not unite; it 
divided.&quot;&lt;br /&gt;
The findings have both social and personal implications,
 says Bodenhausen. &quot;It&#39;s become commonplace to use consumer as a generic
 term for people,&quot; in the news or discussions of taxes, politics, or 
health care. If we use term such as Americans or citizens instead, he 
says, &quot;that subtle difference activates different psychological 
concerns.&quot; We can also take personal initiative to reduce the 
depressive, isolating effects of a materialist mindset by avoiding its 
stimulants—most obviously, advertising. One method: &quot;Watch less TV.&quot;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/223321069913255942/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/consumerism-and-its-antisocial-effects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/223321069913255942'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/223321069913255942'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/consumerism-and-its-antisocial-effects.html' title='Consumerism and its antisocial effects can be turned on—or off'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-6504033795890753539</id><published>2012-06-25T06:26:00.003-07:00</published><updated>2012-06-25T06:26:50.035-07:00</updated><title type='text'>Creative Activism</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;500&#39; height=&#39;350&#39; src=&#39;https://www.youtube.com/embed/um5QvW5XHwY?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
Creative activists can be &lt;a href=&quot;http://www.creativevisions.org/creative-activist-projects/&quot; target=&quot;_blank&quot;&gt;described as&lt;/a&gt;: &#39;&lt;em&gt;These
  are the changemakers. People who turn their ideas into action. A  
Creative Activist is any individual or organization who uses media, the 
 arts, and technology to create awareness of important issues in the  
world and affect positive change.&#39;&lt;/em&gt;&lt;br /&gt;

 I would disagree with the description above, simply because creative
  activists don’t limit their creativity to using arts, media and  
technology to create awareness. They also use ingenuity and originality 
 to convey their message, to a sometimes unwilling and skeptical  
audience.&lt;br /&gt;

 &lt;a href=&quot;http://www.prweek.com/uk/opinion/1121635/Think-BR-Creativity-sprung-Arab-spring/?DCMP=ILC-SEARCH&quot; target=&quot;_blank&quot;&gt;Nick Darken wrote&lt;/a&gt;,
  commenting on the video above: &#39;‘The Return of Dictator Ben Ali’ saw  
one huge, imposing portrait of the former dictator reinstated in a  
square in newly freed Tunisia. The response was emotional. As the crowd 
 tore down the poster in anger, the message underneath reminded people 
to  use their vote at the upcoming elections as only half the population
  were expected to turn out.” &lt;br /&gt;

 Some creative volunteers found another way to raise awareness about 
 Israel&#39;s apartheid policies, on the streets of New York City. The BDS  
movement provides &lt;a href=&quot;http://refrainplayingisrael.posterous.com/israel-jazz-festival-at-guggenheim-attendees&quot; target=&quot;_blank&quot;&gt;a prime example&lt;/a&gt;
 of creativity and spontaneity. Attendees of the Israel Jazz Festival in
  NYC at the Guggenheim were treated to free water bottles labeled  
&quot;Israel&quot; on one side and the words &quot;Apartheid since 1948&quot; on the other.&lt;br /&gt;

 &lt;a href=&quot;http://www.aspeninstitute.it/aspenia-online/article/creativity-and-arab-spring-conversation-ammar-alani&quot; target=&quot;_blank&quot;&gt;Syrian Activist Ammar Allani is quoted&lt;/a&gt; as saying: &lt;br /&gt;

 “And while they (governments/authorities) can claim supremacy in 
force,  finance and media ownership, the one thing they definitely 
cannot offer  is creativity, freedom and innovation. That is why the 
young generation  is using these specific tools to alter the rules of 
the game, leaving  the regimes unable to keep pace, at least in terms of
 winning the  audience.&lt;br /&gt;

 In one instance, hundreds of young protestors took to the streets  
raising blank signs, dozens of white boards with absolutely nothing  
written on them, yet the security forces were exasperated by that and  
started shooting and beating people. For everyone watching, including  
some supporters of the regime, it was really silly and stupid; it was a 
 classic example of creativity winning over force.&lt;br /&gt;

 Take Kafranbel for instance, this is a very small village in Syria, 
 unknown even to the average Syrian and located in a province ironically
  called “the forgotten cities”, these people grow olives, and recently 
 ideas!&lt;br /&gt; Every week, a few dozens of the Kafranbel inhabitants 
brainstorm and  create the most incredibly creative and powerful punch 
lines, they write  them on paper panels, go to the grove, photograph 
themselves with a  phone and upload the images to Facebook, as simple as
 this may seem, it  is literarily revolutionizing the nation.&lt;br /&gt; Just to share with you some of these punch lines:&lt;br /&gt;

 - We demand that school uniforms include a helmet, body armor and gas mask.&lt;br /&gt; - Forgive me my love; I mentioned your name in the interrogation.&lt;br /&gt; - Only in Syria, to get to heaven… just cross the street.”&lt;br /&gt;

 Marianne Torres, an inspiring American activist, told me of her own small victory: &lt;br /&gt;

 &quot;We learned that Madeline Albright was coming to Eastern Washington 
 University in Cheney. I was still mightily outraged about Albright&#39;s  
words and continued &quot;service&quot; in the American government so I just  
decided that if no one else could do anything to expose her crimes, I  
would.&lt;br /&gt;

 I had a t-shirt made with &lt;a href=&quot;http://www.youtube.com/watch?v=x4PgpbQfxgo&quot; target=&quot;_blank&quot;&gt;her infamous quote&lt;/a&gt;
 on the back &quot;500,000 Iraqi children killed by U.S. sanctions. Madeleine
  Albright says, &#39;...The price — we think the price is worth it.&#39;, wrote
  up the quote and other ugliness from her on a handout and passed them 
 out at her speaking engagement and then did a double sided sheet with  
William Blum&#39;s piece on her on one side and the absurd list of embargoed
  items on the other side, and passed them out both outside, and inside 
 the auditorium. Most people didn&#39;t read my shirt, but assumed the flyer
  was something from the University, so a whole lot of people sat and 
read  the awful truth before she spoke. &lt;br /&gt;

 Imagine my surprise when people who were excited to see this woman 
asked  me if they could buy a t-shirt like mine! They obviously had not 
 actually read it but assumed I was there in support of her. I&#39;m sure  
they changed their mind after they read the paper I handed to them - and
  several hundred others.&quot;&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: medium none; color: black; overflow: hidden; text-align: left; text-decoration: none;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/6504033795890753539/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/creative-activism.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6504033795890753539'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6504033795890753539'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/creative-activism.html' title='Creative Activism'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-3578387367378777460</id><published>2012-06-25T05:39:00.004-07:00</published><updated>2012-06-25T05:39:36.742-07:00</updated><title type='text'>View In Sql Server 2005 &amp; 2008</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Introduction:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;In
 this article we are going to discuss about the Views in the sql server 
2005 version. It is one of the important elements in the sql server; it 
eliminates the difficulties in the business process. There are lots of 
significant improvements in the view especially in the sql server 2005 
version. They have introduced the indexed views and INSTEAD of Trigger 
on the permanent view. Let us discuss about the views with more 
practical way.&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;Views:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The
 view is a virtual table, which can have the multiple columns from the 
one or more table. It can be used like the normal table. Normally view 
cannot store the data permanently in the table. When we create the view 
it stores the view definition schema as object under the concern 
database.&lt;br /&gt;&lt;br /&gt;Let us see the syntax of the create view&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;CREATE VIEW View Name [Alias name1, name2,]&lt;/span&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;WITH ENCRYPTION&lt;/span&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;WITH SCHEMA BINDING&lt;/span&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;AS&lt;/span&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;SELECT statement [WITH CHECK OPTION]&lt;/span&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;br /&gt;The
 create view can be created with the view name and the alias can be 
given in the view name parameter parenthesis. The view schema can be 
stored in the encrypted format. Here is an option like SCHEMA BINDING; 
this is an important mile stone in the view to allow the developers to 
create the permanent view.&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;When to use VIEW?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;When you have complex queries, that use many places in the stored procedures or functions, etc..,&lt;br /&gt;&lt;br /&gt;It
 will be used as security mechanism in the web applications. When we use
 the original table in the web applications the hackers may drop the 
table. That time the original data will be persist in the table.&lt;br /&gt;&lt;br /&gt;When you want to hide the particular columns to the specific people then we can create the specialized view.&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;Encrypted View:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The
 definition of schema will be encrypted and stored as object in the 
database. This can be done using the ENCRYPTION option in the view 
creation.&lt;br /&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;br /&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Vw_SqlObjects_Encrypted&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Vw_SqlObjects_Encrypted&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&amp;lt;&amp;lt; [DBO].Vw_SqlObjects_Encrypted View dropped &amp;gt;&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Vw_SqlObjects_Encrypted&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;ENCRYPTION&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;Object_ID&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Name&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;Type&#39;&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;CASE&lt;/span&gt; O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;type &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;S&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Scalar Functions&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;F&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Functions&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;V&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Views&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;PK&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Primary keys&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;TR&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Triggers&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;P&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Procedures&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;U&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;User Defined Functions&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;TF&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Table Valued Functions&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;IF&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Inline Functions&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;create_date&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;modify_date&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;CASE&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHEN&lt;/span&gt; SC&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;encrypted &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 0 &lt;span style=&quot;color: blue;&quot;&gt;THEN&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;No&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ELSE&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;Yes&#39;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;END&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; [IsEncrypted]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;SC&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;text&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: green;&quot;&gt;SYS.OBJECTS&lt;/span&gt; O&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SYSCOMMENTS SC &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; SC&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;id &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;object_id&lt;/span&gt;&lt;br /&gt;&amp;nbsp;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Vw_SqlObjects_Encrypted&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&amp;lt;&amp;lt; [DBO].Vw_SqlObjects_Encrypted View created &amp;gt;&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Now
 if you want to see the view schema definition for the above view is not
 possible. We have stored in the encrypted format. This is a significant
 option to hide the important calculations inside the view from the 
others.&lt;br /&gt;&lt;br /&gt;In case of any alter in the view must be stored externally somewhere else. &lt;br /&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;br /&gt;SELECT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;text&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; SYSCOMMENTS &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; id &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Vw_SqlObjects_Encrypted&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; definition &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;SYS.sql_modules&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;object_id&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Vw_SqlObjects_Encrypted&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;/span&gt; &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: #f1c232; color: maroon; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;sp_helptext&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; Vw_SqlObjects_Encrypted&lt;/span&gt;&lt;br /&gt;If you execute the above queries then it will say like view is encrypted.&lt;br /&gt;&lt;br /&gt;There are three types of views in the sql server 2005.&lt;br /&gt;&lt;br /&gt;They are&amp;nbsp; 
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Normal or Standard view&lt;/li&gt;
&lt;li&gt;Indexed or permanent view &lt;/li&gt;
&lt;li&gt;Partitioned view&lt;/li&gt;
&lt;/ol&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;Normal or Standard view:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;This
 view is most frequently used by the developers. When create the view 
the schema will be stored an object in the database. When we retrieve 
the content from this virtual table, it will be executed the schema and 
stored the data from the parent table.&lt;br /&gt;&lt;br /&gt;Here if you have the 
result from the same table then it can be updated and inserted. The 
deleted row will be reflected in the original table.&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;USE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; [Northwind]&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_ViewProducts&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;V&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_ViewProducts&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&amp;lt;&amp;lt; [DBO].vw_ViewProducts view dropped.. &amp;gt;&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_ViewProducts&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ProductID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;ProductName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;SupplierID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;CategoryID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;QuantityPerUnit&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;UnitPrice&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;UnitsInStock&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;br /&gt;UnitsOnOrder&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;ReorderLevel&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;Discontinued&lt;br /&gt;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; Products&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_ViewProducts&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;V&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&amp;lt;&amp;lt; [DBO].vw_ViewProducts view created.. &amp;gt;&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--O/P&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_ViewProducts&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--INSERT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;INSERT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;INTO&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_ViewProducts&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;ProductName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;SupplierID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;CategoryID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;QuantityPerUnit&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;UnitPrice&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;UnitsInStock&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;UnitsOnOrder&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;ReorderLevel&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;Discontinued&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;VALUES&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: red; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&#39;Test View&#39;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;1&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;2&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;100 per bag&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;25.45&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;89&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;57&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;15&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;0&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--DELETE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;DELETE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_ViewProducts &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; ProductID &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; 81&lt;/span&gt;&lt;br /&gt;Here you can do the DML operations in the view when you have only one table. &lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;Indexed views:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The
 indexed or permanent view is one of the new features introduced in the 
sql server 2005 version. We have seen that the view only store the 
schema definition and it will get execute and load the data into the 
virtual table at the time of view used. But this view creates the 
permanent view and we can create the indexes on the table. It allows us 
to create the instead of trigger.&lt;br /&gt;&lt;br /&gt;The indexed view can be created with the WITH SCHEMA BINDING option while creating the view.&lt;br /&gt;&lt;br /&gt;The indexed view has some restrictions like cannot use the TOP, DISTINCT, UNION, ORDER BY and aggregate functions.&lt;br /&gt;&lt;br /&gt;It allows us to use the GROUP BY statement but we cannot use COUNT statement. Instead of that COUNT_BIG statement can be used.&lt;br /&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;br /&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;EXISTS(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;SYS.OBJECTS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;N&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Vw_Product_Sales_Report&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;N&lt;span style=&quot;color: red;&quot;&gt;&#39;V&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Vw_Product_Sales_Report&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&amp;lt;&amp;lt; [DBO].Vw_Product_Sales_Report view dropped &amp;gt;&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Vw_Product_Sales_Report&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;SCHEMABINDING&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;OrderID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;C&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;CustomerID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;C&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;CompanyName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;C&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Address&lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;, &#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt;C&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;City &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; [Customer Address]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductID&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;P&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;UnitPrice&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Quantity&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,(&lt;/span&gt;OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;UnitPrice &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Quantity&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; [Total]&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;,(&lt;/span&gt;OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;UnitPrice &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Quantity&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Discount&lt;span style=&quot;color: grey;&quot;&gt;/&lt;/span&gt;100 &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; [Discount]&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Orders O &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;NOLOCK&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;&quot;Order Details&quot; OD &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;NOLOCK&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;OrderID &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;OrderID&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Customers C &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;NOLOCK&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; C&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;CustomerID &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; O&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;CustomerID&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Products P &lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;NOLOCK&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; P&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductID &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductID&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;EXISTS(&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;SYS.OBJECTS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;N&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Vw_Product_Sales_Report&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;N&lt;span style=&quot;color: red;&quot;&gt;&#39;V&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;&amp;lt;&amp;lt; [DBO].Vw_Product_Sales_Report view created &amp;gt;&amp;gt;&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;GO&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Here the &amp;nbsp;indexed view has created. When you retrieve the data from this table, it will execute like normal table.&lt;br /&gt;&lt;br /&gt;There
 are some retrictions while creating this indexed view like the name of 
the view must be two part name and we cannot use select * in the view 
schema defintion.&lt;br /&gt;&lt;br /&gt;Normally view cannot have the triggers but from
 the sql server 2005 onwards We can create the Instead of trigger on the
 instead of trigger.&lt;br /&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;br /&gt;Partitioned Views:&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The partitioned view and its execution is like normal view. It will work across the database and across the server.&lt;br /&gt;&lt;br /&gt;There are two types of Partitioned views. They are&amp;nbsp;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;Local Partitioned View&lt;/li&gt;
&lt;li&gt;Global Partitioned View&lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt; &lt;div class=&quot;MsoNormal&quot;&gt;
&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;1. Local Partitioned View:&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;The local partitioned view can be created within same server but different database.&lt;br /&gt;&lt;br /&gt;The
 view schema definition will be stored in the executed database. But 
when we try to retrieve the data from the table, it has to execute the 
schema definition internally and load the data.&lt;br /&gt;&lt;br /&gt;Let us see an example.&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;USE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; [Northwind]&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE&lt;/span&gt; EmployeeList&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; iEmployeeID &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;IDENTITY&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt;&amp;nbsp; vFirstName &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;25&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;/span&gt;&amp;nbsp; vLastName &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;25&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;/span&gt;&amp;nbsp; iDeptID &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp; vAddress &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;25&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;/span&gt;&amp;nbsp; vCity &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;25&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;/span&gt;&amp;nbsp; vState &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;25&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;/span&gt;&amp;nbsp; vCountry &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;25&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL,&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;USE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; [Master]&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;TABLE&lt;/span&gt; Department&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; iDeptID &lt;span style=&quot;color: blue;&quot;&gt;INT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;IDENTITY&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;PRIMARY&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;KEY&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp; vDeptName &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;50&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt;&amp;nbsp; vDeptDesc &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;25&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt;&amp;nbsp; vDeptAddedBy &lt;span style=&quot;color: blue;&quot;&gt;VARCHAR&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;50&lt;span style=&quot;color: grey;&quot;&gt;),&lt;/span&gt;&amp;nbsp; vPostedDate &lt;span style=&quot;color: blue;&quot;&gt;DATETIME&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;DEFAULT&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;GETDATE&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;()&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--SELECT * FROM Department&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;USE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; [Northwind]&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_LocalPartion_View&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;V&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_LocalPartion_View&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_LocalPartion_View view dropped...&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_LocalPartion_View&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;AS&lt;br /&gt;SELECT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; E&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;iEmployeeID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;E&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vFirstName&lt;span style=&quot;color: grey;&quot;&gt;+&lt;/span&gt;&lt;span style=&quot;color: magenta;&quot;&gt;SPACE&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;1&lt;span style=&quot;color: grey;&quot;&gt;)+&lt;/span&gt;E&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vLastName &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; [Name]&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; D&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vDeptName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;E&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vAddress&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;E&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vCity&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;E&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vState&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; EmployeeList E&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--INNER JOIN Master..Department D ON D.iDeptID = E.iDeptID --Either one of the way will be used.&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;INNER&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; Master&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;dbo&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Department D &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; D&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;iDeptID &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; E&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;iDeptID&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_LocalPartion_View&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;V&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_LocalPartion_View view created...&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--O/p&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;vw_LocalPartion_View&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br style=&quot;background-color: #f1c232;&quot; /&gt;&lt;strong&gt;&lt;br /&gt;2. Global Partitioned View&lt;/strong&gt;&lt;br /&gt;The global Partitioned&lt;b&gt; &lt;/b&gt;view will work across the server. The view can be created to join the table across the server.&lt;br /&gt;&lt;br /&gt;The accessing format will be like this.&lt;br /&gt;&lt;br /&gt;[Server Name]. &amp;nbsp;Database Name. Table Name&lt;br /&gt;&lt;br /&gt;When we execute the view if it is not linked with the current server then it will ask us to link the external server.&lt;br /&gt;&lt;br /&gt;The following system stored procedure will be used to link the server.&lt;br /&gt;&lt;span style=&quot;color: maroon; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;sp_addlinkedserver &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&#39;Server name&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;The following system catalog table is used to see the list of linked servers.&lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;SELECT&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: grey;&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue;&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;SYS.SERVERS&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;INSTEAD OF Triggers on the Indexed View&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;Normally
 the triggers cannot be created on the view. But sql server 2005 onwards
 we can create the INSTEAD OF trigger on the indexed views.&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;USE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; [Northwind]&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].[VW_Trigger_Example&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[VW_Trigger_Example]&lt;br /&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].[VW_Trigger_Example view dropped..&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;VIEW&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[VW_Trigger_Example]&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;WITH&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;SCHEMABINDING&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;AS&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; P&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;P&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductName&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;P&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;SupplierID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;OrderID&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;UnitPrice&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Quantity&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Products P&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: grey;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;JOIN&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[Order Details] OD &lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; OD&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductID &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; P&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;ProductID&lt;br /&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].[VW_Trigger_Example&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].[VW_Trigger_Example view created..&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--SELECT * FROM VW_Trigger_Example&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Tr_Delete_TriggerExample&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;TR&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;DROP&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TRIGGER&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Tr_Delete_TriggerExample&lt;br /&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Tr_Delete_TriggerExample trigger dropped..&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;CREATE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;TRIGGER&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;Tr_Delete_TriggerExample&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;VW_Trigger_Example&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;INSTEAD&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;OF&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;DELETE&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;AS&lt;br /&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;----------------------------------------&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;This is an example of INSTEAD OF Trigger&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;----------------------------------------&#39;&lt;/span&gt;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;TOP&lt;/span&gt; 1 &lt;span style=&quot;color: grey;&quot;&gt;*&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; DELETED&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;IF&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Tr_Delete_TriggerExample&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;TR&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;NULL&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;BEGIN&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;PRINT&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].Tr_Delete_TriggerExample trigger created..&#39;&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;END&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;GO&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: green; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;--O/P&lt;br /&gt;--SELECT * FROM [DBO].[VW_Trigger_Example] WHERE ProductID = 11&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;DELETE&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; [DBO]&lt;span style=&quot;color: grey;&quot;&gt;.&lt;/span&gt;[VW_Trigger_Example] &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; ProductID&lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt;11&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;How to view the Created Views?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;There are few ways to view the scehema definition of the created views.&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: maroon; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;&lt;br /&gt;SP_HELPTEXT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; vw_LocalPartion_View&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt;&quot;&gt; id&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;text&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; SYSCOMMENTS &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; id &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_LocalPartion_View&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; font-family: &#39;Courier New&#39;; font-size: 10pt; line-height: 115%;&quot;&gt; &lt;span style=&quot;color: magenta;&quot;&gt;object_id&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;,&lt;/span&gt;definition &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; &lt;span style=&quot;color: green;&quot;&gt;SYS.SQL_MODULES&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;WHERE&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt; &lt;span style=&quot;color: grey;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: magenta;&quot;&gt;OBJECT_ID&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;&#39;[DBO].vw_LocalPartion_View&#39;&lt;/span&gt;&lt;span style=&quot;color: grey;&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;How to drop the View?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;If
 you want to drop the view then you can use the following statement. 
When you drop the table underlying view will not be deleted. But if you 
run that view it will thrown an error.&lt;br /&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;DROP VIEW VIEW_NAME&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;How to alter the view?&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;If you want to do changes in the created views then you can alter the view whatever you want to view the same view name.&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: black;&quot;&gt;&lt;br /&gt;ALTER VIEW VIEW_NAME&lt;/span&gt; &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: black;&quot;&gt;AS&lt;/span&gt; &lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;background-color: #f1c232; color: black;&quot;&gt;SELECT [Columns List]....&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;color: navy;&quot;&gt;&lt;span style=&quot;color: black;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/3578387367378777460/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/view-in-sql-server-2005-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3578387367378777460'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3578387367378777460'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/view-in-sql-server-2005-2008.html' title='View In Sql Server 2005 &amp; 2008'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-8173310805184235902</id><published>2012-06-24T11:48:00.002-07:00</published><updated>2012-06-25T05:32:38.652-07:00</updated><title type='text'>C++ Get CPU and Memory Utilisation</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;b&gt;Write and compile the application&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;While you can get Memory status fairly easlily with 
GlobalMemoryStatusEx, there is no equivalent function for CPU. Therefore
 you have to use PDH Performance Counter Interface to get CPU 
utilisation. Write the application and save is as check.cpp. &lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;Also note that CPU is a difference between two
 PdhCollectQueryData calls, so if you call this once and try to get 
PdhGetFormattedCounterValue you will get an error.&lt;/span&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br style=&quot;background-color: #ffd966;&quot; /&gt;
&lt;table border=&quot;1&quot; class=&quot;CD_Code_Table&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;pre class=&quot;CD_Code_Words&quot; id=&quot;xxpre&quot; style=&quot;background-color: #ffd966;&quot;&gt;&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 1. &lt;/span&gt;#include &amp;lt;iostream&amp;gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 2. &lt;/span&gt;#include &amp;lt;windows.h&amp;gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 3. &lt;/span&gt;#include &amp;lt;stdio.h&amp;gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 4. &lt;/span&gt;#include &amp;lt;pdh.h&amp;gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 5. &lt;/span&gt;#include &amp;lt;pdhmsg.h&amp;gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 6. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 7. &lt;/span&gt;#define KB 1024
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 8. &lt;/span&gt;void main(int argc, char *argv[]){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt; 9. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;10. &lt;/span&gt;    PDH_HQUERY hquery;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;11. &lt;/span&gt;    PDH_HCOUNTER hcountercpu;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;12. &lt;/span&gt;    PDH_HCOUNTER hcounterram;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;13. &lt;/span&gt;    PDH_STATUS status;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;14. &lt;/span&gt;    LPSTR pMessage;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;15. &lt;/span&gt;    PDH_FMT_COUNTERVALUE countervalcpu;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;16. &lt;/span&gt;    PDH_FMT_COUNTERVALUE countervalram;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;17. &lt;/span&gt;    MEMORYSTATUSEX memstat;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;18. &lt;/span&gt;    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;19. &lt;/span&gt;    memstat.dwLength = sizeof (memstat);
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;20. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;21. &lt;/span&gt;    if((status=PdhOpenQuery(NULL, 0, &amp;amp;hquery))!=ERROR_SUCCESS){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;22. &lt;/span&gt;        printf(&quot;PdhOpenQuery %lx\n&quot;, status);    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;23. &lt;/span&gt;        goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;24. &lt;/span&gt;    }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;25. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;26. &lt;/span&gt;    if((status=PdhAddCounter(hquery,
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;27. &lt;/span&gt;                            &quot;\\Processor(_Total)\\% Processor Time&quot;,
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;28. &lt;/span&gt;                            0, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;29. &lt;/span&gt;                            &amp;amp;hcountercpu))!=ERROR_SUCCESS){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;30. &lt;/span&gt;        printf(&quot;PdhAddCounter (cpu) %lx\n&quot;, status);    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;31. &lt;/span&gt;        goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;32. &lt;/span&gt;    }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;33. &lt;/span&gt;    if((status=PdhAddCounter(hquery,
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;34. &lt;/span&gt;                            &quot;\\Memory\\Available Bytes&quot;,
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;35. &lt;/span&gt;                            0, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;36. &lt;/span&gt;                            &amp;amp;hcounterram))!=ERROR_SUCCESS){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;37. &lt;/span&gt;        printf(&quot;PdhAddCounter (ram) %lx\n&quot;, status);    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;38. &lt;/span&gt;        goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;39. &lt;/span&gt;    }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;40. &lt;/span&gt;    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;41. &lt;/span&gt;    /*Start outside the loop as CPU requires difference 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;42. &lt;/span&gt;    between two PdhCollectQueryData s*/
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;43. &lt;/span&gt;    if((status=PdhCollectQueryData(hquery))!=ERROR_SUCCESS){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;44. &lt;/span&gt;        printf(&quot;PdhCollectQueryData %lx\n&quot;, status);    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;45. &lt;/span&gt;        goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;46. &lt;/span&gt;    }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;47. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;48. &lt;/span&gt;    while(true){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;49. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;50. &lt;/span&gt;        if((status=PdhCollectQueryData(hquery))!=ERROR_SUCCESS){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;51. &lt;/span&gt;            printf(&quot;PdhCollectQueryData %lx\n&quot;, status);    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;52. &lt;/span&gt;            goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;53. &lt;/span&gt;        }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;54. &lt;/span&gt;        if(GlobalMemoryStatusEx(&amp;amp;memstat)==0){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;55. &lt;/span&gt;            printf(&quot;GlobalMemoryStatusEx %d\n&quot;, GetLastError());
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;56. &lt;/span&gt;            goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;57. &lt;/span&gt;        }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;58. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;59. &lt;/span&gt;        if((status=PdhGetFormattedCounterValue(hcountercpu, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;60. &lt;/span&gt;                                                PDH_FMT_LONG, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;61. &lt;/span&gt;                                                0, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;62. &lt;/span&gt;                                                &amp;amp;countervalcpu))!=ERROR_SUCCESS){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;63. &lt;/span&gt;            printf(&quot;PdhGetFormattedCounterValue(cpu) %lx\n&quot;, status);    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;64. &lt;/span&gt;            goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;65. &lt;/span&gt;        }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;66. &lt;/span&gt;        if((status=PdhGetFormattedCounterValue(hcounterram, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;67. &lt;/span&gt;                                                PDH_FMT_LONG, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;68. &lt;/span&gt;                                                0, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;69. &lt;/span&gt;                                                &amp;amp;countervalram))!=ERROR_SUCCESS){
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;70. &lt;/span&gt;            printf(&quot;PdhGetFormattedCounterValue(ram) %lx\n&quot;, status);    
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;71. &lt;/span&gt;            goto END;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;72. &lt;/span&gt;        }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;73. &lt;/span&gt;        printf(&quot;cpu %3d%% \tmem %3d%% \tavail (%d mb)\n&quot;, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;74. &lt;/span&gt;            countervalcpu.longValue, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;75. &lt;/span&gt;            memstat.dwMemoryLoad, 
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;76. &lt;/span&gt;            countervalram.longValue/(KB*KB));
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;77. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;78. &lt;/span&gt;        Sleep(1000);
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;79. &lt;/span&gt;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;80. &lt;/span&gt;    }
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;81. &lt;/span&gt;END:
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;82. &lt;/span&gt;    ;
&lt;span class=&quot;CD_Code_Num&quot; name=&quot;xxhid&quot;&gt;83. &lt;/span&gt;}&lt;/pre&gt;
&lt;span class=&quot;CD_Code_Table_Footer&quot;&gt;&lt;/span&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Open a prompt to the working directory and compile the code using 
the windows cl.exe compiler. You just need to include the pdh.lib.&lt;br /&gt;
&lt;table class=&quot;CD_Console_Table&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: black; color: white;&quot;&gt;
..workspace\PerfCounter&amp;gt;cl check.cpp pdf.lib&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;/li&gt;
&lt;li&gt;Now run the program in the command prompt. You should see the cpu and memory snapshot displayed every second.&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/8173310805184235902/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/c-get-cpu-and-memory-utilisation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/8173310805184235902'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/8173310805184235902'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/c-get-cpu-and-memory-utilisation.html' title='C++ Get CPU and Memory Utilisation'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-6226076500878595551</id><published>2012-06-24T10:57:00.000-07:00</published><updated>2012-06-24T10:57:06.243-07:00</updated><title type='text'>WPF Controls Progrrammatically</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Let’s create a sample app, and add a new window. I named mine AddControls. Here’s the XAML:&lt;br /&gt;
&lt;br /&gt;


&lt;br /&gt;
&lt;div style=&quot;background: white; color: black; font-family: consolas; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;x:Class&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;WPFSample001.AddControls&lt;/span&gt;“&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;http://schemas.microsoft.com/winfx/2006/xaml/presentation&lt;/span&gt;“&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;xmlns:x&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/span&gt;“&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Title&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;AddControls&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Height&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;114&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Width&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;212&lt;/span&gt;“&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;splMain&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Button&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Name&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;btnAddMore&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;Click&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;btnAddMore_Click&lt;/span&gt;“&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;Add Another&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Button&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;StackPanel&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Window&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
And here’s what it looks like:  &lt;br /&gt;

&lt;a href=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf029.jpg&quot;&gt;&lt;img alt=&quot;wpf029&quot; height=&quot;137&quot; src=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf029-thumb.jpg?w=235&amp;amp;h=137&quot; style=&quot;border-width: 0;&quot; width=&quot;235&quot; /&gt;&lt;/a&gt; &lt;br /&gt;

A few things I’d like to point out. I’ve given a name to the 
StackPanel, so it can be manipulated in our C# code. I also added a 
handler for the Click event for the button, btnAddMore_Click. I also 
named the button, although it really wasn’t necessary for this sample.  &lt;br /&gt;

OK, make sure to build the app so intellisense will work, then let’s 
jump to the C# code behind. (You may get an error about the click 
handler for the button not being found, that’s fine just ignore it.) &lt;br /&gt;

First, we’ll create an event handler for the button, passing in the sender and routed event args, like I discussed yesterday (&lt;a href=&quot;http://arcanecode.wordpress.com/2007/09/05/the-wpf-button/&quot; target=&quot;_blank&quot;&gt;http://arcanecode.wordpress.com/2007/09/05/the-wpf-button/&lt;/a&gt;) . Then, all we have to do is create a button control and add it to the children collection of the StackPanel, like so:&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background: white; color: black; font-family: consolas; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;background-color: #ffd966;&quot;&gt; &amp;nbsp; &lt;/span&gt;&lt;span style=&quot;background-color: #ffd966; color: blue;&quot;&gt;public&lt;/span&gt;&lt;span style=&quot;background-color: #ffd966;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #ffd966; color: blue;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot;background-color: #ffd966;&quot;&gt; btnAddMore_Click(&lt;/span&gt;&lt;span style=&quot;background-color: #ffd966; color: blue;&quot;&gt;object&lt;/span&gt;&lt;span style=&quot;background-color: #ffd966;&quot;&gt; sender, &lt;/span&gt;&lt;span style=&quot;background-color: #ffd966; color: #2b91af;&quot;&gt;RoutedEventArgs&lt;/span&gt;&lt;span style=&quot;background-color: #ffd966;&quot;&gt; e)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; System.Windows.Controls.&lt;span style=&quot;color: #2b91af;&quot;&gt;Button&lt;/span&gt; newBtn = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Button&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; newBtn.Content = &lt;span style=&quot;color: #a31515;&quot;&gt;“A New Button”&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; splMain.Children.Add(newBtn);&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
Note in this example I used the fully qualified 
System.Windows.Controls, I did that just to be explicit where the Button
 came from. After a new button is created, I set it’s Content property, 
which in this case will be the text on the button.  &lt;br /&gt;

In the final line, I add it to the children collection of the 
StackPanel. When you run it, and press the “Add Another” Button, you 
will see:  &lt;br /&gt;

&lt;a href=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf030.jpg&quot;&gt;&lt;img alt=&quot;wpf030&quot; src=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf030-thumb.jpg?w=780&quot; style=&quot;border-width: 0pt;&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;

Now we have a new problem. We’ve added a button to the StackPanel, 
but clicking on it does no good as we haven’t tied it to an event 
handler. Turns out that’s pretty easy too.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ffd966;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; color: black; font-family: consolas; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; btnAddMore_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; System.Windows.Controls.&lt;span style=&quot;color: #2b91af;&quot;&gt;Button&lt;/span&gt; newBtn = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Button&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; newBtn.Content = &lt;span style=&quot;color: #a31515;&quot;&gt;“A New Button”&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; newBtn.Click += &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;RoutedEventHandler&lt;/span&gt;(newBtn_Click);&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; splMain.Children.Add(newBtn);&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
What I did was use a delegate. I added a new RoutedEventHandler and 
tied it to the click event. The code for the event is in a method named 
newBtn_Click:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: white; color: black; font-family: consolas; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; newBtn_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: #2b91af;&quot;&gt;MessageBox&lt;/span&gt;.Show(&lt;span style=&quot;color: #a31515;&quot;&gt;“New Button Clicked!”&lt;/span&gt;, &lt;span style=&quot;color: #a31515;&quot;&gt;“I got pressed.”&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
The signature for the event handler has to match the signature for a 
Click event, since that’s what we’re routing to. Here, all I do is 
display a message box just so you can see something got done. Run it 
again and press the Add Another button, and the “A New Button” should 
appear. Press the new button and you should see a message box.  &lt;br /&gt;

&lt;a href=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf031.jpg&quot;&gt;&lt;img alt=&quot;wpf031&quot; height=&quot;171&quot; src=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf031-thumb.jpg?w=408&amp;amp;h=171&quot; style=&quot;border-width: 0;&quot; width=&quot;408&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;

Finally, I want to be clear you can use this technique to add any sort of control. Here I’ve added a Label as well as a button:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: white; color: black; font-family: consolas; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; btnAddMore_Click(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;RoutedEventArgs&lt;/span&gt; e)&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; {&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; System.Windows.Controls.&lt;span style=&quot;color: #2b91af;&quot;&gt;Button&lt;/span&gt; newBtn = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Button&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; newBtn.Content = &lt;span style=&quot;color: #a31515;&quot;&gt;“A New Button”&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; newBtn.Click += &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;RoutedEventHandler&lt;/span&gt;(newBtn_Click);&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; splMain.Children.Add(newBtn);&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; System.Windows.Controls.&lt;span style=&quot;color: #2b91af;&quot;&gt;Label&lt;/span&gt; newLbl = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;Label&lt;/span&gt;();&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; newLbl.Content = &lt;span style=&quot;color: #a31515;&quot;&gt;“Hi Mom!”&lt;/span&gt;;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; splMain.Children.Add(newLbl);&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &amp;nbsp; }&lt;/div&gt;
&lt;div style=&quot;margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;a href=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf032.jpg&quot;&gt;&lt;img alt=&quot;wpf032&quot; height=&quot;137&quot; src=&quot;http://arcanecode.files.wordpress.com/2007/09/wpf032-thumb.jpg?w=235&amp;amp;h=137&quot; style=&quot;border-color: -moz-use-text-color; border-right: 0pt none; border-style: none; border-width: 0pt;&quot; width=&quot;235&quot; /&gt;&lt;/a&gt; &lt;br /&gt;

&lt;br /&gt;
I could have created the entire form in C# (or VB.Net) code, adding 
the StackPanel directly to the “this” object. However, that gets a bit 
laborious, and I wouldn’t recommend it as a general practice. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/6226076500878595551/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/wpf-controls-progrrammatically.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6226076500878595551'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6226076500878595551'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/wpf-controls-progrrammatically.html' title='WPF Controls Progrrammatically'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-9141818547845736526</id><published>2012-06-24T10:51:00.002-07:00</published><updated>2012-06-24T10:51:11.545-07:00</updated><title type='text'>Full Text Search In Sql Server 2008</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
The first query simply returns a list of all of the catalogs in the system.
&lt;br /&gt;
&lt;div style=&quot;background: white; color: black; font-family: courier new; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;– Get current list of full text catalogs&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;select &lt;/span&gt;[name] &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;CatalogName&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , path&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , is_default&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;sys.fulltext_catalogs&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;order by &lt;/span&gt;[name];&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599;&quot;&gt;
The next query returns a list of all the StopLists.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 229, 153); color: black; font-family: courier new; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;– Get the list of StopLists&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;select &lt;/span&gt;stoplist_id&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , &lt;span style=&quot;color: blue;&quot;&gt;name &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;sys.fulltext_stoplists;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599;&quot;&gt;
This query returns a list of StopWords in the database. Note the linking to get the associated StopList name and language.&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 229, 153); color: black; font-family: courier new; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;– Get list of StopWords&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;select &lt;/span&gt;sl.name &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;StopListName&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , sw.stopword &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;StopWord&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , lg.alias &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;LanguageAlias&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , lg.name&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;LanguageName&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; , lg.lcid&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;LanguageLCID&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;sys.fulltext_stopwords sw&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;join &lt;/span&gt;sys.fulltext_stoplists sl &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;sl.stoplist_id = sw.stoplist_id&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;join &lt;/span&gt;master.sys.syslanguages lg &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;lg.lcid = sw.language_id; &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
This next query gets a list of all of the stopwords that ship with 
SQL Server 2008. This is a nice improvement, you can not do this in SQL 
Server 2005.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ffd966;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: white; color: black; font-family: courier new; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;– Get a list of the System provided stopwords &lt;/span&gt;&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;select &lt;/span&gt;ssw.stopword&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , slg.name&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;sys.fulltext_system_stopwords ssw&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;join &lt;/span&gt;sys.fulltext_languages slg &lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;slg.lcid = ssw.language_id;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966; margin: 0pt;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
My next query returns a list of all the Full Text Indexes in the database.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #ffd966;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background: none repeat scroll 0% 0% rgb(255, 217, 102); color: black; font-family: courier new; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;– List full text indexes&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;select &lt;/span&gt;c.name &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;CatalogName&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , t.name &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;TableName&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , idx.name &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;UniqueIndexName&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , &lt;span style=&quot;color: blue;&quot;&gt;case &lt;/span&gt;i.is_enabled &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;when &lt;/span&gt;1 &lt;span style=&quot;color: blue;&quot;&gt;then &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Enabled’ &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;else &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Not Enabled’ &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;end as &lt;/span&gt;IsEnabled&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , i.change_tracking_state_desc&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , sl.name &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;StopListName &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;sys.fulltext_indexes i&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;join &lt;/span&gt;sys.fulltext_catalogs c &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;i.fulltext_catalog_id = c.fulltext_catalog_id&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;join &lt;/span&gt;sys.tables t &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;i.object_id = t.object_id&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;join &lt;/span&gt;sys.indexes idx &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;i.unique_index_id = idx.index_id&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;and &lt;/span&gt;i.object_id = idx.object_id&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;left join &lt;/span&gt;sys.fulltext_stoplists sl &lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;sl.stoplist_id = i.stoplist_id&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
This query returns a list of all the document types SQL Server 2008 understands when they are placed in a varbinary(max) field.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: white; color: black; font-family: courier new; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;– List all of the document types SQL Server 2008 will understand in varbinary(max) field&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;select &lt;/span&gt;document_type&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , path&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , [version]&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , manufacturer &lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;sys.fulltext_document_types;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
If your full text performance begins to suffer over time, you might 
want to check and see how many fragments exist. If you have multiple 
closed fragments, you should consider doing a REORGANIZE on the index 
(using alter fulltext index). This query will tell you how many 
fragments exist for your full text index.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background: white; color: black; font-family: courier new; font-size: 10pt;&quot;&gt;

&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;– See how many fragments exist for each full text index.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: green;&quot;&gt;– If multiple closed fragments exist for a table do a REORGANIZE to help performance&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;select &lt;/span&gt;t.name &lt;span style=&quot;color: blue;&quot;&gt;as &lt;/span&gt;TableName&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , f.data_size&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , f.row_count&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; , &lt;span style=&quot;color: blue;&quot;&gt;case &lt;/span&gt;f.status&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;when &lt;/span&gt;0 &lt;span style=&quot;color: blue;&quot;&gt;then &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Newly created and not yet used’&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;when &lt;/span&gt;1 &lt;span style=&quot;color: blue;&quot;&gt;then &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Being used for insert’&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;when &lt;/span&gt;4 &lt;span style=&quot;color: blue;&quot;&gt;then &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Closed ready for query’&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;when &lt;/span&gt;6 &lt;span style=&quot;color: blue;&quot;&gt;then &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Being used for merge inpurt and ready for query’&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;when &lt;/span&gt;8 &lt;span style=&quot;color: blue;&quot;&gt;then &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Marked for deletion. Will not be used for query and merge source’&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;else &lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;‘Unknown status code’&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;end&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;from &lt;/span&gt;sys.fulltext_index_fragments f&lt;/div&gt;
&lt;div style=&quot;background-color: #ffe599; margin: 0pt;&quot;&gt;
&amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;join &lt;/span&gt;sys.tables t &lt;span style=&quot;color: blue;&quot;&gt;on &lt;/span&gt;f.table_id = t.object_id;&lt;/div&gt;
&lt;div style=&quot;margin: 0;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
There you go, a handful of powerful queries to help you query and maintain the state of your full text indexes. &lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/9141818547845736526/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/full-text-search-in-sql-server-2008.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/9141818547845736526'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/9141818547845736526'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/full-text-search-in-sql-server-2008.html' title='Full Text Search In Sql Server 2008'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-8018380806783845125</id><published>2012-06-24T10:40:00.003-07:00</published><updated>2012-06-24T10:40:38.417-07:00</updated><title type='text'>Upload File Form in php</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h2&gt;

This below code allow user to upload image in web page that made in php program language ..&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;

&lt;/h2&gt;
&lt;b&gt;html code :&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&amp;lt;html&amp;gt;&lt;br /&gt;
&amp;lt;body&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;form action=&quot;upload_file.php&quot; method=&quot;post&quot;&lt;br /&gt;
enctype=&quot;multipart/form-data&quot;&amp;gt;&lt;br /&gt;
&amp;lt;label for=&quot;file&quot;&amp;gt;Filename:&amp;lt;/label&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;file&quot; name=&quot;file&quot; id=&quot;file&quot; /&amp;gt; &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/form&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/body&amp;gt;&lt;br /&gt;
&amp;lt;/html&amp;gt;&amp;nbsp;

&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
the following about the HTML form above:
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;The enctype attribute of the &amp;lt;form&amp;gt; tag specifies which content-type to use when 
 submitting the form. &quot;multipart/form-data&quot; is used when a form requires 
 binary data, like the contents of a file, to be uploaded&lt;/li&gt;
&lt;li&gt;The type=&quot;file&quot; attribute of the &amp;lt;input&amp;gt; tag specifies that the input should 
 be processed as a file. For example, when viewed in a browser, there will be 
 a browse-button next to the input field&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Note:&lt;/b&gt; Allowing users to upload files is a big security risk. Only permit 
trusted users 
to perform file uploads.&lt;br /&gt;
&lt;br /&gt;

&lt;hr /&gt;


&lt;h2&gt;
Create The Upload Script&lt;/h2&gt;
The &quot;&lt;b&gt;upload_file.php&lt;/b&gt;&quot; file contains the code for uploading a file:&lt;br /&gt;
&lt;br /&gt;

&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;


&amp;lt;?php&lt;br /&gt;
if ($_FILES[&quot;file&quot;][&quot;error&quot;] &amp;gt; 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Error: &quot; . $_FILES[&quot;file&quot;][&quot;error&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Upload: &quot; . $_FILES[&quot;file&quot;][&quot;name&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Type: &quot; . $_FILES[&quot;file&quot;][&quot;type&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Size: &quot; . ($_FILES[&quot;file&quot;][&quot;size&quot;] / 1024) . &quot; Kb&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Stored in: &quot; . $_FILES[&quot;file&quot;][&quot;tmp_name&quot;];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
?&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;&lt;/div&gt;
&lt;/div&gt;
By using the global PHP $_FILES array you can upload files from a client computer to 
the remote server.&lt;br /&gt;

The first parameter is the form&#39;s input name and the second index can be 
either &quot;name&quot;, &quot;type&quot;, &quot;size&quot;, &quot;tmp_name&quot; or &quot;error&quot;. Like this:&lt;br /&gt;

&lt;ul&gt;
&lt;li&gt;&lt;b&gt;$_FILES[&quot;file&quot;][&quot;name&quot;] &lt;/b&gt;- the name of the uploaded file&lt;/li&gt;
&lt;li&gt;&lt;b&gt;$_FILES[&quot;file&quot;][&quot;type&quot;] &lt;/b&gt;- the type of the uploaded file&lt;/li&gt;
&lt;li&gt;&lt;b&gt;$_FILES[&quot;file&quot;][&quot;size&quot;] &lt;/b&gt;- the size in bytes of the uploaded file&lt;/li&gt;
&lt;li&gt;&lt;b&gt;$_FILES[&quot;file&quot;][&quot;tmp_name&quot;]&lt;/b&gt; - the name of the temporary copy of 
 the file stored on the server&lt;/li&gt;
&lt;li&gt;&lt;b&gt;$_FILES[&quot;file&quot;][&quot;error&quot;] &lt;/b&gt;- the error code resulting from the file 
 upload&lt;/li&gt;
&lt;/ul&gt;
This is a very simple way of uploading files. For security reasons, you 
should add 
restrictions on what the user is allowed to upload.&lt;br /&gt;

&lt;hr /&gt;


&lt;h2&gt;
Restrictions on Upload&lt;/h2&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
In this script we add some restrictions to the file upload. The user may only upload 
.gif or .jpeg files and the file size must be under 20 kb:&lt;/div&gt;
&lt;div class=&quot;code notranslate&quot; style=&quot;background-color: #f1c232;&quot;&gt;
&lt;div&gt;


&amp;lt;?php&lt;br /&gt;
if ((($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image/gif&quot;)&lt;br /&gt;
|| ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image/jpeg&quot;)&lt;br /&gt;
|| ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image/pjpeg&quot;))&lt;br /&gt;
&amp;amp;&amp;amp; ($_FILES[&quot;file&quot;][&quot;size&quot;] &amp;lt; 20000))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;if ($_FILES[&quot;file&quot;][&quot;error&quot;] &amp;gt; 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Error: &quot; . $_FILES[&quot;file&quot;][&quot;error&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Upload: &quot; . $_FILES[&quot;file&quot;][&quot;name&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Type: &quot; . $_FILES[&quot;file&quot;][&quot;type&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Size: &quot; . ($_FILES[&quot;file&quot;][&quot;size&quot;] / 1024) . &quot; Kb&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Stored in: &quot; . $_FILES[&quot;file&quot;][&quot;tmp_name&quot;];&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Invalid file&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
?&amp;gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;b&gt;Note:&lt;/b&gt; For IE to recognize jpg files the type must be pjpeg, for 
FireFox it must be jpeg.&lt;br /&gt;

&lt;hr /&gt;


&lt;h2&gt;
Saving the Uploaded File&lt;/h2&gt;
The examples above create a temporary copy of the uploaded files in the PHP 
temp folder on the server.&lt;br /&gt;

The temporary copied files disappears when the script ends. To store the 
uploaded file we need to copy it to a different location:&lt;br /&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;code notranslate&quot;&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;


&amp;lt;?php&lt;br /&gt;
if ((($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image/gif&quot;)&lt;br /&gt;
|| ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image/jpeg&quot;)&lt;br /&gt;
|| ($_FILES[&quot;file&quot;][&quot;type&quot;] == &quot;image/pjpeg&quot;))&lt;br /&gt;
&amp;amp;&amp;amp; ($_FILES[&quot;file&quot;][&quot;size&quot;] &amp;lt; 20000))&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;if ($_FILES[&quot;file&quot;][&quot;error&quot;] &amp;gt; 0)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Return Code: &quot; . $_FILES[&quot;file&quot;][&quot;error&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Upload: &quot; . $_FILES[&quot;file&quot;][&quot;name&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Type: &quot; . $_FILES[&quot;file&quot;][&quot;type&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Size: &quot; . ($_FILES[&quot;file&quot;][&quot;size&quot;] / 1024) . &quot; Kb&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo &quot;Temp file: &quot; . $_FILES[&quot;file&quot;][&quot;tmp_name&quot;] . &quot;&amp;lt;br /&amp;gt;&quot;;&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (file_exists(&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;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;echo $_FILES[&quot;file&quot;][&quot;name&quot;] . &quot; already exists. &quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;else&lt;br /&gt;
&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;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;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
else&lt;br /&gt;
&amp;nbsp;&amp;nbsp;{&lt;br /&gt;
&amp;nbsp;&amp;nbsp;echo &quot;Invalid file&quot;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;}&lt;br /&gt;
?&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
The script above checks if the file already exists, if it does not, it copies the file to the specified folder.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/8018380806783845125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/upload-file-form-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/8018380806783845125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/8018380806783845125'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/upload-file-form-in-php.html' title='Upload File Form in php'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-2214361339457042091</id><published>2012-06-24T10:29:00.001-07:00</published><updated>2012-06-24T10:37:19.078-07:00</updated><title type='text'>make rss feed in asp.net</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div class=&quot;abstract&quot;&gt;
Using the XmlTextWrite to output an XML file that serves as an RSS feed.
  &lt;/div&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;using System.Data.SqlClient;
using System.Text;
using System.Xml;
...
int copyrightyear = DateTime.Now.Year;
Response.Clear();
Response.ContentType = &quot;text/xml&quot;;
XmlTextWriter writer = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
writer.WriteStartDocument();
writer.WriteStartElement(&quot;rss&quot;);
writer.WriteAttributeString(&quot;version&quot;, &quot;2.0&quot;);
writer.WriteStartElement(&quot;channel&quot;);
writer.WriteElementString(&quot;title&quot;, &quot;Mikesdotnetting News Feed&quot;);
writer.WriteElementString(&quot;link&quot;, 
  &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&quot;http://www.mikesdotnetting.com/rss.aspx&quot;);
writer.WriteElementString(&quot;description&quot;, 
  &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&quot;Latest additions to the rubbish that appears on Mikesdotnetting.com.&quot;);
writer.WriteElementString(&quot;copyright&quot;, &quot;(c) &quot; + copyrightyear.ToString() +
  &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&quot;, Mikesdotnetting. All rights reserved.&quot;);
string connectionString = Utils.GetConnString();
using (SqlConnection conn = new SqlConnection(connectionString))
{
  using (SqlCommand objCommand = new SqlCommand(&quot;GetRss&quot;, conn))
  {
    objCommand.CommandType = CommandType.StoredProcedure;
    conn.Open();
    using (SqlDataReader objReader = objCommand.ExecuteReader())
    {
      while (objReader.Read())
      {
        writer.WriteStartElement(&quot;item&quot;);
        writer.WriteElementString(&quot;title&quot;, objReader.GetString(1));
        writer.WriteElementString(&quot;description&quot;, objReader.GetString(2));
        writer.WriteElementString(&quot;link&quot;, &quot;http://www.mikesdotnetting.com/Article.aspx?ArticleID=
          &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&quot; + objReader.GetInt32(0).ToString());
        writer.WriteElementString(&quot;pubDate&quot;, 
          &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;objReader.GetDateTime(3).ToString(&quot;R&quot;));
        writer.WriteEndElement();
      } 
      objReader.Close();
      conn.Close();
      writer.WriteEndElement();
      writer.WriteEndElement();
      writer.WriteEndDocument();
      writer.Flush();
      writer.Close();
      Response.End();
    }
  }
}&lt;/span&gt;&lt;/b&gt;
&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/2214361339457042091/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/make-rss-feed-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2214361339457042091'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2214361339457042091'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/make-rss-feed-in-aspnet.html' title='make rss feed in asp.net'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-8715374930508435659</id><published>2012-06-24T10:23:00.004-07:00</published><updated>2012-06-24T10:23:51.961-07:00</updated><title type='text'>Rss File Code Project</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Having an RSS feed on your website is a great way of sharing your 
content with the rest of the Internet. It’s not a new technology and 
it’s probably something that you use on a daily basis. If you have a 
blog or use any form of CMS, that software will most likely handle the 
creation of your RSS feed for you.&lt;br /&gt;
Sometimes, however, it might be necessary for you to create a RSS 
feed yourself. Perhaps you have just won a new client who’s current site
 has a old bespoke CMS which they like and want to keep, but you want to
 be able to publish their updated content via RSS. Hopefully this 
tutorial will help you to achieve this.&lt;br /&gt;
&lt;h4&gt;

&lt;span class=&quot;cufon cufon-canvas&quot; style=&quot;height: 20px; width: 54px;&quot;&gt;&lt;span class=&quot;cufon-alt&quot;&gt;What &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cufon cufon-canvas&quot; style=&quot;height: 20px; width: 19px;&quot;&gt;&lt;span class=&quot;cufon-alt&quot;&gt;is &lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;cufon cufon-canvas&quot; style=&quot;height: 20px; width: 39px;&quot;&gt;&lt;span class=&quot;cufon-alt&quot;&gt;RSS?&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;
RSS, in its current form, stands for &lt;b&gt;Really Simple Syndication&lt;/b&gt;
 and is a family of web formats to publish frequently updated content. 
The RSS Feed (as it is commonly known) can then be read by the users 
feed reading software or by another website which wishes to ‘syndicate’ 
the content of that feed.&lt;br /&gt;
&lt;span id=&quot;more-86&quot;&gt;&lt;/span&gt;&lt;br /&gt;
The RSS format is based on XML that is built using standardised tags. 
Here is an example of a basic RSS document, we will be generating 
something similar using PHP later in this tutorial:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
01&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
02&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
03&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
04&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
05&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
06&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
07&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
08&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
09&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
10&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
11&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
12&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
13&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
14&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
15&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
16&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
17&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
18&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
19&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
20&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
21&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
22&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
23&lt;/div&gt;
&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
24&lt;/div&gt;
&lt;div class=&quot;line number25 index24 alt2&quot;&gt;
25&lt;/div&gt;
&lt;div class=&quot;line number26 index25 alt1&quot;&gt;
26&lt;/div&gt;
&lt;div class=&quot;line number27 index26 alt2&quot;&gt;
27&lt;/div&gt;
&lt;div class=&quot;line number28 index27 alt1&quot;&gt;
28&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;?&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;xml&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;version&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;1.0&quot;&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;encoding&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;ISO-8859-1&quot;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;rss&lt;/code&gt; &lt;code class=&quot;xml color1&quot;&gt;version&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;xml string&quot;&gt;&quot;2.0&quot;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;channel&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;My RSS feed&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;a href=&quot;http://www.mywebsite.com/&quot;&gt;http://www.mywebsite.com/&lt;/a&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;This is an example RSS feed&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;language&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;en-us&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;language&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;copyright&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;Copyright (C) 2009 mywebsite.com&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;copyright&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;item&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;My News Story 3&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;This is example news item&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;a href=&quot;http://www.mywebsite.com/news3.html&quot;&gt;http://www.mywebsite.com/news3.html&lt;/a&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;pubDate&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;Mon, 23 Feb 2009 09:27:16 +0000&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;pubDate&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;item&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;item&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;My News Story 2&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;This is example news item&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;a href=&quot;http://www.mywebsite.com/news2.html&quot;&gt;http://www.mywebsite.com/news2.html&lt;/a&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;pubDate&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;Wed, 14 Jan 2009 12:00:00 +0000&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;pubDate&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;item&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;item&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;My News Story 1&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;title&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;This is example news item&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;description&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;a href=&quot;http://www.mywebsite.com/news1.html&quot;&gt;http://www.mywebsite.com/news1.html&lt;/a&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;link&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number25 index24 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&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;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;pubDate&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;Wed, 05 Jan 2009 15:57:20 +0000&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;pubDate&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number26 index25 alt1&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;item&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number27 index26 alt2&quot;&gt;
&lt;code class=&quot;xml spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;channel&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number28 index27 alt1&quot;&gt;
&lt;code class=&quot;xml plain&quot;&gt;&amp;nbsp; &amp;lt;/&lt;/code&gt;&lt;code class=&quot;xml keyword&quot;&gt;rss&lt;/code&gt;&lt;code class=&quot;xml plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As we know, RSS is made up of standardised XML tags which you would 
normally find in a flat XML file. What we are going to do is create this
 standard XML data dynamically using PHP. This means that the URL for 
our feed will end with the .php extension, but we will tidy this up 
later in the tutorial.&lt;br /&gt;

So, lets start building the PHP script. The first thing we are going 
to do is tell PHP what type of data we would like to output (I am going 
to break each section of the script down, but I will include it in full 
at the end):&lt;br /&gt;

&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_833718&quot;&gt;
&lt;br /&gt;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
1&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
2&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;header(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;Content-Type: application/rss+xml; charset=ISO-8859-1&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
The &lt;code&gt;header()&lt;/code&gt; function that we have called is telling PHP
 to output our data using the XML MIME type as well as to use the 
ISO-8859-1 character set. This makes sure that our content is delivered 
to the users in the correct format.&lt;br /&gt;

Now we are going to define our database connection details and create
 the header XML tags for our RSS feed. I’m going to statically assign 
the feed information tags just to keep it simple, however, you may wish 
to expand on this to dynamically set these. That way, you can re-use 
this code as a function or even go a step further and use it to build 
your own PHP class. The actual feed data will be kept in a variable 
called &lt;code style=&quot;background-color: #f1c232;&quot;&gt;$rssfeed&lt;/code&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;.&lt;/span&gt;&lt;br /&gt;

&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_340452&quot;&gt;
&amp;nbsp;&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
01&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
02&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
03&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
04&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
05&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
06&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
07&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
08&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
09&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
10&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
11&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
12&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
13&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_USER&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;my_username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_PASSWORD&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;my_password&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_HOST&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;localhost&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_NAME&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;my_database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;); &lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;rss version=&quot;2.0&quot;&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;channel&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;title&amp;gt;My RSS feed&amp;lt;/title&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;link&amp;gt;&lt;a href=&quot;http://fast-technologi.blogspot.co.il/&quot; target=&quot;_blank&quot;&gt;http://www.mywebsite.com &amp;lt;/link&lt;/a&gt;&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;description&amp;gt;This is an example RSS feed&amp;lt;/description&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;language&amp;gt;en-us&amp;lt;/language&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;copyright&amp;gt;Copyright (C) 2009 mywebsite.com&amp;lt;/copyright&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
Next, we need to extract our data by looping through our MySQL database to create the &lt;code&gt;&amp;lt;item&amp;gt;&lt;/code&gt;
 tags. I’m not going to explain this part in too much details as it’s 
not point of this tutorial and you may do this differently. We are going
 to assume that our MySQL table (“mytable”) has columns called &lt;em&gt;title&lt;/em&gt;, &lt;em&gt;description&lt;/em&gt;, &lt;em&gt;link&lt;/em&gt; and &lt;em&gt;date&lt;/em&gt; which hold the relevant data:&lt;br /&gt;

&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_847649&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;span&gt;&lt;a class=&quot;toolbar_item command_help help&quot; href=&quot;http://www.carronmedia.com/create-an-rss-feed-with-php/#&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
01&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
02&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
03&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
04&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
05&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
06&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
07&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
08&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
09&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
10&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
11&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
12&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
13&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
14&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
15&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
16&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
17&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
18&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
19&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
20&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
21&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
22&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
23&lt;/div&gt;
&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
24&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&lt;span style=&quot;color: red;&quot;&gt;&amp;lt;?php &amp;nbsp; &lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$connection&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;or&lt;/code&gt; &lt;code class=&quot;php keyword&quot;&gt;die&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;Could not connect to database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;mysql_select_db(DB_NAME)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;or&lt;/code&gt; &lt;code class=&quot;php keyword&quot;&gt;die&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;Could not select database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;SELECT * FROM mytable ORDER BY date DESC&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysql_query(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;) &lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;or&lt;/code&gt; &lt;code class=&quot;php keyword&quot;&gt;die&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;Could not execute query&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;while&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$row&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysql_fetch_array(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;extract(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$row&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;item&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;title&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$title&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/title&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;description&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$description&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/description&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;link&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$link&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/link&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;pubDate&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;date&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;D, d M Y H:i:s O&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;strtotime&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$date&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) . &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/pubDate&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/item&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/channel&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/rss&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;&amp;nbsp;&lt;b style=&quot;color: red;&quot;&gt;?&amp;gt;&lt;/b&gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
The first part of this section connects to the MySQL database using 
the constants which we defined at the start of the script. Then we 
perform a basic SQL query to pull out all our data from the database in 
date order. The final part of the query, &lt;code&gt;DESC&lt;/code&gt;, ensures that the newest content will appear first in the users RSS reader.&lt;br /&gt;

Next, we look at each row of data from the results of the query using a &lt;code&gt;while&lt;/code&gt; loop. In each loop cycle, the first action performed is the &lt;code&gt;extract()&lt;/code&gt; function to create a set of variables that take the name of the columns of the database, in my case &lt;code&gt;$title&lt;/code&gt;, &lt;code&gt;$description&lt;/code&gt;, &lt;code&gt;$link&lt;/code&gt;, and &lt;code&gt;$date&lt;/code&gt;. We then add the data contained in these variables to our main &lt;code&gt;$rssfeed&lt;/code&gt; variable. When it reaches the final row of data, the &lt;code&gt;while&lt;/code&gt; loop ends and we apply the closing XML tags.&lt;br /&gt;

The final step of the script is to actually output the data we have collected. This is simply done by echoing the &lt;code&gt;$rssfeed&lt;/code&gt; variable. Here is the code in full:&lt;br /&gt;

&lt;div&gt;
&lt;div class=&quot;syntaxhighlighter  php&quot; id=&quot;highlighter_109414&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;span&gt;&lt;a class=&quot;toolbar_item command_help help&quot; href=&quot;http://www.carronmedia.com/create-an-rss-feed-with-php/#&quot;&gt;?&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;line number1 index0 alt2&quot;&gt;
01&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
02&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
03&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
04&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
05&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
06&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
07&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
08&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
09&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
10&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
11&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
12&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
13&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
14&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
15&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
16&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
17&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
18&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
19&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
20&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
21&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
22&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
23&lt;/div&gt;
&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
24&lt;/div&gt;
&lt;div class=&quot;line number25 index24 alt2&quot;&gt;
25&lt;/div&gt;
&lt;div class=&quot;line number26 index25 alt1&quot;&gt;
26&lt;/div&gt;
&lt;div class=&quot;line number27 index26 alt2&quot;&gt;
27&lt;/div&gt;
&lt;div class=&quot;line number28 index27 alt1&quot;&gt;
28&lt;/div&gt;
&lt;div class=&quot;line number29 index28 alt2&quot;&gt;
29&lt;/div&gt;
&lt;div class=&quot;line number30 index29 alt1&quot;&gt;
30&lt;/div&gt;
&lt;div class=&quot;line number31 index30 alt2&quot;&gt;
31&lt;/div&gt;
&lt;div class=&quot;line number32 index31 alt1&quot;&gt;
32&lt;/div&gt;
&lt;div class=&quot;line number33 index32 alt2&quot;&gt;
33&lt;/div&gt;
&lt;div class=&quot;line number34 index33 alt1&quot;&gt;
34&lt;/div&gt;
&lt;div class=&quot;line number35 index34 alt2&quot;&gt;
35&lt;/div&gt;
&lt;div class=&quot;line number36 index35 alt1&quot;&gt;
36&lt;/div&gt;
&lt;div class=&quot;line number37 index36 alt2&quot;&gt;
37&lt;/div&gt;
&lt;div class=&quot;line number38 index37 alt1&quot;&gt;
38&lt;/div&gt;
&lt;div class=&quot;line number39 index38 alt2&quot;&gt;
39&lt;/div&gt;
&lt;div class=&quot;line number40 index39 alt1&quot;&gt;
40&lt;/div&gt;
&lt;div class=&quot;line number41 index40 alt2&quot;&gt;
41&lt;/div&gt;
&lt;/td&gt;&lt;td class=&quot;code&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;div class=&quot;container&quot;&gt;
&lt;div class=&quot;line number1 index0 alt2&quot; style=&quot;color: red;&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number2 index1 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;header(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;Content-Type: application/rss+xml; charset=ISO-8859-1&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number3 index2 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number4 index3 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_USER&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;my_username&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number5 index4 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_PASSWORD&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;my_password&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number6 index5 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_HOST&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;localhost&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number7 index6 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;DEFINE (&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;DB_NAME&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;my_database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;); &lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number8 index7 alt1&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number9 index8 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;ISO-8859-1&quot;?&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number10 index9 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;rss version=&quot;2.0&quot;&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number11 index10 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;channel&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number12 index11 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;title&amp;gt;My RSS feed&amp;lt;/title&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number13 index12 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;link&amp;gt;&lt;a href=&quot;http://www.mywebsite.com%3c/link&quot;&gt;http://www.mywebsite.com&amp;lt;/link&lt;/a&gt;&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number14 index13 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;description&amp;gt;This is an example RSS feed&amp;lt;/description&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number15 index14 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;language&amp;gt;en-us&amp;lt;/language&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number16 index15 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;copyright&amp;gt;Copyright (C) 2009 mywebsite.com&amp;lt;/copyright&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number17 index16 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number18 index17 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$connection&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= @mysql_connect(DB_HOST, DB_USER, DB_PASSWORD)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number19 index18 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;or&lt;/code&gt; &lt;code class=&quot;php keyword&quot;&gt;die&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;Could not connect to database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number20 index19 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;mysql_select_db(DB_NAME)&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number21 index20 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;or&lt;/code&gt; &lt;code class=&quot;php keyword&quot;&gt;die&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;Could not select database&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number22 index21 alt1&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number23 index22 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;SELECT * FROM mytable ORDER BY date DESC&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number24 index23 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysql_query(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;) &lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;or&lt;/code&gt; &lt;code class=&quot;php keyword&quot;&gt;die&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;Could not execute query&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number25 index24 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number26 index25 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php keyword&quot;&gt;while&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$row&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;= mysql_fetch_array(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) {&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number27 index26 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;extract(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$row&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;);&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number28 index27 alt1&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number29 index28 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;item&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number30 index29 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;title&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$title&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/title&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number31 index30 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;description&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$description&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/description&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number32 index31 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;link&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$link&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/link&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number33 index32 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;pubDate&amp;gt;&#39;&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;. &lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;date&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&quot;D, d M Y H:i:s O&quot;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;strtotime&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$date&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;)) . &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/pubDate&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number34 index33 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/item&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number35 index34 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;}&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number36 index35 alt1&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number37 index36 alt2&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/channel&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number38 index37 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt; &lt;code class=&quot;php plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;php string&quot;&gt;&#39;&amp;lt;/rss&amp;gt;&#39;&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number39 index38 alt2&quot;&gt;
&amp;nbsp;&lt;/div&gt;
&lt;div class=&quot;line number40 index39 alt1&quot;&gt;
&lt;code class=&quot;php spaces&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/code&gt;&lt;code class=&quot;php functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;php variable&quot;&gt;$rssfeed&lt;/code&gt;&lt;code class=&quot;php plain&quot;&gt;;&lt;/code&gt;&lt;/div&gt;
&lt;div class=&quot;line number41 index40 alt2&quot; style=&quot;color: red;&quot;&gt;
&lt;code class=&quot;php plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
I mentioned earlier that I would tidy up the .php extension of the 
feed. I don’t know about you, but I find this a little bit ugly. When 
you see RSS feeds that have been generated by WordPress for example, you
 don’t see the actual file name, you just get the containing folder. To 
do this, create a folder in the root directory of the site and call it 
‘feed’. Create a file in this new folder called ‘index.php’ and copy the
 code above into it. This leaves us with a nicer looking feed URL, in 
the case of this example, http://www.mydomain.com/feed/.&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/8715374930508435659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/rss-file-code-project.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/8715374930508435659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/8715374930508435659'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/rss-file-code-project.html' title='Rss File Code Project'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-6946030623574569345</id><published>2012-06-24T10:17:00.002-07:00</published><updated>2012-06-24T10:17:12.898-07:00</updated><title type='text'>Writing a Text File</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This short piece of code demonstrates how to write a text file in 
Java. The PrinterWriter class contains a number of methods for 
outputting text to a file.  The FileWriter class is a convenience class 
for writing to a text file. It uses the default code page for the 
operating environment your virtual machine is running in. If you need to
 specify a specific code page, then you must use the OutputStreamWriter 
class instead.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre style=&quot;background-color: #f1c232;&quot;&gt;&lt;span class=&quot;gutter&quot;&gt; &lt;b&gt;1:&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;syntax2&quot;&gt;/**&lt;/span&gt;&lt;span class=&quot;syntax2&quot;&gt; Simple Program to write a text file&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;   2:&lt;/span&gt;&lt;span class=&quot;syntax2&quot;&gt;*/&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;   3:&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;   4: &lt;/span&gt;&lt;span class=&quot;syntax7&quot;&gt;import&lt;/span&gt; java.io.*;
&lt;span class=&quot;gutterH&quot;&gt;   5:&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;   6: &lt;/span&gt;&lt;span class=&quot;syntax6&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;syntax8&quot;&gt;class&lt;/span&gt; WriteText&lt;span class=&quot;syntax11&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;   7:&lt;/span&gt;    &lt;span class=&quot;syntax6&quot;&gt;public&lt;/span&gt; &lt;span class=&quot;syntax6&quot;&gt;static&lt;/span&gt; &lt;span class=&quot;syntax8&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;syntax9&quot;&gt;main&lt;/span&gt;(String[] args)&lt;span class=&quot;syntax11&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;   8:&lt;/span&gt;        &lt;span class=&quot;syntax6&quot;&gt;try&lt;/span&gt; &lt;span class=&quot;syntax11&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;   9:&lt;/span&gt;            FileWriter outFile &lt;span class=&quot;syntax11&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax6&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;syntax9&quot;&gt;FileWriter&lt;/span&gt;(args[&lt;span class=&quot;syntax12&quot;&gt;0&lt;/span&gt;]);
&lt;span class=&quot;gutterH&quot;&gt;  10:&lt;/span&gt;            PrintWriter out &lt;span class=&quot;syntax11&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;syntax6&quot;&gt;new&lt;/span&gt; &lt;span class=&quot;syntax9&quot;&gt;PrintWriter&lt;/span&gt;(outFile);
&lt;span class=&quot;gutter&quot;&gt;  11:&lt;/span&gt;            
&lt;span class=&quot;gutter&quot;&gt;  12:&lt;/span&gt;            &lt;span class=&quot;syntax1&quot;&gt;// Also could be written as follows on one line&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;  13:&lt;/span&gt;            &lt;span class=&quot;syntax1&quot;&gt;// Printwriter out = new PrintWriter(new FileWriter(args[0]));&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;  14:&lt;/span&gt;        
&lt;span class=&quot;gutterH&quot;&gt;  15:&lt;/span&gt;            &lt;span class=&quot;syntax1&quot;&gt;// Write text to file&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;  16:&lt;/span&gt;            out.&lt;span class=&quot;syntax9&quot;&gt;println&lt;/span&gt;(&lt;span class=&quot;syntax3&quot;&gt;&quot;This is line 1&quot;&lt;/span&gt;);
&lt;span class=&quot;gutter&quot;&gt;  17:&lt;/span&gt;            out.&lt;span class=&quot;syntax9&quot;&gt;println&lt;/span&gt;(&lt;span class=&quot;syntax3&quot;&gt;&quot;This is line 2&quot;&lt;/span&gt;);
&lt;span class=&quot;gutter&quot;&gt;  18:&lt;/span&gt;            out.&lt;span class=&quot;syntax9&quot;&gt;print&lt;/span&gt;(&lt;span class=&quot;syntax3&quot;&gt;&quot;This is line3 part 1, &quot;&lt;/span&gt;);
&lt;span class=&quot;gutter&quot;&gt;  19:&lt;/span&gt;            out.&lt;span class=&quot;syntax9&quot;&gt;println&lt;/span&gt;(&lt;span class=&quot;syntax3&quot;&gt;&quot;this is line 3 part 2&quot;&lt;/span&gt;);
&lt;span class=&quot;gutterH&quot;&gt;  20:&lt;/span&gt;            out.&lt;span class=&quot;syntax9&quot;&gt;close&lt;/span&gt;();
&lt;span class=&quot;gutter&quot;&gt;  21:&lt;/span&gt;        &lt;span class=&quot;syntax11&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;syntax6&quot;&gt;catch&lt;/span&gt; (IOException e)&lt;span class=&quot;syntax11&quot;&gt;{&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;  22:&lt;/span&gt;            e.&lt;span class=&quot;syntax9&quot;&gt;printStackTrace&lt;/span&gt;();
&lt;span class=&quot;gutter&quot;&gt;  23:&lt;/span&gt;        &lt;span class=&quot;syntax11&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;gutter&quot;&gt;  24:&lt;/span&gt;    &lt;span class=&quot;syntax11&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;gutterH&quot;&gt;  25:&lt;/span&gt;&lt;span class=&quot;syntax11&quot;&gt; }&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f1c232;&quot;&gt;&lt;span class=&quot;syntax11&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;pre style=&quot;background-color: #f1c232;&quot;&gt;&lt;span class=&quot;syntax11&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/6946030623574569345/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/writing-text-file.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6946030623574569345'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/6946030623574569345'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/writing-text-file.html' title='Writing a Text File'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-7436397519499237892</id><published>2012-06-24T09:58:00.000-07:00</published><updated>2012-06-24T09:58:24.428-07:00</updated><title type='text'>How to Create a JavaScript Animation</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;

JavaScript animations aren&#39;t difficult to write. Once you learn a few 
main ideas, you can create complex animations that take up as much or as
 little of the browser window as you like, including interactive content
 that degrades well for people who don&#39;t have JavaScript enabled. What&#39;s
 more, the content inside your animations will be available to search 
engines because the content is in machine-readable &lt;a href=&quot;http://webreference.com/authoring/languages/xhtml/&quot; target=&quot;_blank&quot;&gt;(X)HTML&lt;/a&gt;.&lt;br /&gt;


In this tutorial we&#39;ll start out with the basics of animation, how to 
make things move, turn animations on and off, and  determine the edges 
of the space where you want the motion to take place. All of the code in
 this tutorial has been tested on Mozilla Firefox, Windows, Linux; 
Konquerer on Linux; and MS IE on Windows.&lt;br /&gt;

&lt;h2&gt;
A Matter of Timing&lt;/h2&gt;
At some point most of us have played with a flip book to see how 
animation works. The classic flip book is a little ball that bounces 
around the field of the page as the pages flip past. The image isn&#39;t 
really moving, but  each page has the image placed slightly differently 
from the last, and our brains perceive that as movement. In TV and 
movies, the same thing happens, only without all the pages sitting in 
our hands. The images flip past our vision, one at a time, at a rate of 
24, 25 or 30 images per second, depending on the medium we are viewing 
(film, PAL video and NTSC video respectively). This is known as the 
&quot;frame rate.&quot;&lt;br /&gt;


To make an animation on the computer, we want to move an image in a 
similar way, only we don&#39;t  have &quot;frames&quot; to work with. Instead, we have
 milliseconds in which we can execute commands. We can change what&#39;s on 
the screen every millisecond in order to create the appearance of 
motion. We don&#39;t have to change the screen nearly that fast, though. The
 human eye can only register motion at a rate of approximately 24 frames
 per second. Faster than that, and the brain just doesn&#39;t recognize the 
difference. For the ease of calculation, then, it&#39;s simple to consider 
an optimum image change rate or 25 frames/1000 milliseconds. That&#39;s the 
same as saying 1/40, or 1&quot;frame&quot; change every 40 milliseconds. &lt;br /&gt;


On the Internet, we often cheat a bit, seeing exactly how far we can 
push the weaknesses in human perception to use smaller files and less 
computer power to present the same experience to the end user. It just 
so happens that for most Web animations you can get away with exactly 
half the optimal frame rate without the movement looking too choppy. So,
 for this tutorial we&#39;ll use 1 frame every 80 milliseconds. &lt;br /&gt;


In JavaScript, we have the &lt;code&gt;setTimeout()&lt;/code&gt; and &lt;code&gt;setInterval()&lt;/code&gt; functions to help us count time and create our frame rate. The function &lt;code&gt;setTimeout()&lt;/code&gt; will count the time and then run the command that you give it.  The &lt;code&gt;setInterval()&lt;/code&gt;
 function will repeat a function every time it reaches the time count 
that you have given it. Both functions count by milliseconds.&lt;br /&gt;

&lt;span name=&quot;KonaFilter&quot;&gt;
&lt;h3&gt;
Examples:&lt;/h3&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;

&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;dp-c&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;1&lt;/td&gt;&lt;td class=&quot;line1&quot;&gt;&lt;span&gt;setTimeout(&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&#39;animBall()&#39;&lt;/span&gt;&lt;span&gt;,&amp;nbsp;80);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;run&amp;nbsp;the&amp;nbsp;function&amp;nbsp;animBall&amp;nbsp;after&amp;nbsp;80&amp;nbsp;milliseconds.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;2&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;setInterval(&lt;span class=&quot;string&quot;&gt;&#39;animBall()&#39;&lt;/span&gt;&lt;span&gt;,&amp;nbsp;80);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;run&amp;nbsp;the&amp;nbsp;function&amp;nbsp;animBall()&amp;nbsp;every&amp;nbsp;80&amp;nbsp;milliseconds.&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;thead&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tools&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;

In the case of &lt;code&gt;setTimeout()&lt;/code&gt;,&lt;/div&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&amp;nbsp;if you want to run a single 
function over and over at the time count that you have set, you need to 
put the function inside of the function it calls. So you will end up 
with a function that looks something like:&lt;br /&gt;

&lt;span name=&quot;KonaFilter&quot;&gt;
&lt;div&gt;

     &lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;dp-c&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;1&lt;/td&gt;&lt;td class=&quot;line1&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;&amp;nbsp;animBall(){&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;2&lt;/td&gt;&lt;td class=&quot;line2&quot; style=&quot;background-color: #f1c232;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;setTimeout(&lt;span class=&quot;string&quot;&gt;&#39;animBall()&#39;&lt;/span&gt;&lt;span&gt;,&amp;nbsp;80);&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span class=&quot;comment&quot;&gt;//&amp;nbsp;set&amp;nbsp;the&amp;nbsp;timer&amp;nbsp;so&amp;nbsp;that&amp;nbsp;this&amp;nbsp;function&amp;nbsp;will&amp;nbsp;run&amp;nbsp;again&amp;nbsp;in&amp;nbsp;80&amp;nbsp;milliseconds&lt;/span&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;3&lt;/td&gt;&lt;td class=&quot;line1&quot; style=&quot;background-color: #f1c232;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;moveRight();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;4&lt;/td&gt;&lt;td class=&quot;line2&quot; style=&quot;background-color: #f1c232;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doOtherStuff();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;5&lt;/td&gt;&lt;td class=&quot;line1&quot; style=&quot;background-color: #f1c232;&quot;&gt;}&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;thead&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tools&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;

In the case of &lt;code&gt;setInterval()&lt;/code&gt;, the call should be made 
outside the function that you want to repeat. Otherwise, you  end up 
with multiple instances of your interval, a strange acceleration of 
movement, and a big, fat memory leak.&lt;br /&gt;

&lt;span name=&quot;KonaFilter&quot;&gt;
&lt;div&gt;

&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;dp-c&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;1&lt;/td&gt;&lt;td class=&quot;line1&quot;&gt;&lt;span&gt;&amp;lt;script&amp;nbsp;language=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;2&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;&amp;nbsp;animBall()&amp;nbsp;{&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;3&lt;/td&gt;&lt;td class=&quot;line1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;moveRight();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;4&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;doOtherStuff();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;5&lt;/td&gt;&lt;td class=&quot;line1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;6&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&amp;lt;/script&amp;gt;&amp;lt;a&amp;nbsp;href=&lt;span class=&quot;string&quot;&gt;&quot;javascript:setIntveral(&#39;animBall()&#39;,&amp;nbsp;80)&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;Start&amp;nbsp;Animation&amp;lt;/a&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;thead&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tools&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;

Chances are, at some point you&#39;ll want to stop the animation. To do so, you&#39;ll need either &lt;code&gt;clearTimeout()&lt;/code&gt; or &lt;code&gt;clearInterval()&lt;/code&gt;.
 Both of these clearing functions take a variable which represents a 
timing object, and clears it&#39;s timer. To make these work, you need to 
create the object that your clear function will stop.&lt;br /&gt;

&lt;h3&gt;
Timeout Example:&lt;/h3&gt;
&lt;span name=&quot;KonaFilter&quot;&gt;
&lt;div&gt;

&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;dp-c&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;1&lt;/td&gt;&lt;td class=&quot;line1&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;span&gt;&amp;lt;script&amp;nbsp;language=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;2&lt;/td&gt;&lt;td class=&quot;line2&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;var&lt;/span&gt;&lt;span&gt;&amp;nbsp;t;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;3&lt;/td&gt;&lt;td class=&quot;line1&quot; style=&quot;background-color: #f1c232;&quot;&gt;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;&amp;nbsp;animBall(){&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;4&lt;/td&gt;&lt;td class=&quot;line2&quot; style=&quot;background-color: #f1c232;&quot;&gt;t=setTimeout(&lt;span class=&quot;string&quot;&gt;&#39;animBall()&#39;&lt;/span&gt;&lt;span&gt;,&amp;nbsp;80);&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;5&lt;/td&gt;&lt;td class=&quot;line1&quot; style=&quot;background-color: #f1c232;&quot;&gt;moveRight();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;6&lt;/td&gt;&lt;td class=&quot;line2&quot; style=&quot;background-color: #f1c232;&quot;&gt;doOtherStuff();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;7&lt;/td&gt;&lt;td class=&quot;line1&quot; style=&quot;background-color: #f1c232;&quot;&gt;}&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot; style=&quot;background-color: #f1c232;&quot;&gt;8&lt;/td&gt;&lt;td class=&quot;line2&quot; style=&quot;background-color: #f1c232;&quot;&gt;&amp;lt;/script&amp;gt;&amp;lt;a&amp;nbsp;href=&lt;span class=&quot;string&quot;&gt;&quot;javascript:animBall()&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;Start&amp;nbsp;Animation&amp;lt;/a&amp;gt;&amp;nbsp;&amp;lt;a&amp;nbsp;href=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;javascript:clearTimeout(t)&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;Stop&amp;nbsp;Animation&amp;lt;/a&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;thead&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tools&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;
&lt;h3&gt;
Interval Example:&lt;/h3&gt;
&lt;span name=&quot;KonaFilter&quot;&gt;
&lt;div&gt;

&lt;div class=&quot;dp-highlighter&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;dp-c&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;1&lt;/td&gt;&lt;td class=&quot;line1&quot;&gt;&lt;span&gt;&amp;lt;script&amp;nbsp;language=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;javascript&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;2&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span class=&quot;keyword&quot;&gt;function&lt;/span&gt;&lt;span&gt;&amp;nbsp;animBall()&amp;nbsp;{&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;3&lt;/td&gt;&lt;td class=&quot;line1&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;moveRight();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;4&lt;/td&gt;&lt;td class=&quot;line2&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;doOtherStuff();&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;5&lt;/td&gt;&lt;td class=&quot;line1&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;gutter&quot;&gt;6&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/script&amp;gt;&amp;lt;a&amp;nbsp;href=&lt;span class=&quot;string&quot;&gt;&quot;javascript:var&amp;nbsp;t=setIntveral(&#39;animBall()&#39;,&amp;nbsp;80)&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;Start&amp;nbsp;Animation&amp;lt;/a&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;line2&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;thead&gt;
&lt;tr&gt;&lt;td class=&quot;tools-corner&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;tools&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/span&gt;
&lt;div style=&quot;float: right; margin-top: -15px;&quot;&gt;

&lt;div align=&quot;right&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;float: right; margin-top: -15px;&quot;&gt;
&lt;div align=&quot;right&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div align=&quot;right&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;a href=&quot;http://www.webreference.com/programming/javascript/java_anim/2.html&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;a href=&quot;http://www.webreference.com/programming/javascript/java_anim/3.html&quot;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div align=&quot;right&quot;&gt;
&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;right&quot;&gt;

&lt;div class=&quot;image square quad&quot;&gt;

    
&lt;span id=&quot;qsjs&quot;&gt;&lt;br /&gt;&lt;/span&gt;

&lt;/div&gt;
&lt;div id=&quot;featured_tech_jobs&quot;&gt;

&lt;/div&gt;
&lt;div class=&quot;image square quad&quot;&gt;

    
&lt;span name=&quot;KonaFilter&quot;&gt;&lt;span&gt;&amp;lt;a&amp;nbsp;href=&lt;/span&gt;&lt;span class=&quot;string&quot;&gt;&quot;javascript:clearInterval(t)&quot;&lt;/span&gt;&lt;span&gt;&amp;gt;Stop&amp;nbsp;Animation&amp;lt;/a&amp;gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;

&lt;/div&gt;
&lt;div id=&quot;ssn_widget_container&quot;&gt;

    &lt;div id=&quot;ssn_widget_header&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;ssn_widget_content&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div id=&quot;marketplace&quot;&gt;

    
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/7436397519499237892/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/how-to-create-javascript-animation.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/7436397519499237892'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/7436397519499237892'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/how-to-create-javascript-animation.html' title='How to Create a JavaScript Animation'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-3884370492445033048</id><published>2012-06-23T13:49:00.001-07:00</published><updated>2012-06-23T13:49:39.449-07:00</updated><title type='text'>Fast Technology: Application, Session, HttpContext, and ViewState</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;&lt;a href=&quot;http://fast-technologi.blogspot.co.il/2012/06/application-session-httpcontext-and.html&quot;&gt;Fast Technology: Application, Session, HttpContext, and ViewState&lt;/a&gt;: Application, Session, HttpContext, and ViewState&lt;/div&gt;</content><link rel='enclosure' type='' href='http://fast-technologi.blogspot.co.il/' length='0'/><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/3884370492445033048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/fast-technology-application-session.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3884370492445033048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/3884370492445033048'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/fast-technology-application-session.html' title='Fast Technology: Application, Session, HttpContext, and ViewState'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-2284798239151353265</id><published>2012-06-23T13:30:00.001-07:00</published><updated>2012-06-23T13:30:16.742-07:00</updated><title type='text'>Application, Session, HttpContext, and ViewState</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;h1&gt;

Application, Session, HttpContext, and ViewState Caching&lt;/h1&gt;
&lt;h3 class=&quot;docSection1Title&quot; id=&quot;title-IDAHZP5V&quot;&gt;
Application, Session, HttpContext, and ViewState Caching&lt;/h3&gt;
&lt;div class=&quot;docText&quot;&gt;
Using the &lt;tt&gt;Application, Session, HttpContext&lt;/tt&gt; and &lt;tt&gt;ViewState&lt;/tt&gt;
 objects for caching data is not a new technique, and while extremely 
simple, it shouldn&#39;t be left out or ignored because of other techniques.
 All three objects provide simple key based collections for storage of 
data through the lifetime of the object. Since this lifetime is not 
persistent, you should only store data that is ephemeral in nature; 
anything that requires long-lived storage should use a database, or 
perhaps the Profile object for user-related data.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-1&quot;&gt;&lt;/a&gt;
&lt;h4 class=&quot;docSection2Title&quot; id=&quot;title-IDAXZP5V&quot;&gt;
Using the Application State&lt;/h4&gt;
&lt;div class=&quot;docText&quot;&gt;
The Application object exists for the lifetime of the
 application; that is, from the moment the first request to the 
application is received to the moment the application is shut down. 
Application shutdown can occur under different circumstances, and you 
should be aware that it can happen while the site is being used. ASP.NET
 is self-monitoring and can restart an application if, for example, 
memory demands exceed set limits. This means that you shouldn&#39;t rely on 
an item automatically being stored in the Application object; you should
 always check for a null value.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
Using the Application object for state storage is as simple as indexing the Application object. For example:&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;pre&gt;Application[&quot;Start&quot;] = DateTime.Now;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;docText&quot;&gt;
This will add the current date and time to the Application cache, indexed by &lt;tt&gt;Start&lt;/tt&gt;. To extract the value, you use the same indexing scheme; but the application stores objects, so casting is required:&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;pre&gt;DateTime appStart = (DateTime)Application[&quot;Start&quot;];&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;part-2&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-3&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-4&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-5&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-6&quot;&gt;&lt;/a&gt;Because
 object storage is supported, you can store complex types, such as data.
 For example, a common caching pattern is to check to see if the data is
 in the cache (irrespective of which form of caching is used), and if 
it&#39;s present, return the data. If the data isn&#39;t present in the cache, 
it is fetched from its original location and stored in the cache. For 
example, consider some data from a database that is required in all 
pages, which could be stored in the application, as shown in &lt;a class=&quot;docLink&quot; href=&quot;http://codeidol.com/community/dotnet/application-session-httpcontext-and-viewstate-cach/17260/#part-7&quot; target=&quot;_blank&quot;&gt;Listing 6.1&lt;/a&gt;.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-7&quot;&gt;&lt;/a&gt;&lt;h5 class=&quot;docExampleTitle&quot; id=&quot;title-IDAD2P5V&quot;&gt;
Storing Data in the Application&lt;/h5&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;



&lt;pre&gt;DataTable cachedData = (DataTable)Application[&quot;CommonData&quot;];
if (cachedData == null)
{
  cachedData = DataLayer.FetchCommonData();
  Application[&quot;CommonData&quot;] = cachedData;
}&lt;/pre&gt;
&lt;br /&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;docText&quot;&gt;
Here the data is fetched from the &lt;tt&gt;Application&lt;/tt&gt;, which returns &lt;tt&gt;null&lt;/tt&gt; if the item isn&#39;t present, and if it isn&#39;t present, then it is fetched from the data layer and placed in the &lt;tt&gt;Application&lt;/tt&gt;
 for subsequent requests. When using this form of caching, you have to 
balance the resource use (when storing the data in the application) 
against the time taken to fetch it from its original location. 
Performance and memory monitoring tools are useful in helping you make 
this decision.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
If you know that every single page is going to use some cached data, you can use the &lt;tt&gt;Application_Start&lt;/tt&gt;
 event to load the data, because this event runs once when the 
application starts. In this situation, you wouldn&#39;t need to check for 
the cached item, because you know it wouldn&#39;t be present when the 
application is just starting. If, however, only a selected number of 
pages use the cached data, or if use of the cached data is dependent 
upon user actions, you can use the code in &lt;a class=&quot;docLink&quot; href=&quot;http://codeidol.com/community/dotnet/application-session-httpcontext-and-viewstate-cach/17260/#part-7&quot; target=&quot;_blank&quot;&gt;Listing 6.1&lt;/a&gt; to lazy load the datathat is, load it only when it is first requested and then cache it for later use.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-8&quot;&gt;&lt;/a&gt;
&lt;h4 class=&quot;docSection2Title&quot; id=&quot;title-IDAH3P5V&quot;&gt;
Using the Session State&lt;/h4&gt;
&lt;div class=&quot;docText&quot;&gt;
Session state is similar in use to Application state,
 but with one major exception: It is unique to each user of the site and
 is destroyed when the user leaves the site (after a timeout). Session 
state is therefore useful for storing data that a user would require 
throughout his or her use of the application. Bear in mind that Session 
state is intended for storage of transient datadata that &lt;a href=&quot;&quot; name=&quot;part-9&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-10&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-11&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-12&quot;&gt;&lt;/a&gt;doesn&#39;t
 need to be retained after the user leaves the site. For long-lived 
data, such as user preferences, you should use the Profile.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;a class=&quot;docLink&quot; href=&quot;http://codeidol.com/community/dotnet/application-session-httpcontext-and-viewstate-cach/17260/#part-13&quot; target=&quot;_blank&quot;&gt;Listing 6.2&lt;/a&gt; shows a common pattern for using the Session object for state storage.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-13&quot;&gt;&lt;/a&gt;&lt;h5 class=&quot;docExampleTitle&quot; id=&quot;title-IDAY4P5V&quot;&gt;
Storing Data in the Session&lt;/h5&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;



&lt;pre&gt;DataTable cachedData = (DataTable)Session[&quot;UserData&quot;];
if (cachedData == null)
{
  cachedData = DataLayer.FetchUserData();
  Session[&quot;UserData&quot;] = cachedData;
}&lt;/pre&gt;
&lt;br /&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;docText&quot;&gt;
Like the Application state, Session state takes 
resources, so you should examine your needs carefully. By default, 
Session state is enabled for applications and pages but can be turned 
off or disabled completely.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-14&quot;&gt;&lt;/a&gt;
&lt;h5 class=&quot;docSection3Title&quot; id=&quot;title-IDAJ5P5V&quot;&gt;
Disabling Session State&lt;/h5&gt;
&lt;div class=&quot;docText&quot;&gt;
Disabling Session state is a performance optimization that you can perform at several levels. In pages, you can use the &lt;tt&gt;EnableSessionState&lt;/tt&gt; attribute of the &lt;tt&gt;Page&lt;/tt&gt; directive:&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;pre&gt;&amp;lt;% Page EnableSessionState=&quot;false&quot; ... %&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;docText&quot;&gt;
Alternatively, if you require access to Session state but don&#39;t plan to update it, you can make it read-only for a page:&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;pre&gt;&amp;lt;% Page EnableSessionState=&quot;ReadOnly&quot; ... %&amp;gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;docText&quot;&gt;
This ensures that you still have access, but don&#39;t go through the overhead of locking the state for update.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-15&quot;&gt;&lt;/a&gt;
&lt;h5 class=&quot;docSection3Title&quot; id=&quot;title-IDARAQ5V&quot;&gt;
Configuring Session State&lt;/h5&gt;
&lt;div class=&quot;docText&quot;&gt;
At the application level, you configure Session state in web.config, as seen in &lt;a class=&quot;docLink&quot; href=&quot;http://codeidol.com/community/dotnet/application-session-httpcontext-and-viewstate-cach/17260/#part-42&quot; target=&quot;_blank&quot;&gt;Listing 6.3&lt;/a&gt;.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
The attributes are documented in &lt;a class=&quot;docLink&quot; href=&quot;http://codeidol.com/community/dotnet/application-session-httpcontext-and-viewstate-cach/17260/#part-16&quot; target=&quot;_blank&quot;&gt;Figure&lt;/a&gt;.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-16&quot;&gt;&lt;/a&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot; class=&quot;allBorders&quot; rules=&quot;groups&quot;&gt;&lt;caption&gt;&lt;h5 class=&quot;docTableTitle&quot;&gt;
Attributes of SessionState Configuration&lt;/h5&gt;
&lt;/caption&gt;&lt;colgroup align=&quot;left&quot; span=&quot;2&quot;&gt;&lt;col width=&quot;100&quot;&gt;&lt;/col&gt;&lt;col width=&quot;400&quot;&gt;&lt;/col&gt;&lt;/colgroup&gt;&lt;thead&gt;
&lt;tr&gt;&lt;th align=&quot;left&quot; class=&quot;bottomBorder thead&quot; scope=&quot;col&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;part-17&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-18&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-19&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-20&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-21&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-22&quot;&gt;&lt;/a&gt;Attribute&lt;/div&gt;
&lt;/th&gt;&lt;th align=&quot;left&quot; class=&quot;bottomBorder thead&quot; scope=&quot;col&quot; valign=&quot;bottom&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Description&lt;/div&gt;
&lt;/th&gt;&lt;/tr&gt;
&lt;/thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;allowCustomSqlDatabase&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Only relevant when mode is set to &lt;tt&gt;SQLServer&lt;/tt&gt;, and indicates whether or not a custom database name can be specified in the &lt;tt&gt;Initial Catalog&lt;/tt&gt; attribute of the SQL Server connection string. The default value is &lt;tt&gt;false&lt;/tt&gt;, meaning the default ASP.NET session database is used.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;cookieless&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Indicates how cookies are used, and can be one of:&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;AutoDetect&lt;/tt&gt;, where ASP.NET determines whether
 the requesting device supports cookies. If so, then cookies are used; 
otherwise the query string is changed to include the session identifier.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;UseCookies&lt;/tt&gt;, where cookies are always used. This is the default value.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;UseDeviceProfile&lt;/tt&gt;, where ASP.NET uses the browser capabilities to determine whether cookies should be used.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;UseUri&lt;/tt&gt;, where the query string is always used.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;true&lt;/tt&gt;, which has the same effect as &lt;tt&gt;UseUri&lt;/tt&gt;.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;false&lt;/tt&gt;, which has the same effect as &lt;tt&gt;UseCookies&lt;/tt&gt;.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;cookieName&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Defines the default cookie name used to store the session ID. The default value is &lt;tt&gt;ASP.NET_SessionId&lt;/tt&gt;.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;customProvider&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Indicates the name of the provider when the mode is &lt;tt&gt;Custom&lt;/tt&gt;. The &lt;tt&gt;name&lt;/tt&gt; attribute should match one of the provider names declared in the &lt;tt&gt;&amp;lt;Providers/&amp;gt;&lt;/tt&gt; section, and defaults to an empty string.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;mode&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Indicates how session state is being managed, and can be one of:&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;Custom&lt;/tt&gt;, which indicates that session state is stored in a custom manner.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;InProc&lt;/tt&gt;, where session state is stored within the ASP.NET process. This is the default value.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;Off&lt;/tt&gt;, where session state is turned off for the application.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;SQLServer&lt;/tt&gt;, where session state is stored in a SQL Server database.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;StateServer&lt;/tt&gt;, where session state is stored in a separate ASP.NET State Service.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;part-23&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-24&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-25&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-26&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-27&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-28&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-29&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-30&quot;&gt;&lt;/a&gt;&lt;tt&gt;partitionResolverType&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Defines
 a type to be used to resolve the connection string for the request. 
Resolvers are used to enable session state to be partitioned to scale in
 Web Farm situations. If this attribute is set, the &lt;tt&gt;sqlConnectionString&lt;/tt&gt; and &lt;tt&gt;stateConnectionString&lt;/tt&gt; attributes are ignored. The default value is an empty string.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;regenerateExpiredSessionId&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Indicates
 whether or not the session identifier will be reissued when an invalid 
identifier is used by the client. The default value is &lt;tt&gt;true&lt;/tt&gt;, where identifiers are only reissued when cookies aren&#39;t being used.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;sqlCommandTimeout&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Indicates, in seconds, the timeout for a SQL command when the mode is &lt;tt&gt;SQLServer&lt;/tt&gt;. The default value is 30.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;sqlConnectionString&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Indicates the name of the connection string when using SQL Server to store session state. The default value is &lt;tt&gt;&quot;data source=127.0.0.1; Integrated Security=SSPI&quot;&lt;/tt&gt;, pointing at a local, trusted SQL Server database.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;stateConnectionString&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Required when &lt;tt&gt;mode&lt;/tt&gt; is &lt;tt&gt;StateServer&lt;/tt&gt;, and defines the server name/address and port where session state is stored. The default value is &lt;tt&gt;&quot;127.0.0.1:42424&quot;&lt;/tt&gt;.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;stateNetworkTimeout&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
For when &lt;tt&gt;mode&lt;/tt&gt; is &lt;tt&gt;StateServer&lt;/tt&gt;, and defines the number of seconds to wait for the remote state server before the request is cancelled. The default value is &lt;tt&gt;10&lt;/tt&gt; seconds.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;timeout&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;bottomBorder&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Defines
 the number of minutes to wait after session activity (i.e., idle time) 
before the session is abandoned. The default value is &lt;tt&gt;20&lt;/tt&gt; minutes.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td align=&quot;left&quot; class=&quot;docTableCell&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
&lt;tt&gt;useHostingIdentity&lt;/tt&gt;&lt;/div&gt;
&lt;/td&gt;&lt;td align=&quot;left&quot; class=&quot;docTableCell&quot; valign=&quot;top&quot;&gt;&lt;div class=&quot;docText&quot;&gt;
Indicates whether or not session state will revert to the hosting identity or use client impersonation. The default value is &lt;tt&gt;true&lt;/tt&gt;,
 indicating that the identity of the hosting process (ASPNET on IIS5 or 
NETWORK SERVER on IIS6) or the identity specified in the process 
&amp;lt;identity&amp;gt; section is used. If false, the credentials of the 
current OS thread are used.&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div class=&quot;docText&quot;&gt;
You can see that there are a number of ways in which 
Session state can be stored. By default, the ASP.NET process stores the 
state, because this provides the fastest storage. However, because it is
 process-bound, Session state would not survive an application restart, 
which is where the state server and &lt;a href=&quot;&quot; name=&quot;part-31&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-32&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-33&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-34&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-35&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-36&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-37&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-38&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-39&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-40&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-41&quot;&gt;&lt;/a&gt;database
 options come in. The downsides of these, however, are that performance 
is slower than with the in-process method. For more detailed information
 on session state and performance, there is an excellent article in the 
MSDN Magazine, available online at &lt;span class=&quot;docEmphStrong&quot;&gt;&lt;a class=&quot;docLink&quot; href=&quot;http://msdn.microsoft.com/msdnmag/issues/05/09/SessionState/default.aspx&quot; target=&quot;_blank&quot;&gt;http://msdn.microsoft.com/msdnmag/issues/05/09/SessionState/default.aspx&lt;/a&gt;&lt;/span&gt;.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-42&quot;&gt;&lt;/a&gt;&lt;h5 class=&quot;docExampleTitle&quot; id=&quot;title-IDAKQQ5V&quot;&gt;
Session State Configuration&lt;/h5&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;



&lt;pre&gt;&amp;lt;sessionState
  allowCustomSqlDatabase=&quot;[true|false]&quot;
  cookieless=&quot;[AutoDetect|UseCookies|UseDeviceProfile|
               UseUri|true|false]&quot;
  cookieName=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;String&lt;/span&gt;&quot;
  customProvider=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;String&lt;/span&gt;&quot;
  mode=&quot;[Custom|InProc|Off|StateServer|SQLServer|]&quot;
  partitionResolverType=&quot;String&quot;
  regenerateExpiredSessionId=&quot;[true|false]&quot;
  sessionIdManagerType=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;String&lt;/span&gt;&quot;
  sqlCommandTimeout=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;Integer&lt;/span&gt;&quot;
  sqlConnectionString=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;String&lt;/span&gt;&quot;
  stateConnectionString=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;String&lt;/span&gt;&quot;
  stateNetworkTimeout=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;Integer&lt;/span&gt;&quot;
  timeout=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;Integer&lt;/span&gt;&quot;
  useHostingIdentity=&quot;[true|false]&quot;
  &amp;gt;
  &amp;lt;providers&amp;gt;
    &amp;lt;clear /&amp;gt;
    &amp;lt;add
      Name=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;String&lt;/span&gt;&quot;
      Type=&quot;&lt;span class=&quot;docEmphasis&quot;&gt;String&lt;/span&gt;&quot;
      [&lt;span class=&quot;docEmphasis&quot;&gt;providerSpecificConfiguration&lt;/span&gt;] /&amp;gt;
  &amp;lt;/providers&amp;gt;
&amp;lt;/sessionState&amp;gt;&lt;/pre&gt;
&lt;br /&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;a href=&quot;&quot; name=&quot;part-43&quot;&gt;&lt;/a&gt;&lt;div class=&quot;docNote&quot;&gt;

&lt;br /&gt;
&lt;div class=&quot;docText&quot;&gt;
The SessionState configuration element should not
 be confused with the SessionPageState element, which is used to keep a 
history of view state and control state within the session.&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;


&lt;a href=&quot;&quot; name=&quot;part-44&quot;&gt;&lt;/a&gt;
&lt;h4 class=&quot;docSection2Title&quot; id=&quot;title-IDAYRQ5V&quot;&gt;
Using HttpContext&lt;/h4&gt;
&lt;div class=&quot;docText&quot;&gt;
If you don&#39;t need to store data across an entire 
session, but perhaps require data across multiple user controls within a
 page, then you can use the current context of the request. Each request
 has an associated &lt;tt&gt;HttpContext&lt;/tt&gt; object associated with it, which
 provides access to many objects used within pages, such as the Request,
 Profile, and Trace. Also available on the context is an &lt;a href=&quot;&quot; name=&quot;part-45&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-46&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-47&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-48&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-49&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-50&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-51&quot;&gt;&lt;/a&gt;&lt;tt&gt;Items&lt;/tt&gt;
 collection that can be used for storage and is particularly useful when
 you have multiple user controls on a page that need to share data. It 
is important to realize that this technique is only useful between 
controls within a single end-to-end request and that it does not apply 
between separate page requests.&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
For example, consider two grids that use the same 
data. You could use the data source controls and their built-in caching,
 but if you have an existing code library and need to bind in code, you 
might have the code shown in &lt;a class=&quot;docLink&quot; href=&quot;http://codeidol.com/community/dotnet/application-session-httpcontext-and-viewstate-cach/17260/#part-52&quot; target=&quot;_blank&quot;&gt;Listing 6.4&lt;/a&gt; in both user controls:&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-52&quot;&gt;&lt;/a&gt;&lt;h5 class=&quot;docExampleTitle&quot; id=&quot;title-IDAEUQ5V&quot;&gt;
Simple Binding to a Business Layer&lt;/h5&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;



&lt;pre&gt;protected void Page_Load(object sender, EventArgs e)
{
  if (!Page.IsPostBack)
  {
    GridView3.DataSource = Shippers.GetShippers();
    GridView3.DataBind();
  }
}&lt;/pre&gt;
&lt;br /&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;docText&quot;&gt;
This code, if used in multiple user controls, would 
result in the same SQL command being run multiple times. There are 
several ways to cure this, and we&#39;ll look at others later in the 
chapter, but a simple solution would be for one control to read the data
 and cache it in the context. Rather than explicitly putting the code 
into your user control (which would limit the order of the controls on 
the page to ensure that the one that cached the data was executed 
first), you could create a central class, as shown in &lt;a class=&quot;docLink&quot; href=&quot;http://codeidol.com/community/dotnet/application-session-httpcontext-and-viewstate-cach/17260/#part-53&quot; target=&quot;_blank&quot;&gt;Listing 6.5&lt;/a&gt;.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-53&quot;&gt;&lt;/a&gt;&lt;h5 class=&quot;docExampleTitle&quot; id=&quot;title-IDA5UQ5V&quot;&gt;
A Caching Class Using the HttpContext&lt;/h5&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;5&quot; cellspacing=&quot;0&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;



&lt;pre&gt;public static class Caching
{
  public static List&amp;lt;Shipper&amp;gt; GetShippers()
  {
    List&amp;lt;Shipper&amp;gt; ships =
        (List&amp;lt;Shipper&amp;gt;)HttpContext.Current.Items[&quot;Shippers&quot;];
    if (ships == null)
    {
      ships = Shippers.GetItems();
      HttpContext.Current.Items[&quot;Shippers&quot;] = ships;
    }
    return ships;
  }
}&lt;/pre&gt;
&lt;br /&gt;

&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;a href=&quot;&quot; name=&quot;part-54&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-55&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-56&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-57&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-58&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-59&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-60&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-61&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-62&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-63&quot;&gt;&lt;/a&gt;&lt;a href=&quot;&quot; name=&quot;part-64&quot;&gt;&lt;/a&gt;This code is extremely simple and follows the by-now familiar pattern used in caching. It first fetches the data from the &lt;tt&gt;Items&lt;/tt&gt; collection, and if it&#39;s not present in the cache, gets the data from the Shippers business class and stores it in the &lt;tt&gt;Items&lt;/tt&gt; collection. Subsequent calls will fetch it from the collection.&lt;/div&gt;
&lt;a href=&quot;&quot; name=&quot;part-65&quot;&gt;&lt;/a&gt;
&lt;h4 class=&quot;docSection2Title&quot; id=&quot;title-IDAYXQ5V&quot;&gt;
Using ViewState&lt;/h4&gt;
&lt;div class=&quot;docText&quot;&gt;
Another method of caching data is to use ViewState, 
although this does come with the warning that ViewState is transferred 
to and from the client on each request. The ViewState can be accessed 
just like other collections:&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;docText&quot;&gt;
&lt;pre&gt;ViewState[&quot;CachedData&quot;] = DateTime.Now;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;docText&quot;&gt;
You should generally try to use as little ViewState 
caching as possible in order to reduce overheads in transferring pages, 
but it does provide an alternative storage mechanism for small amounts 
of data. For best performance, you should turn off ViewState for 
controls and pages that don&#39;t require it. ASP.NET 2.0 supports a new 
feature for state storage, Control-State, which controls use to support 
the minimum state requirements for the control to operate. This allows 
ViewState to be turned off but for the control to still operate 
correctly.&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/2284798239151353265/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/application-session-httpcontext-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2284798239151353265'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2284798239151353265'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/application-session-httpcontext-and.html' title='Application, Session, HttpContext, and ViewState'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-4251141147116251717</id><published>2012-06-23T12:23:00.004-07:00</published><updated>2012-06-23T12:23:43.452-07:00</updated><title type='text'>Asp.net User Control Concept</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
User controls are one of ASP.NET methods to increase reusability of 
code, implement encapsulation and reduce maintenance. 
User control is similar to web page. Both web pages and user controls 
contain HTML elements and markup for web controls. Some tags, like 
&amp;lt;html&amp;gt;, &amp;lt;head&amp;gt; or &amp;lt;form&amp;gt; cannot be used in web user 
controls.&lt;br /&gt;
&lt;br /&gt;
User controls are saved with .ascx extension, instead of .aspx for 
web pages. User controls can use code behind feature like web pages. 
Code behind file of web user controls ends with .ascx.cs. Markup code of
 user controls starts with @Control directive. Simplest web user control
 could contains only static HTML, like in this example:&lt;br /&gt;
&lt;br /&gt;

&lt;span style=&quot;background: none repeat scroll 0% 0% rgb(241, 194, 50);&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue;&quot;&gt;@&lt;/span&gt;&lt;span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: #a31515;&quot;&gt;Control&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: red;&quot;&gt;Language&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue;&quot;&gt;=&quot;VB&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: red;&quot;&gt;AutoEventWireup&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue;&quot;&gt;=&quot;false&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: red;&quot;&gt;CodeFile&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue;&quot;&gt;=&quot;WebUserControl.ascx.vb&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: red;&quot;&gt;Inherits&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232; color: blue;&quot;&gt;=&quot;WebUserControl&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background: yellow;&quot;&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&lt;span style=&quot;background: none repeat scroll 0% 0% yellow;&quot;&gt;&lt;span style=&quot;background-color: #f1c232;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span&gt;Hello, I am very simple &lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;web user control&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;b&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt; with static HTML only.&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;p&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
This web user control could be used when you need to repeat same 
code on many pages. Good examples are page footer, header or some kind 
of site navigation (depending of your case, it is good idea to consider 
using of Master Pages for this task as well). Except static HTML code, 
web user controls could contain web controls. You can simply drag and 
drop items from toolbox to user control. Like any other control, user 
controls can have properties, methods and events which make them very 
useful.&lt;br /&gt;

If user control solves more general problem, like progress bar or 
data pager control then can be useful on many different web sites. On 
this way, user controls can provide more stable and tested code.&lt;br /&gt;

&lt;h2&gt;
How to create web user control&lt;/h2&gt;
All user controls are derived from the &lt;strong&gt;System.Web.UI.UserControl&lt;/strong&gt;
 class. UserControl and Page classes both inherits from TemplateControl 
class. You can add web user control to existing web site project, in 
Visual Studio menu go to WebSite -&amp;gt; Add New Item..., like in image 
bellow&lt;br /&gt;

&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;Adding new user control in Visual Studio&quot; src=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Images/User-Control-Add-New.gif&quot; /&gt;&lt;/div&gt;
New dialog will appear. To create new web user control, select web 
user control template, like in next image. Choose a name for your 
control and click Add.&lt;br /&gt;

&lt;div align=&quot;center&quot;&gt;
&lt;img alt=&quot;Web user control template selected&quot; src=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Images/User-Control-New-Item.gif&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h2&gt;
How to add web user control to ASP.NET web page&lt;/h2&gt;
To add web user control to web page, we need two lines. First, we need to register user control with &lt;strong&gt;Register directive&lt;/strong&gt; on top of the page:&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #ffd966;&quot;&gt;
&lt;span style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto auto;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;@&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: #a31515;&quot;&gt;Page&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Language&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;C#&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;AutoEventWireup&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;true&quot;&lt;/span&gt;Â&amp;nbsp; &lt;span style=&quot;color: red;&quot;&gt;CodeFile&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;Default.aspx.cs&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Inherits&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;_Default&quot;&lt;/span&gt; &lt;span style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto auto;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto auto;&quot;&gt;&amp;lt;%&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color: blue;&quot;&gt;@ &lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;Register&lt;/span&gt;&lt;/strong&gt;&lt;strong&gt;&lt;span&gt; &lt;span style=&quot;color: red;&quot;&gt;tagprefix&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;bean&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;Tagname&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;footer&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;~/footer.ascx&quot;&lt;/span&gt; &lt;span style=&quot;background-attachment: scroll; background-clip: border-box; background-image: none; background-origin: padding-box; background-position: 0% 0%; background-repeat: repeat; background-size: auto auto;&quot;&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;background-color: #ffd966;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
With Register directive we define user control on page. The important parameters are:
&lt;br /&gt;
&lt;strong&gt;TagPrefix&lt;/strong&gt;: prefix for user control tag. This prefix will be used in markup code later.
&lt;br /&gt;
&lt;strong&gt;TagName&lt;/strong&gt;: tag name of user control tag. 
&lt;br /&gt;
&lt;strong&gt;Src&lt;/strong&gt;: path to .ascx file.
&lt;br /&gt;
After registration with &lt;strong&gt;Register directive&lt;/strong&gt;, you can place user control inside web form with tag formatted as &amp;lt;tagprefix:tagname, like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;&lt;strong&gt;bean&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;span style=&quot;color: blue;&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;footer&lt;/span&gt;&lt;/strong&gt;&lt;span&gt; &lt;span style=&quot;color: red;&quot;&gt;runat&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;server&quot;&lt;/span&gt; &lt;span style=&quot;color: red;&quot;&gt;id&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&quot;MyUserControl&quot;&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;
Registering user controls in web.config&lt;/h2&gt;
If you&#39;ll use user control on many pages on web site then you can 
register control in web.config file. On this way you can use user 
control in complete web site without need to register it on every page. 
You can do this in &lt;b&gt;&amp;lt;controls &amp;gt;&lt;/b&gt; section with code like this:&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;system.web&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;pages&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;controls&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;add&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;src&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&lt;span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;Footer.ascx&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;tagPrefix&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;bs&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: red;&quot;&gt;tagName&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;=&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt;footer&lt;/span&gt;&quot;&lt;span style=&quot;color: blue;&quot;&gt; /&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;controls&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;pages&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt; &amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;system.web&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #a31515;&quot;&gt;configuration&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;
Dynamically loading web user controls&lt;/h2&gt;
&lt;br /&gt;
Although web user controls looks like a parts of web page, they are 
still &quot;controls&quot;. You can add them to web page at design time, and also 
you can add web user controls at run time by using ASP.NET server side 
code and by using of some container. Container is usually PlaceHolder or
 Panel control. We can add user control dynamically with simple code 
like this:&lt;br /&gt;

&lt;b&gt;[ C# ]&lt;/b&gt;&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;protected&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;span style=&quot;color: green;&quot;&gt;// Declare user  control variable&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; Control MyUserControl;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;span style=&quot;color: green;&quot;&gt;// Load user  control dynamically&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; MyUserControl = LoadControl(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;UserControl1.ascx&quot;&lt;/span&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;span style=&quot;color: green;&quot;&gt;// Place user  control in PlaceHolder control&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; MyPlaceHolder.Controls.Add(MyUserControl);&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;[ VB.NET ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Protected&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: blue;&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Me&lt;/span&gt;.Load&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;span style=&quot;color: green;&quot;&gt;&#39; Declare user  control variable&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Dim&lt;/span&gt; MyUserControl &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; Control&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;span style=&quot;color: green;&quot;&gt;&#39; Load user control  dynamically&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; MyUserControl = LoadControl(&lt;span style=&quot;color: #a31515;&quot;&gt;&quot;UserControl1.ascx&quot;&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;span style=&quot;color: green;&quot;&gt;&#39; Place user  control in PlaceHolder control&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; myPlaceHolder.Controls.Add(MyUserControl)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&amp;nbsp;  &lt;br /&gt;

On this way, you can choose when and which control to load, based on 
user preferences, user or role rights etc. In detail guide how to load 
user controls dynamically you can read on &lt;a href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Controls-Run-Time.aspx&quot; target=&quot;_blank&quot;&gt;Working with Web User Controls at Run-time&lt;/a&gt; tutorial.&lt;br /&gt;

&lt;h2&gt;
Web user control properties and methods&lt;/h2&gt;
We can add properties and methods to user control class like in code bellow:&lt;br /&gt;

&lt;b&gt;[ C# ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; DoSomething()&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// Public method  that do something great&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;}&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;// Public  property &lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; FirstName&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;{&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;span style=&quot;color: blue;&quot;&gt;get&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; lblFirstName.Text;&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt; &amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;set&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;{&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lblFirstName.Text = &lt;span style=&quot;color: blue;&quot;&gt;value&lt;/span&gt;;&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt; &amp;nbsp;&amp;nbsp;}&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ VB.NET ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; DoSomething()&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&#39; Public method  that do something great&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: green;&quot;&gt;&#39; Public property &lt;/span&gt;&lt;br /&gt;
  &lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Property&lt;/span&gt; FirstName() &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Get&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Return&lt;/span&gt; lblFirstName.Text&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Get&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;Set&lt;/span&gt;(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; value &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;String&lt;/span&gt;)&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;lblFirstName.Text = value&lt;/span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span&gt;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Set&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;End&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Property&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;
Web user control events &lt;/h2&gt;
User control has predefined events like web page, so you don&#39;t need 
to learn anything new. There are Load, Init, PreRender, Error etc. 
events, used on the same way like in common web page:&lt;br /&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;[ C# ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;protected&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, &lt;span style=&quot;color: #2b91af;&quot;&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;
&lt;span&gt;{&lt;/span&gt;&lt;br /&gt;
&lt;span&gt; &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// You can add code  for user control events,&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// it looks like  procedure for web page load&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;// so you don&#39;t  need to learn anything new&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span&gt;}&lt;/span&gt;&lt;/div&gt;
&lt;b&gt;[ VB.NET ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Protected&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt; Page_Load(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; System.EventArgs) &lt;span style=&quot;color: blue;&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Me&lt;/span&gt;.Load&lt;/span&gt;
&lt;br /&gt;
&lt;span&gt; &amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&#39; You can add code  for user control events,&lt;/span&gt;&lt;/span&gt;
&lt;span&gt;&lt;br /&gt;
 &amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&#39; it looks like  procedure for web page load&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;span&gt; &amp;nbsp;&lt;span style=&quot;color: green;&quot;&gt;&#39; so you don&#39;t need  to learn anything new&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;
End&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Sub&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;h2&gt;
Custom events in user controls&lt;/h2&gt;
Except predefined events, it is possible to declare your own events 
so your user control can notify the rest of application when something 
happen. Every event procedure use two parameters. First parameter is 
sender, the control that sent an event, and the second parameter is 
EventArgs object, or the custom class that inherits from 
System.EventArgs class. If we use custom class, we can add additional 
information that can be used in event procedure. But, in case that we 
have simple event, we can use generic EventArgs class.&lt;br /&gt;

You can create your own event in two simple steps. First, declare an event with code like this:&lt;br /&gt;

&lt;br /&gt;
&lt;b&gt;[ C# ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;event&lt;/span&gt; &lt;span style=&quot;color: #2b91af;&quot;&gt;EventHandler&lt;/span&gt; TitleChanged;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;[ VB.NET ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;Public&lt;/span&gt;&lt;span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Event&lt;/span&gt; TitleChanged(&lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: blue;&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: blue;&quot;&gt;As&lt;/span&gt; EventArgs)&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
Second, inside some property or procedure, when certain circumstances occurs, you can raise an event with code like this:&lt;br /&gt;
&lt;br /&gt;

&lt;b&gt;[ C# ]&lt;/b&gt;&lt;br /&gt;

TitleChanged(this, EventArgs.Empty);&lt;br /&gt;

&lt;br /&gt;
&lt;b&gt;[ VB.NET ]&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;

&lt;div style=&quot;background-color: #f1c232;&quot;&gt;
&lt;span style=&quot;color: blue;&quot;&gt;RaiseEvent&lt;/span&gt;&lt;span&gt; TitleChanged(sender, e)&lt;/span&gt; &lt;/div&gt;
&lt;h2&gt;
Web user control examples&lt;/h2&gt;
Ok, enough about theory, we created two pretty useful examples of 
user controls. Maybe you can find them useful in some of your web 
projects. &lt;br /&gt;

First example is &lt;a href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Month-Calendar-Control.aspx&quot; target=&quot;_blank&quot;&gt;A simple Month Calendar Control&lt;/a&gt; which could be used for month selection when using of classic calendar control is inappropriate.&lt;br /&gt;

&lt;div align=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Month-Calendar-Control.aspx&quot;&gt;&lt;img alt=&quot;Month Calendar ASP.NET Control&quot; border=&quot;0&quot; src=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Images/User-Control-Design.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
Second example explains &lt;a href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/ProgressBar-User-Control.aspx&quot; target=&quot;_blank&quot;&gt;How to create ProgressBar user control&lt;/a&gt; when visitor expects to know a progress or current state of some operation.&lt;br /&gt;

&lt;div align=&quot;center&quot;&gt;
&lt;a href=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/ProgressBar-User-Control.aspx&quot;&gt;&lt;img alt=&quot;Progress Bar ASP.NET Control&quot; border=&quot;0&quot; src=&quot;http://www.beansoftware.com/ASP.NET-Tutorials/Images/ProgressBar-Output.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;h2&gt;
Conclusion&lt;/h2&gt;
User controls could be very useful to save your time and avoid 
confusion. ASP.NET provides other types of controls, including custom 
server controls, components and web parts. Also there are a number of 
third party controls from independent software vendors. These controls 
are already well tested on many web sites and for small price can save 
you a lot of work. Third party controls are rarely created as user 
controls. Usually, they are compiled as custom server controls. Although
 user controls are easier to create, custom controls are easier to use. 
They can be placed on Visual Studio toolbox and act as standard built-in
 controls.&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/4251141147116251717/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/aspnet-user-control-concept.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/4251141147116251717'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/4251141147116251717'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/aspnet-user-control-concept.html' title='Asp.net User Control Concept'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-7632271483915139295</id><published>2012-06-23T10:58:00.000-07:00</published><updated>2012-06-23T11:04:59.432-07:00</updated><title type='text'>create your first mvc in php</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: center;&quot;&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;520&#39; height=&#39;366&#39; src=&#39;https://www.youtube.com/embed/CGiIVQPaOJQ?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h1 style=&quot;text-align: left;&quot;&gt;







        Write your own PHP MVC Framework &lt;/h1&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;What is MVC?&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
From &lt;a href=&quot;http://en.wikipedia.org/wiki/Model-view-controller&quot;&gt;Wikipedia&lt;/a&gt;-&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Model–View–Controller (MVC) is an architectural pattern used in 
software engineering. Successful use of the pattern isolates business 
logic from user interface considerations, resulting in an application 
where it is easier to modify either the visual appearance of the 
application or the underlying business rules without affecting the 
other. In MVC, the model represents the information (the data) of the 
application; the view corresponds to elements of the user interface such
 as text, checkbox items, and so forth; and the controller manages the 
communication of data and the business rules used to manipulate the data
 to and from the model.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
In simpler words-&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
1. Model handles all our database logic. Using the model we connect to our database and provide an abstraction layer.&lt;br /&gt;
2. Controller represents all our business logic i.e. all our ifs and else.&lt;br /&gt;
3. View represents our presentation logic i.e our HTML/XML/JSON code.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Why should I write my own framework?&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This tutorial is by no means a comprehensive/definitive solution to your framework needs. There are a &lt;a href=&quot;http://cakephp.org/&quot; target=&quot;_blank&quot;&gt;lot&lt;/a&gt; &lt;a href=&quot;http://codeigniter.com/&quot; target=&quot;_blank&quot;&gt;of&lt;/a&gt; &lt;a href=&quot;http://zend.com/&quot; target=&quot;_blank&quot;&gt;good&lt;/a&gt; &lt;a href=&quot;http://symfony-project.org/&quot; target=&quot;_blank&quot;&gt;php&lt;/a&gt; &lt;a href=&quot;http://xisc.com/&quot; target=&quot;_blank&quot;&gt;frameworks&lt;/a&gt; out there. &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
So why should you write your own framework? Firstly, it is a great 
learning experience. You will get to learn PHP inside-out. You will get 
to learn object-oriented programming, design patterns and 
considerations.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
More importantly, you have complete control over your framework. Your
 ideas can be built right into your framework. Although always not 
beneficial, you can write coding conventions/functions/modules the way 
you like. &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;b&gt;Lets dive right in&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The Directory Structure&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;img alt=&quot;Directory Structure&quot; class=&quot;alignnone size-full wp-image-95&quot; height=&quot;325&quot; src=&quot;http://anantgarg.com/wp-content/uploads/2009/03/picture-16.png&quot; title=&quot;Directory Structure&quot; width=&quot;219&quot; /&gt;&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
Click Read More Below To show more information about mvc in php .. &lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&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: left;&quot;&gt;
Although we will not be a couple of directories mentioned above for 
this tutorial, we should have them in place for future expansion. Let me
 explain the purpose of each directory:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
application - &lt;i&gt;application specific code &lt;/i&gt;&lt;br /&gt;
config - &lt;i&gt;database/server configuration&lt;/i&gt;&lt;br /&gt;
db - &lt;i&gt;database backups&lt;/i&gt;&lt;br /&gt;
library - &lt;i&gt;framework code&lt;/i&gt;&lt;br /&gt;
public - &lt;i&gt;application specific js/css/images&lt;/i&gt;&lt;br /&gt;
scripts - &lt;i&gt;command-line utilities&lt;/i&gt;&lt;br /&gt;
tmp - &lt;i&gt;temporary data &lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Once we have our directory structure ready, let us understand a few coding conventions.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Coding Conventions&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
1. mySQL tables will always be lowercase and plural e.g. items, cars&lt;br /&gt;
2. Models will always be singular and first letter capital e.g. Item, Car&lt;br /&gt;
3. Controllers will always have “Controller” appended to them. e.g. ItemsController, CarsController&lt;br /&gt;
4. Views will have plural name followed by action name as the file. e.g. items/view.php, cars/buy.php&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
We first add .htaccess file in the root directory which will redirect all calls to the public folder&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_692148&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;RewriteEngine on&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;3.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;RewriteRule&amp;nbsp;&amp;nbsp;&amp;nbsp; ^$&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;public&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&amp;nbsp;&amp;nbsp;&amp;nbsp; [L]&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;4.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;RewriteRule&amp;nbsp;&amp;nbsp;&amp;nbsp; (.*) &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;public&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;/&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$1&lt;/code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;code class=&quot;plain&quot;&gt;[L]&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;5.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 6px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/IfModule&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
We then add .htaccess file to our public folder which redirect all 
calls to index.php. Line 3 and 4 make sure that the path requested is 
not a filename or directory. Line 7 redirects all such paths to 
index.php?url=PATHNAME&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_983970&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;IfModule mod_rewrite.c&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;RewriteEngine On&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;RewriteCond %{REQUEST_FILENAME} !-f&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;RewriteCond %{REQUEST_FILENAME} !-d&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;RewriteRule ^(.*)$ index.php?url=&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$1&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;[PT,L]&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/IfModule&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
This redirection has many advantages-&lt;br /&gt;
a) we can use it for &lt;a href=&quot;http://en.wikipedia.org/wiki/Bootstrap&quot; target=&quot;_blank&quot;&gt;bootstrapping&lt;/a&gt; i.e. all calls go via our index.php except for images/js/cs.&lt;br /&gt;
b) we can use &lt;a href=&quot;http://www.google.com/search?q=seo+friendly+urls&quot; target=&quot;_blank&quot;&gt;pretty/seo-friendly URLS&lt;/a&gt;&lt;br /&gt;
c) we have a single entry point&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now we add index.php to our public folder&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_900662&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;3.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;define(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;DS&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, DIRECTORY_SEPARATOR);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;4.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;define(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;ROOT&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, dirname(dirname(&lt;/code&gt;&lt;code class=&quot;constants&quot;&gt;__FILE__&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)));&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;5.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;6.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;url&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;7.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;8.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;require_once&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;library&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;bootstrap.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Notice that I have purposely not included the closing ?&amp;gt;. This is 
to avoid injection of any extra whitespaces in our output. For more, I 
suggest you view Zend’s &lt;a href=&quot;http://framework.zend.com/manual/en/coding-standard.coding-style.html&quot;&gt;coding style&lt;/a&gt;.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Our index.php basically set the $url variable and calls bootstrap.php which resides in our library directory.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now lets view our bootstrap.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_420080&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;3.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;require_once&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;config&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;config.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;4.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;require_once&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;library&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;shared.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Yes these requires could be included directly in index.php. But have not been on purpose to allow future expansion of code.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now let us have a look at shared.php, finally something that does some real work &lt;img alt=&quot;:)&quot; class=&quot;wp-smiley&quot; src=&quot;http://anantgarg.com/wp-includes/images/smilies/icon_smile.gif&quot; /&gt; &lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_305036&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Check if environment is development and display errors **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;setReporting() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(DEVELOPMENT_ENVIRONMENT == true) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;error_reporting&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(E_ALL);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;ini_set&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;display_errors&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;On&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;error_reporting&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(E_ALL);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;ini_set&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;display_errors&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Off&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;ini_set&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;log_errors&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;On&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;ini_set&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;error_log&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, ROOT.DS.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;tmp&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.DS.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;logs&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.DS.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;error.log&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;15.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;16.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;17.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Check for Magic Quotes and remove them **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;18.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;19.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;stripSlashesDeep(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;20.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;is_array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) ? &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;array_map&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;stripSlashesDeep&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) : &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;stripslashes&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;21.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;22.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;23.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;24.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;removeMagicQuotes() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;25.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;( get_magic_quotes_gpc() ) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;26.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;code class=&quot;plain&quot;&gt;= stripSlashesDeep(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_GET&lt;/code&gt;&amp;nbsp;&amp;nbsp; &lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;27.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$_POST&lt;/code&gt;&amp;nbsp;&amp;nbsp; &lt;code class=&quot;plain&quot;&gt;= stripSlashesDeep(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_POST&lt;/code&gt;&amp;nbsp; &lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;28.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$_COOKIE&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= stripSlashesDeep(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_COOKIE&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;29.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;30.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;31.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;32.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Check register globals and remove them **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;33.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;34.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;unregisterGlobals() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;35.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;ini_get&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;register_globals&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;36.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$array&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_SESSION&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_POST&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_GET&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_COOKIE&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_REQUEST&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_SERVER&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_ENV&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;_FILES&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;37.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$array&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;38.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$GLOBALS&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;gt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$var&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;39.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$var&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=== &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$GLOBALS&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;40.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 120px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;unset(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$GLOBALS&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$key&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;41.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;42.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;43.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;44.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;45.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;46.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;47.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Main Call Function **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;48.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;49.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;callHook() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;50.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;global&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;51.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;52.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$urlArray&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;53.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$urlArray&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;explode&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;/&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$url&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;54.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;55.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$urlArray&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[0];&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;56.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;array_shift&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$urlArray&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;57.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$urlArray&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[0];&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;58.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;array_shift&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$urlArray&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;59.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$queryString&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$urlArray&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;60.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;61.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$controllerName&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;62.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= ucwords(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;63.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$model&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= rtrim(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;s&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;64.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;.= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Controller&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;65.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$dispatch&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$model&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controllerName&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;66.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;67.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;((int)method_exists(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;68.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;call_user_func_array(&lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$dispatch&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;),&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$queryString&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;69.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;70.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/* Error Generation Code Here */&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;71.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;72.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;73.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;74.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Autoload any classes that are required **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;75.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;76.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;__autoload(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$className&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;77.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;file_exists&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;library&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strtolower&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$className&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;.class.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;78.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;require_once&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;library&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strtolower&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$className&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;.class.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;79.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;file_exists&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;controllers&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strtolower&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$className&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;80.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;require_once&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;controllers&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strtolower&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$className&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;81.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;file_exists&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;models&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strtolower&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$className&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;82.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;require_once&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;models&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strtolower&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$className&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;83.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;84.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/* Error Generation Code Here */&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;85.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;86.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;87.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;88.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;setReporting();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;89.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;removeMagicQuotes();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;90.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;unregisterGlobals();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;91.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;callHook();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Let me explain the above code briefly. The &lt;i&gt;setReporting()&lt;/i&gt; function helps us display errors only when the &lt;i&gt;DEVELOPMENT_ENVIRONMENT&lt;/i&gt; is true. The next move is to remove &lt;a href=&quot;http://in.php.net/register_globals&quot; target=&quot;_blank&quot;&gt;global variables&lt;/a&gt; and &lt;a href=&quot;http://in.php.net/magic_quotes&quot; target=&quot;_blank&quot;&gt;magic quotes&lt;/a&gt;. Another function that we make use of is &lt;a href=&quot;http://in2.php.net/__autoload&quot; target=&quot;_blank&quot;&gt;__autoload&lt;/a&gt; which helps us load our classes automagically. Finally, we execute the &lt;i&gt;callHook()&lt;/i&gt; function which does the main processing.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
First let me explain how each of our URLs will look - yoursite.com/controllerName/actionName/queryString&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
So &lt;i&gt;callHook()&lt;/i&gt; basically takes the URL which we have received
 from index.php and separates it out as $controller, $action and the 
remaining as $queryString. $model is the singular version of 
$controller. &lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
e.g. if our URL is todo.com/items/view/1/first-item, then&lt;br /&gt;
Controller is &lt;i&gt;items&lt;/i&gt;&lt;br /&gt;
Model is &lt;i&gt;item&lt;/i&gt; (corresponding mysql table)&lt;br /&gt;
View is &lt;i&gt;delete&lt;/i&gt;&lt;br /&gt;
Action is &lt;i&gt;delete&lt;/i&gt;&lt;br /&gt;
Query String is an &lt;i&gt;array (1,first-item)&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
After the separation is done, it creates a new object of the class 
$controller.”Controller” and calls the method $action of the class.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now let us create a few classes first namely our base Controller 
class which will be used as the base class for all our controllers, our 
Model class which will be used as base class for all our models.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
First the controller.class.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_545230&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Controller {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_model&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_template&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;__construct(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$model&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_controller = &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_action = &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_model = &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$model&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;15.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$model&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;=&amp;amp;amp; &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$model&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;16.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_template =&amp;amp;amp; &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;new&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Template(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;17.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;18.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;19.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;20.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;set(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;21.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_template-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;22.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;23.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;24.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;__destruct() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;25.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_template-&amp;gt;render();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;26.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;27.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;28.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The above class is used for all communication between the controller,
 the model and the view (template class). It creates an object for the 
model class and an object for template class. The object for model class
 has the same name as the model itself, so that we can call it something
 like &lt;i&gt;$this-&amp;gt;Item-&amp;gt;selectAll();&lt;/i&gt; from our controller.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
While destroying the class we call the &lt;i&gt;render()&lt;/i&gt; function which displays the view (template) file.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now let us look at our model.class.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_187071&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Model &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;extends&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;SQLQuery {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_model&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;__construct() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_model = get_class(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_table = &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;strtolower&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_model).&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;s&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;__destruct() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The Model class extends the SQLQuery class which basically is an 
abstraction layer for the mySQL connectivity. Depending on your 
requirements you can specify any other DB connection class that you may 
require.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now let us have a look at the SQLQuery.class.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_280748&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;SQLQuery {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_dbHandle&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_result&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Connects to database **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;connect(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$address&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$account&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$pwd&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_dbHandle = @mysql_connect(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$address&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$account&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$pwd&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_dbHandle != 0) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(mysql_select_db(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_dbHandle)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;1;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;15.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;16.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;0;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;17.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;18.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;19.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;20.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;0;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;21.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;22.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;23.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;24.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Disconnects from database **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;25.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;26.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;disconnect() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;27.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(@mysql_close(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_dbHandle) != 0) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;28.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;1;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;29.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&amp;nbsp; &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;30.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;0;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;31.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;32.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;33.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;34.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;selectAll() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;35.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$query&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;select * from `&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_table.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;`&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;36.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;37.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;38.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;39.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;select(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;40.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$query&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;select * from `&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_table.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;` where `id` = \&#39;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.mysql_real_escape_string(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;).&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;\&#39;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;41.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, 1);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;42.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;43.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;44.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Custom SQL Query **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;45.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;46.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;query(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$singleResult&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 0) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;47.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;48.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result = mysql_query(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_dbHandle);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;49.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;50.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(preg_match(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;/select/i&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$query&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;51.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$result&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;52.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$table&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;53.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$field&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;54.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$tempResults&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;55.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$numOfFields&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= mysql_num_fields(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;56.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 0; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;&amp;lt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$numOfFields&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;; ++&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;57.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;array_push&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$table&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,mysql_field_table(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;));&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;58.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;array_push&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$field&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,mysql_field_name(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result, &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;));&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;59.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;60.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;61.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;while&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$row&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= mysql_fetch_row(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;62.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;for&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 0;&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;&amp;lt; &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$numOfFields&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;; ++&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;63.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 120px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$table&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] = trim(ucfirst(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$table&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]),&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;s&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;64.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 120px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$tempResults&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$table&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]][&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$field&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]] = &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$row&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$i&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;65.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;66.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$singleResult&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;== 1) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;67.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 120px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;mysql_free_result(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;68.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 120px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$tempResults&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;69.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;70.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;array_push&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$tempResults&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;71.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;72.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;mysql_free_result(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;73.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$result&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;74.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;75.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;76.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;77.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;78.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Get number of rows **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;79.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;getNumRows() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;80.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;mysql_num_rows(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;81.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;82.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;83.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Free resources allocated by a query **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;84.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;85.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;freeResult() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;86.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;mysql_free_result(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_result);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;87.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;88.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;89.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Get error string **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;90.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;91.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;getError() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;92.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;return&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;mysql_error(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_dbHandle);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;93.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;94.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The SQLQuery.class.php is the heart of our framework. Why? Simply 
because it can really help us reduce our work while programming by 
creating an SQL abstraction layer. We will dive into an advanced version
 of SQLQuery.class.php in the next tutorial. For now lets just keep it 
simple.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The &lt;i&gt;connect()&lt;/i&gt; and &lt;i&gt;disconnect()&lt;/i&gt; functions are fairly
 standard so I will not get into too much detail. Let me specifically 
talk about the query class. Line 48 first executes the query. Let me 
consider an example. Suppose our SQL Query is something like:&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
SELECT table1.field1 , table1.field2, table2.field3, table2.field4 FROM table1,table2 WHERE ….&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now what our script does is first find out all the output fields and 
their corresponding tables and place them in arrays - $field and $table 
at the same index value. For our above example, $table and $field will 
look like&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;i&gt;$field = array(field1,field2,field3,field4);&lt;br /&gt;
$table = array(table1,table1,table2,table2); &lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The script then fetches all the rows, and converts the table to a 
Model name (i.e. removes the plural and capitalizes the first letter) 
and places it in our multi-dimensional array and returns the result. The
 result is of the form $var[&#39;modelName&#39;][&#39;fieldName&#39;]. This style of 
output makes it easy for us to include db elements in our views.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now let us have a look at template.class.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_226630&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Template {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$variables&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;array&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;();&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;protected&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$_action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;__construct(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_controller = &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$controller&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_action = &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$action&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Set Variables **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;15.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;set(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;16.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;variables[&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;] = &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$value&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;17.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;18.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;19.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Display Template **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;20.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;21.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;render() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;22.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;extract(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;variables);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;23.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;24.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;file_exists&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;views&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_controller . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;header.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;25.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;include&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;views&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_controller . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;header.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;26.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;27.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;include&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;views&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;header.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;28.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;29.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;30.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;include&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;views&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_controller . DS . &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_action . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;31.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;32.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;if&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;file_exists&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;views&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_controller . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;footer.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;)) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;33.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;include&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;views&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;_controller . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;footer.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;34.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;} &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;else&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;{&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;35.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 96px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;include&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(ROOT . DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;application&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;views&#39;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;. DS . &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;footer.php&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;36.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 72px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;37.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;38.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;39.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The above code is pretty straight forward. Just one point- if it does not find header and footer in the &lt;i&gt;view/controllerName&lt;/i&gt; folder then it goes for the global header and footer in the &lt;i&gt;view&lt;/i&gt; folder.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now all we have to add is a config.php in the config folder and we can begin creating our first model, view and controller!&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_120480&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;comments&quot;&gt;/** Configuration Variables **/&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;define (&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;DEVELOPMENT_ENVIRONMENT&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,true);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;define(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;DB_NAME&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;yourdatabasename&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;define(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;DB_USER&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;yourusername&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;define(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;DB_PASSWORD&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;yourpassword&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;define(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;DB_HOST&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;localhost&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Phew! Now let us create our first mini-todo application. We first create a database “todo” and execute the following SQL queries&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_118179&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;CREATE&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;TABLE&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;`items` (&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 12px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;`id` &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;int&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(11) &lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;NOT&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;NULL&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;auto_increment,&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;3.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 12px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;`item_name` &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;varchar&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(255) &lt;/code&gt;&lt;code class=&quot;color1&quot;&gt;NOT&lt;/code&gt; &lt;code class=&quot;color1&quot;&gt;NULL&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;4.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 12px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;PRIMARY&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;KEY&lt;/code&gt;&amp;nbsp; &lt;code class=&quot;plain&quot;&gt;(`id`)&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;5.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;6.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;7.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;INSERT&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;INTO&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;`items` &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;VALUES&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(1, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Get Milk&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;8.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;INSERT&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;INTO&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;`items` &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;VALUES&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(2, &lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Buy Application&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Once that is done, we add item.php to our model folder with the following contents&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_613327&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;3.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Item &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;extends&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Model {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;4.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;5.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Write it is empty, but will have more information when we expand our framework in Part 2.&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now create a file called itemscontroller.php in the controller folder&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_84479&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;ItemsController &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;extends&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;Controller {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;view(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$id&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= null,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= null) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;title&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$name&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39; - My Todo List App&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;todo&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;Item-&amp;gt;select(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;));&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;viewall() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;title&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;All Items - My Todo List App&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;15.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;todo&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;Item-&amp;gt;selectAll());&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;16.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;17.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;18.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;add() {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;19.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$todo&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$_POST&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;todo&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;];&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;20.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;title&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Success - My Todo List App&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;21.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;todo&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;Item-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;insert into items (item_name) values (\&#39;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.mysql_real_escape_string(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$todo&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;).&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;\&#39;)&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;));&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;22.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;23.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;24.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;keyword&quot;&gt;function&lt;/code&gt; &lt;code class=&quot;functions&quot;&gt;delete&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$id&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= null) {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;25.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;title&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Success - My Todo List App&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;);&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;26.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 48px ! important;&quot;&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;set(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;todo&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;,&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$this&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&amp;gt;Item-&amp;gt;query(&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;delete from items where id = \&#39;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;.mysql_real_escape_string(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$id&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;).&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;\&#39;&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;));&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;27.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;28.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;29.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Finally create a folder called &lt;i&gt;items&lt;/i&gt; in the views folder and create the following files in it-&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
view.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_193612&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;h2&amp;gt;&amp;lt;?php &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$todo&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Item&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;][&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;item_name&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]?&amp;gt;&amp;lt;/h2&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;3.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;a &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;big&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;href=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;../../../items/delete/&amp;lt;?php echo $todo[&#39;Item&#39;][&#39;id&#39;]?&amp;gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;4.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;span &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;item&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;5.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;functions&quot;&gt;Delete&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;this item&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;6.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/span&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;7.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
viewall.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_840931&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;div class=&quot;toolbar&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;form action=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;../items/add&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;method=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;post&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;input type=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;text&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;value=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;I have to...&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;onclick=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;this.value=&#39;&#39;&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;name=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;todo&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt; &amp;lt;input type=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;submit&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;value=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;add&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/form&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php &lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$number&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;= 0?&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;foreach&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;(&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$todo&lt;/code&gt; &lt;code class=&quot;keyword&quot;&gt;as&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$todoitem&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;):?&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;a &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;big&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;href=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;../items/view/&amp;lt;?php echo $todoitem[&#39;Item&#39;][&#39;id&#39;]?&amp;gt;/&amp;lt;?php echo strtolower(str_replace(&quot;&lt;/code&gt; &lt;code class=&quot;string&quot;&gt;&quot;,&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;-&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;,$todoitem[&#39;Item&#39;][&#39;item_name&#39;]))?&amp;gt;&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;span &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;item&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;++&lt;/code&gt;&lt;code class=&quot;variable&quot;&gt;$number&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$todoitem&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;[&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;Item&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;][&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&#39;item_name&#39;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;]?&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/span&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;br/&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;?php &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;endforeach&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
delete.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_251662&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;a &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;big&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;href=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;../../items/viewall&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Todo successfully deleted. Click here to go back.&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
add.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_695668&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;a &lt;/code&gt;&lt;code class=&quot;keyword&quot;&gt;class&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;big&quot;&lt;/code&gt; &lt;code class=&quot;plain&quot;&gt;href=&lt;/code&gt;&lt;code class=&quot;string&quot;&gt;&quot;../items/viewall&quot;&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;&amp;gt;Todo successfully added. Click here to go back.&amp;lt;/a&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
header.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_664515&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffe599;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;01.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;html&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;02.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;head&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;03.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;title&amp;gt;&amp;lt;?php &lt;/code&gt;&lt;code class=&quot;functions&quot;&gt;echo&lt;/code&gt; &lt;code class=&quot;variable&quot;&gt;$title&lt;/code&gt;&lt;code class=&quot;plain&quot;&gt;?&amp;gt;&amp;lt;/title&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;04.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;style&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;05.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;.item {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;06.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;width:400px;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;07.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;08.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;09.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;10.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;input {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;11.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;color:#222222;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;12.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-family:georgia,times;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;13.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-size:24px;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;14.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-weight:normal;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;15.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;line-height:1.2em;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;16.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;color:black;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;17.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;18.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;19.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 6px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;a {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;20.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;color:#222222;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;21.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-family:georgia,times;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;22.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-size:24px;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;23.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-weight:normal;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;24.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;line-height:1.2em;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;25.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;color:black;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;26.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;text-decoration:none;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;27.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;28.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;29.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;30.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;a:hover {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;31.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 24px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;background-color:#BCFC3D;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;32.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;33.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;h1 {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;34.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;color:#000000;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;35.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-size:41px;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;36.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;letter-spacing:-2px;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;37.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;line-height:1em;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;38.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-family:helvetica,arial,sans-serif;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;39.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;border-bottom:1px dotted #cccccc;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;40.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;41.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;42.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;h2 {&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;43.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;color:#000000;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;44.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-size:34px;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;45.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;letter-spacing:-2px;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;46.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;line-height:1em;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;47.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;font-family:helvetica,arial,sans-serif;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;48.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;49.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;}&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;50.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/style&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;51.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/head&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;52.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;body&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;53.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;h1&amp;gt;My Todo-List App&amp;lt;/h1&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
footer.php&lt;/div&gt;
&lt;div class=&quot;syntaxhighlighter &quot; id=&quot;highlighter_347824&quot; style=&quot;text-align: left;&quot;&gt;
&lt;div class=&quot;bar&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;lines&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;div class=&quot;line alt1&quot;&gt;
&lt;code class=&quot;number&quot;&gt;1.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/body&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;line alt2&quot;&gt;
&lt;code class=&quot;number&quot;&gt;2.&lt;/code&gt;&lt;span class=&quot;content&quot;&gt;&lt;span class=&quot;block&quot; style=&quot;margin-left: 0px ! important;&quot;&gt;&lt;code class=&quot;plain&quot;&gt;&amp;lt;/html&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
Now assuming you have uploaded the directory structure to the todo folder, point your browser to:&lt;br /&gt;
http://localhost/todo/items/viewall&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/7632271483915139295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-your-first-mvc-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/7632271483915139295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/7632271483915139295'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-your-first-mvc-in-php.html' title='create your first mvc in php'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-4018635878042119715</id><published>2012-06-23T10:39:00.000-07:00</published><updated>2012-06-23T10:39:09.746-07:00</updated><title type='text'>create your own config file in php</title><content type='html'>&lt;div dir=&quot;rtl&quot; style=&quot;text-align: right;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot;&gt;
create a new MySQL database using phpMyAdmin and a &lt;em&gt;config.php&lt;/em&gt; file in the site root with connection&#39;s parameters for the database (database name, database host, username, password).&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5118893355398667474&quot; src=&quot;http://3.bp.blogspot.com/_TqPdHmAEwTM/Rwn2YrulHNI/AAAAAAAAAYE/tJ94LO_UeM4/s400/config1.png&quot; style=&quot;display: block; margin: 0px auto 10px; text-align: center;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;Open &lt;em&gt;config.php&lt;/em&gt; and copy and paste the code replacing the value of variables &lt;em&gt;$db_host&lt;/em&gt;, &lt;em&gt;$db_name&lt;/em&gt;, &lt;em&gt;$username&lt;/em&gt;, &lt;em&gt;$password&lt;/em&gt;, with correct parameters.&lt;br /&gt;&lt;br /&gt;
&lt;div class=&quot;code&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;// Connection&#39;s Parameters&lt;/span&gt;&lt;br /&gt;$db_host&lt;span style=&quot;color: #3333ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;localhost&quot;&lt;/span&gt;;&lt;br /&gt;$db_name&lt;span style=&quot;color: #3333ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;database_name&quot;&lt;/span&gt;;&lt;br /&gt;$username&lt;span style=&quot;color: #3333ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;database_username&quot;&lt;/span&gt;;&lt;br /&gt;$password&lt;span style=&quot;color: #3333ff;&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;color: #cc0000;&quot;&gt;&quot;database_password&quot;&lt;/span&gt;;&lt;br /&gt;$db_con&lt;span style=&quot;color: #3333ff;&quot;&gt;=mysql_connect&lt;/span&gt;($db_host,$username,$password);&lt;br /&gt;$connection_string&lt;span style=&quot;color: #3333ff;&quot;&gt;=mysql_select_db&lt;/span&gt;($db_name);&lt;br /&gt;&lt;span style=&quot;color: #ff6600;&quot;&gt;// Connection&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #3333ff;&quot;&gt;mysql_connect&lt;/span&gt;($db_host,$username,$password);&lt;br /&gt;&lt;span style=&quot;color: #3333ff;&quot;&gt;mysql_select_db&lt;/span&gt;($db_name);&lt;br /&gt;&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;Now, in the site root, create &lt;em&gt;index.php&lt;/em&gt; file and use PHP &lt;em&gt;include()&lt;/em&gt; function to include &lt;em&gt;config.php&lt;/em&gt; into the page.&lt;br /&gt;&lt;br /&gt;&lt;div class=&quot;code&quot; style=&quot;background-color: #ffd966;&quot;&gt;
&lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;&amp;lt;?php&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;color: #38761d;&quot;&gt;include &lt;/span&gt;(&lt;span style=&quot;color: #cc0000;&quot;&gt;&#39;config.php&#39;&lt;/span&gt;) &lt;span style=&quot;color: red; font-weight: bold;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5118742464607624386&quot; src=&quot;http://3.bp.blogspot.com/_TqPdHmAEwTM/RwltJrulHMI/AAAAAAAAAX8/oSVpYDIyLvw/s400/configphp.gif&quot; style=&quot;display: block; margin: 0px auto 10px; text-align: center;&quot; /&gt;&lt;br /&gt;&lt;br /&gt;This is a simple way to enstablish a connection with your database MySQL to be used when you need to execute a SQL query.&lt;/div&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/4018635878042119715/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-your-own-config-file-in-php.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/4018635878042119715'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/4018635878042119715'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-your-own-config-file-in-php.html' title='create your own config file in php'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://3.bp.blogspot.com/_TqPdHmAEwTM/Rwn2YrulHNI/AAAAAAAAAYE/tJ94LO_UeM4/s72-c/config1.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6005609095967398158.post-2770593749276574152</id><published>2012-06-23T10:33:00.000-07:00</published><updated>2012-06-23T10:33:02.190-07:00</updated><title type='text'>Create View in Oracle</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;pre class=&quot;code&quot; style=&quot;background-color: #ffd966;&quot;&gt;set pagesize 500
alter session set nls_date_format = &#39;DD.MM.YYYY&#39;;

create table prices_ (
  sku        varchar2(38),
  price      number,
  valid_from date
);

insert into prices_ values (&#39;4711&#39;, 18, &#39;08.01.2003&#39;);
insert into prices_ values (&#39;4711&#39;, 19, &#39;01.05.2000&#39;);
insert into prices_ values (&#39;4711&#39;, 20, &#39;18.01.2001&#39;);
insert into prices_ values (&#39;4711&#39;, 21, &#39;09.01.2000&#39;);

insert into prices_ values (&#39;beer&#39;, 14, &#39;07.03.2000&#39;);
insert into prices_ values (&#39;beer&#39;, 15, &#39;10.01.2003&#39;);
insert into prices_ values (&#39;beer&#39;, 16, &#39;18.01.2001&#39;);
insert into prices_ values (&#39;beer&#39;, 19, &#39;16.11.2001&#39;);
insert into prices_ values (&#39;beer&#39;, 17, &#39;19.02.2002&#39;);


create view prices_today_ as 
  select 
    sku,
    price,
    valid_from
  from
    (select
       sku,
       price,
       valid_from,
       rank() over (partition by sku order by valid_from desc) r
     from
       prices_
    )
  where r=1;


select * from prices_today_;

drop table prices_;
drop view prices_today_;&lt;/pre&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://fast-technologi.blogspot.com/feeds/2770593749276574152/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-view-in-oracle.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2770593749276574152'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6005609095967398158/posts/default/2770593749276574152'/><link rel='alternate' type='text/html' href='http://fast-technologi.blogspot.com/2012/06/create-view-in-oracle.html' title='Create View in Oracle'/><author><name>Angel Derek</name><uri>http://www.blogger.com/profile/02679724480867457316</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>