<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">

    <title type="text">CI News</title>
    <subtitle type="text">CI News:</subtitle>
    <link rel="alternate" type="text/html" href="http://codeigniter.com/news/" />
    <link rel="self" type="application/atom+xml" href="http://codeigniter.com/xml/atom/full/" />
    <updated>2009-02-11T01:29:05Z</updated>
    <rights>Copyright (c) 2009, Derek Jones</rights>
    <generator uri="http://expressionengine.com/" version="1.6.6">ExpressionEngine</generator>
    <id>tag:codeigniter.com,2009:02:11</id>


    <entry>
      <title>CodeIgniter 1.7.1 Released</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_1.7.1_released/" />
      <id>tag:codeigniter.com,2009:news/15.6738</id>
      <published>2009-02-11T00:24:04Z</published>
      <updated>2009-02-11T01:29:05Z</updated>
      <author>
            <name>Derek Jones</name>
            <uri>http://derekderekderek.com/</uri>      </author>

      <content type="html"><![CDATA[
        <p>CodeIgniter Version 1.7.1 has been released.&nbsp; This version contains many new features and enhancements, as well as nearly three dozen bug fixes. It also includes a critical security update for applications using the new Form Validation library with field arrays.&nbsp; For a list of all changes please see the <a href="http://www.codeigniter.com/user_guide/changelog.html">Change Log</a>.</p>

<p>If you are currently running CodeIgniter please read the <a href="http://www.codeigniter.com/user_guide/installation/upgrading.html">update instructions</a>.</p>

<p>Note:&nbsp; If your browser does not display the 1.7.1 user guide please clear your cache and reload the page.
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter 1.7.0 Released</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_170_released/" />
      <id>tag:codeigniter.com,2008:news/15.5661</id>
      <published>2008-10-23T22:48:11Z</published>
      <updated>2009-02-11T01:25:13Z</updated>
      <author>
            <name>Rick Ellis</name>
            <uri>http://ellislab.com</uri>      </author>

      <content type="html"><![CDATA[
        <p>CodeIgniter Version 1.7 has been released.&nbsp; This version contains a number of new features and enhancements, as well as many small improvements and bug fixes. For a list of all changes please see the <a href="http://www.codeigniter.com/user_guide/changelog.html">Change Log</a>.</p>

<p>If you are currently running CodeIgniter please read the <a href="http://www.codeigniter.com/user_guide/installation/upgrading.html">update instructions</a>.</p>

<p>Note:&nbsp; If your browser does not display the 1.7 user guide please clear your cache and reload the page.
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Community Voice &#45; HOWTO: Set up a CodeIgniter project in Subversion</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_community_voice_howto_set_up_a_codeigniter_project_in_subversio/" />
      <id>tag:codeigniter.com,2008:news/15.5035</id>
      <published>2008-08-15T11:49:00Z</published>
      <updated>2008-08-15T12:02:59Z</updated>
      <author>
            <name>Derek Allard</name>
            <uri>http://www.derekallard.com</uri>      </author>

      <category term="Community Voice"
        scheme="http://codeigniter.com/news/category/community_voice/"
        label="Community Voice" />
      <content type="html"><![CDATA[
        <p>EllisLab is blessed with two of the greatest communities that can be found anywhere on the internet in ExpressionEngine and more recently CodeIgniter.&nbsp; Despite being a relative newcomer to the scene, the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.&nbsp; From time to time we want to highlight some of these talented people, and we&#8217;ve asked them to lend their voice to ours.&nbsp;  <em><a href="http://codeigniter.com/forums/viewannounce/81650_49/">Have your voice</a></em>.&nbsp; I hope you enjoy what they have to say as much as I did.</p>

<p>This week, our Community Voice author is Bruce Alderson, known on the forums as <a href="http://codeigniter.com/forums/member/65974/">madmaxx</a>, who has written a wonderful guide on how he uses subversion with CodeIgniter.&nbsp; Bruce is an elder web monkey and systems programmer.&nbsp; He totally digs the craft of building software, making cool stuff, and causing people to laugh so hard liquids are forced from their nose.&nbsp; He&#8217;s currently the Chief Monkey at Discovery Software and author of the not-at-all famous <a href="http://robotpony.ca">robotpony.ca</a>.&nbsp; (Go read the one about <a href="http://robotpony.ca/page/29/">shaving your yak</a>)</p>

<hr />

<p>After working with <a href="http://codeigniter.com">CodeIgniter</a> for a few months (and WordPress for a few years), I’ve settled on a way to set up web projects that works well for development, deployment, and source control. Note that this style of layout only works on systems like Mac and Linux that have useful symlinks.</p>

<h4>First, the folder layout</h4>
<div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">some</span><span style="color: #007700">-</span><span style="color: #0000BB">domain</span><span style="color: #007700">.</span><span style="color: #0000BB">com</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">app</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">config</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">controllers</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(</span><span style="color: #0000BB">etc</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">public</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.</span><span style="color: #0000BB">htaccess&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">-&gt; ../</span><span style="color: #0000BB">site</span><span style="color: #007700">-</span><span style="color: #0000BB">extras</span><span style="color: #007700">/.</span><span style="color: #0000BB">htaccess<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;favicon</span><span style="color: #007700">.</span><span style="color: #0000BB">ico&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">-&gt; ../</span><span style="color: #0000BB">site</span><span style="color: #007700">-</span><span style="color: #0000BB">extras</span><span style="color: #007700">/</span><span style="color: #0000BB">favicon</span><span style="color: #007700">.</span><span style="color: #0000BB">ico<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;js</span><span style="color: #007700">/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt; ../</span><span style="color: #0000BB">site</span><span style="color: #007700">-</span><span style="color: #0000BB">extras</span><span style="color: #007700">/</span><span style="color: #0000BB">js<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;images</span><span style="color: #007700">/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;-&gt; ../</span><span style="color: #0000BB">site</span><span style="color: #007700">-</span><span style="color: #0000BB">extras</span><span style="color: #007700">/</span><span style="color: #0000BB">images<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;system</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">application</span><span style="color: #007700">/&nbsp;&nbsp;&nbsp;&nbsp;-&gt; ../../</span><span style="color: #0000BB">app</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">site</span><span style="color: #007700">-</span><span style="color: #0000BB">extras</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">js</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">images</span><span style="color: #007700">/<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.</span><span style="color: #0000BB">htaccess </span>
</span>
</code></div>

<p>The layout favours a <a href="http://en.wikipedia.org/wiki/Vhost">vhost</a> setup, and splits your code and resources out of the CodeIgniter sources. Splitting your stuff from the CodeIgniter stuff lets you link your Subversion repository to theirs, so that you can keep it in sync with their development.</p>

<h4>How it&#8217;s done</h4>

<ol><li>Set up your source tree (not including the symlinks or CodeIgniter source) and add to your Subversion repo.</li><li>Add a <kbd>svn</kbd> link to CodeIgniter&#8217;s repo (via <kbd>svn propedit svn:externals</kbd>, with <kbd>public  <a href="http://dev.ellislab.com/svn/CodeIgniter/tags/v1.6.2/">http://dev.ellislab.com/svn/CodeIgniter/tags/v1.6.2/</a></kbd>) and run a <kbd>svn update</kbd> to grab the framework.&nbsp; See the <a href="http://svnbook.red-bean.com/en/1.0/ch07s03.html">Subversion docs</a> for details.</li><li>Copy the CI <kbd>application</kbd> folder to the site root (as <kbd>app</kbd>), remove the <kbd>.svn</kbd> folders, symlink to <kbd>application</kbd>, and add it to your local svn repo.</li><li>Symlink the other site-extras to the <kbd>public</kbd> webserver root, and configure your local machine (and public webserver) to point to this root for the domain&#8217;s virtual host setup.</li><li>Alternatively, you can modify the <kbd>$application_path</kbd> to point to <kbd>../public/app/</kbd> (I&#8217;m not sure which is better yet).&nbsp; See the <a href="http://codeigniter.com/user_guide/general/managing_apps.html">CodeIgniter docs on apps</a> for more details.</li></ol>

<p>You now have a CodeIgnitor project ready for development. You can keep up-to-date with CodeIgniter updates, deploy easily, and get at your code without wading through extra levels of hierarchy.</p>

<p><br />
<a href="http://codeigniter.com/forums/viewthread/88290/">Discuss this article</a>
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Community Voice &#45; Generating PDF files using CodeIgniter</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_community_voice_generating_pdf_files_using_codeigniter/" />
      <id>tag:codeigniter.com,2008:news/15.4970</id>
      <published>2008-07-31T16:33:01Z</published>
      <updated>2008-08-01T10:25:34Z</updated>
      <author>
            <name>Derek Allard</name>
            <uri>http://www.derekallard.com</uri>      </author>

      <category term="Community Voice"
        scheme="http://codeigniter.com/news/category/community_voice/"
        label="Community Voice" />
      <content type="html"><![CDATA[
        <p>EllisLab is blessed with two of the greatest communities that can be found anywhere on the internet in ExpressionEngine and more recently CodeIgniter.&nbsp; Despite being a relative newcomer to the scene, the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.&nbsp; From time to time we want to highlight some of these talented people, and we&#8217;ve asked them to lend their voice to ours.&nbsp;  <em><a href="http://codeigniter.com/forums/viewannounce/81650_49/">Have your voice</a></em>.&nbsp; I hope you enjoy what they have to say as much as I did.</p>

<p>This week, our Community Voice author is Chris Monnat, known on the forums as <a href="http://codeigniter.com/forums/member/34172/">mrtopher</a>, who writes a helpful step by step guide to generating PDF files from CodeIgniter.&nbsp; Chris is a full time web application developer and part time entrepreneur. In addition to building web sites for the medical industry during the day, at night Chris also runs his own development company <a href="http://www.leftofcentercom.com">Left of Center Communications</a>. He recently started a personal blog at <a href="http://www.chrismonnat.com">http://www.chrismonnat.com</a> where he keeps a record of his exploits and discusses, among other things, CodeIgniter.</p>

<hr />

<p>PDF files rock! Some of the programs used to view them could use some work, but the file format itself is real handy. As a programmer I have found PDF&#8217;s to be most helpful when generating reports that need to be printable. I know we are all supposed to be doing our part to make our offices &#8220;greener&#8221; and use less resources like paper. But some things just need to be printed (especially when your talking about the financial and legal industries).</p>

<p>When generating reports in PDF format you suddenly have a lot more control over layout and design than  you do with plain old HTML and CSS (although much progress is being made with print style sheets). You can create some really nice reports on the fly that your users can view, save for later or e-mail to their co-workers for review. In this post I will show you how I generate PDF reports using <a href="http://codeigniter.com">CodeIgniter</a>.</p>

<h4>Quick Note</h4>

<p>There are a number of PHP libraries out there for generating PDF files (like <a href="http://www.fpdf.org/">FPDF</a>, <a href="http://www.stillhq.com/opensource.html">Panda</a> and <a href="http://www.digitaljunkies.ca/dompdf/">dompdf</a>) but the best one I have come across is the <a href="http://www.ros.co.nz/pdf/">R&amp;OS pdf class</a>. I was first introduced to it from the <a href="http://www.sitepoint.com/books/phpant1/?SID=beb1c45753ae71830305e53194bf4faf">PHP Anthology</a> first edition by Harry Fuecks. I have tried other PDF libraries (some PHP 5 specific and some not) and none of them have been able to provide me with the same control or ease of use that the R&amp;OS class has which is why I&#8217;m using it for this tutorial.</p>

<h4>Getting Started</h4>

<p>Before we start, lets get everyone to the same place so you can follow along as we go. I&#8217;ve prepared a .zip file containing everything you&#8217;ll need to follow along. The archive includes CI 1.6.3 along with all the code and libraries we will discuss in this tutorial. Simply <a href="http://codeigniter.com/files/ci_blog/pdf_tutorial.zip">download the archive</a>, unzip it on your web server and follow along.</p>

<p>I have done all the work of downloading the code library and putting the files in their right place for you, but I wanted to mention where things were for the detail oriented among you. There are 2 files that are necessary in order to use the R&amp;OS library: <strong>class.ezpdf.php</strong> and <strong>class.pdf.php</strong>. Those two files have been placed in the application/library folder. R&amp;OS also requires some font files in order to function and they have been placed at the root of the .zip file in a folder called <strong>fonts</strong>.</p>

<p>You do have to make a minor modification to the <strong>class.ezpdf.php</strong> file so that it will work properly within CI. First I renamed the file to <strong>cezpdf.php</strong>, which makes it easier to load using the CI loader. Then you have to modify the include statement on line 3 to:</p>

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">include_once(</span><span style="color: #0000BB">APPPATH </span><span style="color: #007700">. </span><span style="color: #DD0000">'libraries/class.pdf.php'</span><span style="color: #007700">); </span>
</span>
</code></div>

<p>This will keep PHP from saying that it can&#8217;t find included file. Once those modifications are made the R&amp;OS class is ready to use with CI.

<p>In the archive, I have also made a controller called<strong> tutorial.php</strong> and a helper called <strong>pdf_helper</strong>.<strong>php</strong> both in their respective directories. With the background info. out of the way, lets get our hands dirty with a real simple example.
<h4>Hello World</h4>
<div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">function </span><span style="color: #0000BB">hello_world</span><span style="color: #007700">()<br /></span><span style="color: #0000BB">&#123;<br />$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">library</span><span style="color: #007700">(</span><span style="color: #DD0000">'cezpdf'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezText</span><span style="color: #007700">(</span><span style="color: #DD0000">'Hello World'</span><span style="color: #007700">, </span><span style="color: #0000BB">12</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'justification' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'center'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezSetDy</span><span style="color: #007700">(-</span><span style="color: #0000BB">10</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$content </span><span style="color: #007700">= </span><span style="color: #DD0000">'The quick, brown fox jumps over a lazy dog. DJs flock by when MTV ax quiz prog.<br />Junk MTV quiz graced by fox whelps. Bawds jog, flick quartz, vex nymphs.'</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezText</span><span style="color: #007700">(</span><span style="color: #0000BB">$content</span><span style="color: #007700">, </span><span style="color: #0000BB">10</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezStream</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">&#125; </span>
</span>
</code></div>

The above code produces a PDF file <a href="http://codeigniter.com/files/ci_blog/hello_world.pdf">like this</a>.

In the above, first thing we do is load the R&amp;OS library for use. Next we use the <strong>ezText()</strong> function to create a title for our document. This function takes the text it will display as the first argument, the size of that text and an optional array of additional configuration options. In this instance we pass along a justification option of center. That will center our title at the top of our document.

After the title we insert some extra white space using the <strong>ezSetDy()</strong> function. After the whites pace we put the rest of the content for the document in a variable called $content and add it to our document using the <strong>ezText()</strong> function again. Finally, we create our document using the <strong>ezStream()</strong> function which actually creates the document and sends it to the users which prompts them to view/download the generated PDF document.

<h4>Handling Tabular Data</h4>

When your dealing with business reports the odds are good that you will need to generate reports with tables to display tabular data. From my experience with other PDF libraries, this is not an easy task. But with the R&amp;OS library it&#8217;s about as hard as creating an array.

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">function </span><span style="color: #0000BB">tables</span><span style="color: #007700">()<br /></span><span style="color: #0000BB">&#123;<br />$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">load</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">library</span><span style="color: #007700">(</span><span style="color: #DD0000">'cezpdf'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$db_data&#91;&#93; </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'name' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Jon Doe'</span><span style="color: #007700">, </span><span style="color: #DD0000">'phone' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'111-222-3333'</span><span style="color: #007700">, </span><span style="color: #DD0000">'email' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'jdoe@someplace.com'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$db_data&#91;&#93; </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'name' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Jane Doe'</span><span style="color: #007700">, </span><span style="color: #DD0000">'phone' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'222-333-4444'</span><span style="color: #007700">, </span><span style="color: #DD0000">'email' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'jane.doe@something.com'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$db_data&#91;&#93; </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'name' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Jon Smith'</span><span style="color: #007700">, </span><span style="color: #DD0000">'phone' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'333-444-5555'</span><span style="color: #007700">, </span><span style="color: #DD0000">'email' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'jsmith@someplacepsecial.com'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$col_names </span><span style="color: #007700">= array(<br /></span><span style="color: #DD0000">'name' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Name'</span><span style="color: #007700">,<br /></span><span style="color: #DD0000">'phone' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Phone Number'</span><span style="color: #007700">,<br /></span><span style="color: #DD0000">'email' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'E-mail Address'<br /></span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezTable</span><span style="color: #007700">(</span><span style="color: #0000BB">$table_data</span><span style="color: #007700">, </span><span style="color: #0000BB">$col_names</span><span style="color: #007700">, </span><span style="color: #DD0000">'Contact List'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'width'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">550</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezStream</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">&#125; </span>
</span>
</code></div>

The above code should produce a PDF file <a href="http://codeigniter.com/files/ci_blog/tables.pdf">like this</a>.

In the above code I create an array of data called $db_data. I put this together so that it imitates a typical database result set because that&#8217;s usually where you will be getting your data from. Below my data array I have created a $col_names array that associates the data elements in the $db_data array with a column title for the table. This is where the R&amp;OS gets the title to display at the top of each table column. Once I have the data and column titles I create the table by calling the <strong>ezTable()</strong> function. This function takes the data array, an associative array for column names, the title for the table and an optional array of configuration options. There are a number of options that can be configured through that last optional array, but I&#8217;m not going to go into them in this tutorial.

<h4>Headers and Footers</h4>

Most reports in a corporate setting come with some kind of standard header and/or footer. They can include anything from the date/time generated, the user who generated them, to page numbers and the like. Headers and footers are handy to have, but unfortunately there isn&#8217;t a real good way to add them to printable reports generated in HTML and CSS. There&#8217;s one more reason to use the portable document format when creating printable reports.

The process of adding headers and footers to a PDF using the R&amp;OS library is the slightest bit complicated. There are a lot of lines of code just to accomplish it, that&#8217;s why I have created a helper file. Since the code is in a helper function, you just need load the helper and call the function whenever you need to add headers/footers to a PDF.

<div class="codeblock"><code><span style="color: #000000">
<span style="color: #007700">function </span><span style="color: #0000BB">prep_pdf</span><span style="color: #007700">(</span><span style="color: #0000BB">$orientation </span><span style="color: #007700">= </span><span style="color: #DD0000">'portrait'</span><span style="color: #007700">)<br /></span><span style="color: #0000BB">&#123;<br />$CI </span><span style="color: #007700">= &amp;</span><span style="color: #0000BB">amp</span><span style="color: #007700">; </span><span style="color: #0000BB">get_instance</span><span style="color: #007700">();<br /><br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">selectFont</span><span style="color: #007700">(</span><span style="color: #0000BB">base_url</span><span style="color: #007700">() . </span><span style="color: #DD0000">'/fonts'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">$all </span><span style="color: #007700">= </span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">openObject</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">saveState</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setStrokeColor</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">0</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br />if(</span><span style="color: #0000BB">$orientation </span><span style="color: #007700">== </span><span style="color: #DD0000">'portrait'</span><span style="color: #007700">) </span><span style="color: #0000BB">&#123;<br />$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezSetMargins</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">,</span><span style="color: #0000BB">70</span><span style="color: #007700">,</span><span style="color: #0000BB">50</span><span style="color: #007700">,</span><span style="color: #0000BB">50</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezStartPageNumbers</span><span style="color: #007700">(</span><span style="color: #0000BB">500</span><span style="color: #007700">,</span><span style="color: #0000BB">28</span><span style="color: #007700">,</span><span style="color: #0000BB">8</span><span style="color: #007700">,</span><span style="color: #DD0000">''</span><span style="color: #007700">,</span><span style="color: #DD0000">'&#123;PAGENUM&#125;'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">line</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">,</span><span style="color: #0000BB">40</span><span style="color: #007700">,</span><span style="color: #0000BB">578</span><span style="color: #007700">,</span><span style="color: #0000BB">40</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addText</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">,</span><span style="color: #0000BB">32</span><span style="color: #007700">,</span><span style="color: #0000BB">8</span><span style="color: #007700">,</span><span style="color: #DD0000">'Printed on ' </span><span style="color: #007700">. </span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">'m/d/Y h:i:s a'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addText</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">,</span><span style="color: #0000BB">22</span><span style="color: #007700">,</span><span style="color: #0000BB">8</span><span style="color: #007700">,</span><span style="color: #DD0000">'CI PDF Tutorial - http://www.christophermonnat.com'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">&#125;<br /></span><span style="color: #007700">else </span><span style="color: #0000BB">&#123;<br />$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ezStartPageNumbers</span><span style="color: #007700">(</span><span style="color: #0000BB">750</span><span style="color: #007700">,</span><span style="color: #0000BB">28</span><span style="color: #007700">,</span><span style="color: #0000BB">8</span><span style="color: #007700">,</span><span style="color: #DD0000">''</span><span style="color: #007700">,</span><span style="color: #DD0000">'&#123;PAGENUM&#125;'</span><span style="color: #007700">,</span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">line</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">,</span><span style="color: #0000BB">40</span><span style="color: #007700">,</span><span style="color: #0000BB">800</span><span style="color: #007700">,</span><span style="color: #0000BB">40</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addText</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">,</span><span style="color: #0000BB">32</span><span style="color: #007700">,</span><span style="color: #0000BB">8</span><span style="color: #007700">,</span><span style="color: #DD0000">'Printed on '</span><span style="color: #007700">.</span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">'m/d/Y h:i:s a'</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addText</span><span style="color: #007700">(</span><span style="color: #0000BB">50</span><span style="color: #007700">,</span><span style="color: #0000BB">22</span><span style="color: #007700">,</span><span style="color: #0000BB">8</span><span style="color: #007700">,</span><span style="color: #DD0000">'CI PDF Tutorial - http://www.christophermonnat.com'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">&#125;<br />$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">restoreState</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">closeObject</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$CI</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cezpdf</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">addObject</span><span style="color: #007700">(</span><span style="color: #0000BB">$all</span><span style="color: #007700">,</span><span style="color: #DD0000">'all'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">&#125; </span>
</span>
</code></div>

An example of how I use this helper is provided in the headers() function of the tutorial.php controller. That code produces a PDF file <a href="http://codeigniter.com/files/ci_blog/headers.pdf">like this</a>.

The above code is the <strong>prep_pdf()</strong> function located in the <strong>pdf_helper.php</strong> file. This function does all the hard work of creating a footer for my PDF reports for me. All I have to do is load the helper in my controller and call the function. Since the reports could be portrait or landscape I have also included the ability to pass the orientation to the function and the code will modify the document margins accordingly.

I&#8217;m not going to go into a lot of detail about the above code because this tutorial could become very long. But the general idea is that I&#8217;m using the R&amp;OS library to modify the margins of the document I&#8217;m creating, add page numbers and text to the very bottom of the document. R&amp;OS has some functions that makes this easy like <strong>ezStartPageNumbers()</strong> and <strong>line()</strong>. Once all that is done I can add any kind of content to the document back in my controller and then just call <strong>ezStream()</strong> to generate the final document.

<h4>Wrap Up</h4>

I barely scratched the surface of what you can do with the R&amp;OS PDF library in this tutorial. I encourage you to spend some quality time with the <strong>readme.pdf</strong> documentation file that comes with the library when you download it. That file goes over all the functions and their options in great detail.

So there you have it, generating PDF files with CodeIgniter and the R&amp;OS library. If this method doesn&#8217;t quite do it for you, there are a few helpful articles on the CodeIgniter <a href="http://codeigniter.com/wiki/">wiki</a>, like <a href="http://codeigniter.com/wiki/PDF_generation_using_dom/">this one</a> and <a href="http://codeigniter.com/wiki/fpdf_CIed/">this one</a>, which walk you through some additional options. Whatever solution you choose I hope this tutorial has helped to introduce you to some of the options you have at your disposal for creating PDF reports with CodeIgniter.

<a href="http://codeigniter.com/forums/viewthread/86890/">Discuss this article</a>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Community Voice &#45; Lee&#8217;s Lost Bet</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_community_voice_lees_lost_bet/" />
      <id>tag:codeigniter.com,2008:news/15.4904</id>
      <published>2008-07-21T20:33:00Z</published>
      <updated>2008-07-31T17:22:50Z</updated>
      <author>
            <name>Derek Allard</name>
            <uri>http://www.derekallard.com</uri>      </author>

      <category term="Community Voice"
        scheme="http://codeigniter.com/news/category/community_voice/"
        label="Community Voice" />
      <content type="html"><![CDATA[
        <p>EllisLab is blessed with two of the greatest communities that can be found anywhere on the internet in ExpressionEngine and more recently CodeIgniter.&nbsp; Despite being a relative newcomer to the scene, the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.&nbsp; From time to time we want to highlight some of these talented people, and we&#8217;ve asked them to lend their voice to ours.&nbsp;  <em><a href="http://codeigniter.com/forums/viewannounce/81650_49/">Have your voice</a></em>.&nbsp; I hope you enjoy what they have to say as much as I did.</p>

<p>This week, our Community Voice author is Lee Tengum, who discusses how CodeIgniter has cost him over $8,800 in beer and soft drinks. Lee is a bit of a serial entrepreneur, with 5 successful startups under his belt including the recently launched <a href="http://cleverandy.com">http://cleverandy.com</a>.&nbsp; He has become something of a cookie! jar of startup knowledge. When he is not managing his team of contractors he blogs about the trials and tribulations of his startups at <a href="http://tumbledry.ca">http://tumbledry.ca</a>. </p>

<hr />

<p>It all started with an idea at 4 a.m. on a Tuesday morning that brought us to CodeIgniter. <br />
We were neck deep in a deadline and sinking fast. We knew we needed help. <br />
After puling some strings that bought some time we quit work for a week - well, client work at least. There were our own issues to solve.</p>

<p>We had amassed a team of roughly 14 at this point and had no way to efficiently manage who was doing what for how much and how long; in fact we were often surprised by code submissions.<br />
That’s a sad place to be.</p>

<p>We had been building in the ‘flavor of the weak’ when it came to frameworks and often chose whatever the contractor was fluent in to save time (which != saved money). </p>

<p>Not only were we not communicating, but we were reinventing the wheel for every project. Have I mentioned how sad of a place that is to be?</p>

<p>Back to 4 a.m.</p>

<p>Doug is one of my closest friends, and a trusted peer. He suggested we should develop a contractor management system and that we should build it all on CodeIgniter. At this time I hadn’t seen sleep in nearly a day, consumed almost seven liters of coffee, the &#8220;development tub&#8221; was empty and we were trying to finish a RoR project that a contractor bailed on. I didn&#8217;t want to hear about another &amp;^%in framework, I just wanted this to be done. </p>

<p>Thankfully my friend couldn’t understand the word “no” and kept pressing. He went on about how anyone with knowledge of PHP can build with this, its development cycle and the community that was forming around it. I still wasn&#8217;t convinced but he assured me this would be the last time we changed frameworks and proposed a friendly bet.</p>

<p>I hate that I love gambling. I don&#8217;t have a problem, per say, but I always lose. The problem is that my pride drives me to bet anyways. Besides I relished the opportunity to prove him wrong. </p>

<p>So the bet was laid. We would build the contractor management system in CI and all client projects for one month with CI. At the end of that month if I wanted to go back to another framework and could justify it rationally with solid points then he would keep the Development Tub full for a full year (a cost of roughly $100/week). If we stayed with Code Igniter I would the one stocking the tub for the next year and I would also have accept his offer to buy into my company and become a partner. </p>

<p>On Wednesday morning we filled the tub (again not a problem&#8230; really) and set out to build our app. We outlined what we wanted, mapped it out on the whiteboard, set up a Basecamp project for it, defined our milestones and set Saturday as launch day. </p>

<div style="text-align: center;"><img src="http://codeigniter.com/files/ci_blog/DSC_9399.jpg" width="300" height="199" alt="The tub&#8230;" /> <img src="http://codeigniter.com/files/ci_blog/DSC_9400.jpg" width="300" height="199" alt="The tub&#8230; again" /></div>

<p>Beer? Check.<br />
Monster energy drinks? Check.<br />
Coffee? Check.<br />
M&amp;M Peanuts? Check.<br />
Babysitter? Check. (We&#8217;re parents&#8230;)&nbsp; <br />
Pizza? Maybe.<br />
Basecamp set up? Check.<br />
SVN Server? Check.</p>

<p>While I depleted the tub and read the user guide, Doug was getting down to business. By the time I’d figured out how I was going to tackle my portion of the build he’d built the user authentication as well as the management section. Doug was already adding features to our &#8220;Wish List&#8221; in Basecamp and checking off milestones. Roughly 9 hrs into our project we started completing items on the wish list, which had never happened before. The wish list had never become a checklist before a deadline and I was starting to worry.</p>

<p>In the wee hours of Thursday morning we headed home to sleep. The following day we sent login details to our contractors and set up a basecamp project to log bugs. We fixed the stupid little ones that we missed and made changes on the fly. By the end of the day I had a huge overview of our team of contractors and a vision of things to come. I never did see the 48 hr Milestone reminder emails from Basecamp&#8230; again I was seeing a change.</p>

<p>By the end of the month we had more than a few client sites built on CI. We also had a process for development laid out and the term Rapid Development was taking on meaning with me. I was happy, the clients were happy and we had a team we could manage&#8230; and then reality sunk in.</p>

<p>I hate losing, even more so I hate losing to people I like winning against. I lost the bet. Though I gained a valuable business partner, a managed team, profitability and a kick ass framework to build it upon&#8230; I am forever filling the tub.</p>

<p>And with ExpressionEngine 2 built on CI (Which we are using extensively for client sites now), the tub has gained a lifetime sponsor. Me.</p>

<p>That app was build on 1.4.0 on September 20th 2006 and since then we have revised many things including our checklist:</p>

<p>Beer? Check.<br />
M&amp;M Peanuts? Check.<br />
Basecamp set up? Check.<br />
SVN Server? Check.</p>

<p>See the difference? We don&#8217;t live at the office any more. CodeIgniter gave us the freedom to build around our needs and wants and it gave us the structure we needed to become more efficient. Just don’t bet against CI, it has cost me $8800 and counting&#8230;. weekly.</p>

<p>
</p><h3>ABOUT LEE</h3>

<p>Lee is a bit of a serial entrepreneur, with 5 successful startups under his belt including the recently launched <a href="http://cleverandy.com">http://cleverandy.com</a>.&nbsp; He has become something of a cookie! jar of startup knowledge. When he is not managing his team of contractors he blogs about the trials and tribulations of his startups at <a href="http://tumbledry.ca">http://tumbledry.ca</a>. </p>

<p><a href="http://codeigniter.com/forums/viewthread/85844/">Discuss this article</a>
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Community Chieftain Michael Wales</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_community_chieftain_michael_wales/" />
      <id>tag:codeigniter.com,2008:news/15.4886</id>
      <published>2008-07-17T19:33:00Z</published>
      <updated>2008-07-17T19:40:49Z</updated>
      <author>
            <name>Derek Jones</name>
            <uri>http://derekderekderek.com/</uri>      </author>

      <content type="html"><![CDATA[
        <p>We&#8217;re happy to announce a new program for exceptional members of the CodeIgniter community, <a href="http://codeigniter.com/forums/viewannounce/85513_49/">CodeIgniter Community Chieftains</a>.&nbsp; As the community grows, the EllisLab development team often does not have the time that we would like to interact with the community in various ways, but it&#8217;s always been a key part of our success.&nbsp; So as the need arises, we have created this program to help keep the wheels greased so to speak, making sure that our forums, wiki, and bug tracker are handling the needs of the community and are properly moderated.</p>

<p>This is an invitation only program as the aforementioned link explains, and we&#8217;re proud to bring <a href="http://codeigniter.com/forums/member/48108/">Michael Wales</a> on board as our first CodeIgniter Community Chieftain.&nbsp; Most will need no introduction to Michael as you have likely already encountered him or some of his contributions in the community.&nbsp; Welcome aboard, Michael!
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Brazil</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_brazil/" />
      <id>tag:codeigniter.com,2008:news/15.4836</id>
      <published>2008-07-08T17:08:00Z</published>
      <updated>2008-07-08T18:13:44Z</updated>
      <author>
            <name>Rick Ellis</name>
            <uri>http://ellislab.com</uri>      </author>

      <content type="html"><![CDATA[
        <p>Hermes Alves has launched a CodeIgniter resource in Portuguese, located at <a href="http://www.codeigniter.com.br">codeigniter.com.br</a>.&nbsp; The site includes a discussion forum, mailing-list, and a few other resources.&nbsp; Kudos Hermes! 
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Community Voice &#45; Mathew Davies</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_community_voice_mathew_davies/" />
      <id>tag:codeigniter.com,2008:news/15.4783</id>
      <published>2008-06-30T21:07:00Z</published>
      <updated>2008-07-31T17:23:02Z</updated>
      <author>
            <name>Derek Allard</name>
            <uri>http://www.derekallard.com</uri>      </author>

      <category term="Community Voice"
        scheme="http://codeigniter.com/news/category/community_voice/"
        label="Community Voice" />
      <content type="html"><![CDATA[
        <p>EllisLab is blessed with two of the greatest communities that can be found anywhere on the internet in ExpressionEngine and more recently CodeIgniter.&nbsp; Despite being a relative newcomer to the scene, the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.&nbsp; From time to time we want to highlight some of these talented people, and we&#8217;ve asked them to lend their voice to ours.&nbsp;  <em><a href="http://codeigniter.com/forums/viewannounce/81650_49/">Have your voice</a></em>.&nbsp; I hope you enjoy what they have to say as much as I did.</p>

<p>This week,&nbsp; our Community Voice author is Mathew Davies (AKA Popcorn), author of the <a href="http://code.google.com/p/reduxauth/">Redux Authentication library</a>, a light, easy to use and fully featured auth engine. What follows is a brief discussion of some of the logic and security that went into the library, and considerations for your own programming.</p>

<hr />

<p>Let me start by saying I love CodeIgniter, it&#8217;s a developers dream. <img src="http://ellislab.com/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /></p>

<p>Today I plan to talk about some of the security features that are used within my library : Redux Authentication.</p>

<p><strong>Hash Once and Only Once!</strong></p>

<p>Over at TalkPHP someone provided a code snippet which had this code :
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$psd </span><span style="color: #007700">= </span><span style="color: #0000BB">sha1</span><span style="color: #007700">(</span><span style="color: #0000BB">md5</span><span style="color: #007700">(</span><span style="color: #0000BB">md5</span><span style="color: #007700">(</span><span style="color: #0000BB">sha1</span><span style="color: #007700">(</span><span style="color: #0000BB">md5</span><span style="color: #007700">(</span><span style="color: #0000BB">sha1</span><span style="color: #007700">(</span><span style="color: #0000BB">sha1</span><span style="color: #007700">(</span><span style="color: #0000BB">md5</span><span style="color: #007700">(</span><span style="color: #0000BB">$_POST&#91;</span><span style="color: #DD0000">'password'</span><span style="color: #0000BB">&#93;</span><span style="color: #007700">)))))))); </span>
</span>
</code></div><p>
I&#8217;ve made a similar mistake myself in the past.&nbsp; Someone on the CodeIgniter forums pointed out that a solution like the above will actually increase the probability of a collision. Here&#8217;s what inparo had to say :
</p><blockquote><p>
&#8220;It&#8217;s safer if you only hash it once.&nbsp; The initial string is random in both length and characters.&nbsp; The first sha1 gives you a fixed length and reduced character set.&nbsp; By hashing this again you&#8217;re actually increasing the probability of collisions.&#8221;
</p></blockquote><p>
So there you go folks, hash once. This also leads nicely to my next topic &#8220;salts&#8221;</p>

<p><strong>Salts</strong></p>

<p>A lot of people when hashing passwords will do something like this :</p>

<p>$password = md5($password);</p>

<p>You may think this is secure, but actually it&#8217;s very insecure. Websites exist which store hashes of dictionary words, so if your database was ever stolen, the passwords could be looked up and revealed. This is where the power of the password salt comes in.&nbsp; Salts come in two varieties : A dynamic salt and a static salt. A dynamic salt is automatically generated and is usually very hard to guess. A good example of a dynamic salt would be :
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$salt </span><span style="color: #007700">= </span><span style="color: #0000BB">microtime</span><span style="color: #007700">(); </span>
</span>
</code></div><p>
It&#8217;s not totally random, but you get the idea.</p>

<p>You would then concatenate the salt along with the password to provide a new hash. This new hash can&#8217;t be looked up because of it&#8217;s &#8220;randomness&#8221;. You would then store it with other user info and select it when you need to log them in.</p>

<p>I know what you&#8217;re thinking. If the database is stolen they&#8217;ve got the password and the dynamic salt &#8220;What good is that?!&#8221; This is where a static salt comes in.</p>

<p>A static salt is just that, a variable that is random in both length and characters. This is best stored in a configuration file somewhere. You then combine this with the dynamic salt to provide a very secure solution. Reasons being: (a) If the database is stolen, they are missing the static salt; (b) Two passwords the same will result in a different hash. Here&#8217;s an example:
</p><div class="codeblock"><code><span style="color: #000000">
<span style="color: #0000BB">$dynamic_salt </span><span style="color: #007700">= </span><span style="color: #0000BB">microtime</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">$static_salt </span><span style="color: #007700">= </span><span style="color: #DD0000">'qGPBA8iCM3cUuCbBAQx3E0uOkKTrSeEUiSrAkykEk4sEniyP67Q2BTp8vtDqoqw'</span><span style="color: #007700">; </span><span style="color: #FF8000">// Grabbed from file.<br /></span><span style="color: #0000BB">$password </span><span style="color: #007700">= </span><span style="color: #DD0000">'password'</span><span style="color: #007700">; </span><span style="color: #FF8000">// Password from input form.<br /><br /></span><span style="color: #0000BB">$hashed_password </span><span style="color: #007700">= </span><span style="color: #0000BB">sha1</span><span style="color: #007700">(</span><span style="color: #0000BB">$dynamic_salt</span><span style="color: #007700">.</span><span style="color: #0000BB">$password</span><span style="color: #007700">.</span><span style="color: #0000BB">$static_salt</span><span style="color: #007700">); </span><span style="color: #FF8000">// Super Secure! </span>
</span>
</code></div>

<p><strong>Forgotten Password</strong></p>

<p>Ooops, the user has forgotten their password. What are we going to do? Michael Wales made a well informed post about this topic a while ago, but it was recently lost.</p>

<p>The best method is to use a secret question and answer system coupled with email verification.</p>

<p>The logic would be something like this:</p>

<p>User requests new password -> Sends email verification code -> Verification code is looked up in the database -> Show secret question -> Check Answers</p>

<p>I prefer this system because a hacker could of got into your email account and requested a new password, but would then struggle to get your secret question right. Keeping the users account secure.</p>

<p><strong>DB Sessions</strong></p>

<p>This will be a quick talk. At the moment Redux stores a &#8220;users_id&#8221; in the session cookie and uses this to figure out if the user is logged in or not. A hacker could use the algorithm in CodeIgniter&#8217;s session library and craft his own cookie with a fake &#8220;user_id&#8221;.</p>

<p>Database sessions move this data from the clients cookie to the database providing a scenario where the client can&#8217;t edit it. Redux doesn&#8217;t currently use this, but it is in the works.</p>

<p>Thanks for listening to me babble on, hope you enjoyed it.</p>

<p>PS : All examples above are used in <a href="http://code.google.com/p/reduxauth/">Redux</a> so go download it <img src="http://ellislab.com/images/smileys/smile.gif" width="19" height="19" alt="smile" style="border:0;" /></p>

<p>- Mathew Davies</p>

<p><a href="http://codeigniter.com/forums/viewthread/83844/">Discuss this article</a>
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter 1.6.3 Maintenance and Security Release</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_163_maintenance_and_security_release/" />
      <id>tag:codeigniter.com,2008:news/15.4772</id>
      <published>2008-06-26T23:52:00Z</published>
      <updated>2008-06-27T00:02:51Z</updated>
      <author>
            <name>Derek Jones</name>
            <uri>http://derekderekderek.com/</uri>      </author>

      <content type="html"><![CDATA[
        <p>We are happy to release CodeIgniter version 1.6.3 today.&nbsp; Version 1.6.3 is primarily a maintenance release, with a variety of bug fixes and some refinement to existing features (with a few new ones tossed in for good measure).&nbsp; Details of course can be found in the <a href="http://codeigniter.com/user_guide/changelog.html">Change Log</a>.</p>

<p>Additionally, with the assistance of an outstanding community member, <a href="http://expressionengine.com/forums/member/57813/">Pascal Kriete (Inparo)</a>, we have identified and eliminated a potential cross-site scripting vulnerability.&nbsp; No known sites have been affected, but as we take security very seriously, we felt it warranted a feature-light point release to help users protect their sites.&nbsp; We cannot thank Pascal enough for the manner in which he reported this issue to us, and then continuing to diligently work with us to make sure the vulnerability was plugged.&nbsp; If you&#8217;re looking for a fresh set of eyes to do a security audit on your app, he comes highly recommended by the EllisLab staff.</p>

<p>Command line addicts: don&#8217;t forget that starting with version 1.6.1, the CodeIgniter subversion contains <a href="http://codeigniter.com/user_guide/installation/downloads.html">tagged releases</a>!
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Community Voice &#45; Michael Wales</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_community_voice_michael_wales/" />
      <id>tag:codeigniter.com,2008:news/15.4738</id>
      <published>2008-06-20T03:30:00Z</published>
      <updated>2008-06-20T03:41:51Z</updated>
      <author>
            <name>Derek Allard</name>
            <uri>http://www.derekallard.com</uri>      </author>

      <category term="Community Voice"
        scheme="http://codeigniter.com/news/category/community_voice/"
        label="Community Voice" />
      <content type="html"><![CDATA[
        <p>EllisLab is blessed with two of the greatest communities that can be found anywhere on the internet in ExpressionEngine and more recently CodeIgniter.&nbsp; Despite being a relative newcomer to the scene, the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.&nbsp; From time to time we want to highlight some of these talented people, and we&#8217;ve asked them to lend their voice to ours.&nbsp;  <em><a href="http://codeigniter.com/forums/viewannounce/81650_49/">Have your voice</a></em>.&nbsp; I hope you enjoy what they have to say as much as I did.</p>

<p>This week,&nbsp; our Community Voice author is <a href="http://michaelwales.com/">Michael Wales</a>, a programmer, a father, an aspiring author, and an award winning Airman.&nbsp; For the past 3 years, he&#8217;s been focusing the majority of his time on  CodeIgniter. He is among the most consistent contributors to the community, has released numerous libraries and tutorials, and is one of the most highly sought after freelancers within the community.</p>

<p>What follows is a summary in his own words of how CodeIgniter has changed how he works, and how he develops.</p>

<hr>

<p>90% of my work comes from word-of-mouth, which means I can never have my name in too many places. Although I claim to be a CodeIgniter Programmer, I&#8217;m willing to take on a vanilla PHP project if the client insists (although I&#8217;ll definitely fight for CI beforehand). I&#8217;ve been known to crank out a web design or two and anyone that subscribes to my blog knows I often drift off into topics completely unrelated to programming (Battlestar Galactica, the military, etc).<br />
 
Why do I stretch myself so thin? Because it gets my name out there. I want &#8220;CodeIgniter Programmer&#8221; to by synonymous with &#8220;Michael Wales.&#8221; Cocky? Self righteous? Conceited? Maybe - but I&#8217;ve always been determined to be the absolute best at whatever I aim to achieve. CodeIgniter has given me that goal to aim for - to be honest, it&#8217;s changed my life completely.<br />
 
CodeIgniter, the Framework, has allowed me to work for clients with vastly different requirements. Whether it&#8217;s the hottest new Web 2.0 site, a corporate Intranet, a portal for a gaming community, or a local business&#8217; website - and believe me, I&#8217;ve done them all.<br />
 
CodeIgniter empowers me to deliver the best possible product I can to the client.<br />
CodeIgniter empowers me to deliver a product at a cheaper price than many competitors because I can complete it twice as fast.<br />
CodeIgniter empowers me to let clients utilize whatever architecture they want because CodeIgniter&#8217;s going to work.<br />
 
CodeIgniter, the Community, has given me friends that will last a lifetime. Whether it&#8217;s chatting into the wee hours of the night about the wife and kids, walking me through a bit of code I&#8217;m just not getting my head around, or putting in a good word for me with a client - and believe me, I&#8217;ve done them all.<br />
 
CodeIgniter empowers me to meet new people, learn about new cultures, and see things &#8220;in another man&#8217;s shoes.&#8221;<br />
CodeIgniter empowers me to seek out new opportunities and to encourage me when I take a risk.<br />
CodeIgniter empowers me to admit when I need help and to allow others to help me.<br />
 
CodeIgniter, the Clients, have changed my outlook on life and given me a renewed hope that things will be okay. Whether it&#8217;s giving me a project that starts my daughter&#8217;s college fund, paying me up-front for a project before it&#8217;s complete when I need the money, or allowing me to supplement my military paycheck so that my family can live more comfortably - and believe, I&#8217;ve done them all.<br />
 
CodeIgniter empowers me to seek out new challenges and attack problems from &#8220;outside the box.&#8221;<br />
CodeIgniter empowers me to become a better listener, follower, leader, husband, father, and man.<br />
CodeIgniter empower me to overcome all obstacles and complete the task at hand.<br />
 
 <br />
CodeIgniter empowers me - and my family - to leave our Air Force family behind in April 2009 at the end of my enlistment. Although it&#8217;s scary - hell, it&#8217;s downright petrifying - I know we will be okay. I know we&#8217;ll always be welcome in the CodeIgniter family.<br />
 
- Michael D. Wales</p>

<p><a href="http://codeigniter.com/forums/viewthread/82820/">Discuss this article</a>
</p>      ]]></content>
    </entry>

    <entry>
      <title>Japanese CodeIgniter book</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/japanese_codeigniter_book/" />
      <id>tag:codeigniter.com,2008:news/15.4679</id>
      <published>2008-06-09T14:06:00Z</published>
      <updated>2008-06-09T14:21:55Z</updated>
      <author>
            <name>Derek Allard</name>
            <uri>http://www.derekallard.com</uri>      </author>

      <content type="html"><![CDATA[
        <p>A testament to the strength and flexibility of CodeIgniter is how quickly its been adopted internationally.&nbsp; Today, some of the very active users at <a href="http://codeigniter.jp/">CodeIgniter Japan</a> have released <a href="http://codeigniter.jp/tettei/">CodeIgniter Tettei Nyumon</a> (The Definitive Guide to CodeIgniter).&nbsp; Congratulations Katz Kawai, Kenji Suzuki, and Ken Ando from the entire EllisLab team!</p>

<p><img src="http://codeigniter.com/files/ci_blog/ci_japan_book.jpg" width="317" height="400" alt="CodeIgniter Tettei" />
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter Community Voice &#45; Elliot Haughin</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_community_voice_elliot_haughin/" />
      <id>tag:codeigniter.com,2008:news/15.4667</id>
      <published>2008-06-09T12:53:00Z</published>
      <updated>2008-06-20T03:41:58Z</updated>
      <author>
            <name>Derek Allard</name>
            <uri>http://www.derekallard.com</uri>      </author>

      <category term="Community Voice"
        scheme="http://codeigniter.com/news/category/community_voice/"
        label="Community Voice" />
      <content type="html"><![CDATA[
        <p>EllisLab is blessed with two of the greatest communities that can be found anywhere on the internet in ExpressionEngine and more recently CodeIgniter.&nbsp; Despite being a relative newcomer to the scene, the people attracted to CodeIgniter are among the smartest, most talented and down-to-earth developers around today.&nbsp; From time to time we want to highlight some of these talented people, and we&#8217;ve asked them to lend their voice to ours.&nbsp;  <em><a href="http://codeigniter.com/forums/viewannounce/81650_49/">Have your voice</a></em>.&nbsp; I hope you enjoy what they have to say as much as I did.</p>

<p>This week,&nbsp; our Community Voice author is <a href="http://www.haughin.com/">Elliot Haughin</a> who discovered CodeIgniter in 2006 and instantly became a huge fan of its DRY-MVC-OO-MATYCSASA (More Acronyms Than You Can Shake A Stick At) - sleek, efficient, and (worryingly) sexy coding practices.&nbsp; He went on to <a href="http://www.haughin.com/screencasts">produce a series of coding screencasts</a> dedicated to exploring the power and simplicity of the CodeIgniter Framework.&nbsp; He loves peppercorn sauce, once trained for 3 years to become a ninja in the hope of being accepted into a nin-ternship (a very secret and dangerous ninja internship)‚ (It didn&#8217;t work), and has never visited the north pole without a wooly hat.</p>

<p>What follows is a voice recording and transcript of Elliot&#8217;s thoughts on what attracted him to CodeIgniter.</p>

<hr>

<p><a href="http://codeigniter.com/files/ci_blog/ci_can_opener.mp3">CodeIgniter is a heck of a can opener</a></p>

<p>CodeIgniter is one of those things that just does a job perfectly. Take for example, the humble can opener. Whilst there may be a few other ways to open a can of tuna, the can opener just &#8216;works&#8217; it serves a simple, yet extremely efficient purpose, and does its job with perfection.</p>

<p>CodeIgniter is exactly that. A can opener.</p>

<p>It&#8217;s a lightweight, efficient, full-featured web application framework that&#8217;s flexible enough to use for any type of web app. It&#8217;s built from ground-up with just one purpose - to make our lives easy; without sacrificing functionality, speed, or flexibility.</p>

<p>If most of your web applications share functionality across the board, you wouldn&#8217;t rewrite all that functionality for every one of them would you? - It&#8217;d be a ridiculous waste of time. CI is basically the skeleton for all my web applications. And instead of spending my time creating core functionality, I can spend my time building application level functionality.</p>

<p>When I first install CodeIgniter, I take 1 minute to configure a few settings, and then I&#8217;m away coding how the web application will work. Rapid is very much an understatement.</p>

<p>I&#8217;ve used CodeIgniter to build a basic content management system, an Enterprise Level XML-RPC based backend, a file mangement system, a blog, a photo gallery, a forum, a recruitment site&#8230; you name it, CodeIgniter just &#8216;fits&#8217;.</p>

<p>I don&#8217;t think I&#8217;d ever go back to development without CodeIgniter. It&#8217;s saved me hundreds in headache pills, and will probably continue to save me thousands more.</p>

<p><br />
<a href="http://codeigniter.com/forums/viewthread/81819/">Discuss this article</a>
</p>      ]]></content>
    </entry>

    <entry>
      <title>Wiki Article Discussions Added</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/wiki_article_discussions_added/" />
      <id>tag:codeigniter.com,2008:news/15.4643</id>
      <published>2008-06-04T05:19:00Z</published>
      <updated>2008-06-04T05:23:22Z</updated>
      <author>
            <name>Derek Jones</name>
            <uri>http://derekderekderek.com/</uri>      </author>

      <content type="html"><![CDATA[
        <p>We have added a new feature to the <a href="http://codeigniter.com/wiki/">CodeIgniter Wiki</a>: discussions, tied to the CodeIgniter forums.&nbsp; Threads will be automatically created and linked for you via the discussion links found at the bottom of wiki articles.&nbsp; More details about this integration can be found at a <a href="http://expressionengine.com/blog/entry/its_my_life_dont_you_forget/">blog post</a> made in the ExpressionEngine blog, as well as a free ExpressionEngine extension to implement this on your own sites that utilize the ExpressionEngine wiki and discussion forum.&nbsp; Enjoy!
</p>      ]]></content>
    </entry>

    <entry>
      <title>CodeIgniter v1.6.2 Released</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/codeigniter_v162_released/" />
      <id>tag:codeigniter.com,2008:news/15.4521</id>
      <published>2008-05-13T14:43:00Z</published>
      <updated>2008-05-17T11:58:06Z</updated>
      <author>
            <name>Derek Jones</name>
            <uri>http://derekderekderek.com/</uri>      </author>

      <content type="html"><![CDATA[
        <p>We&#8217;re pleased to announce that CodeIgniter version 1.6.2 has been officially released.&nbsp; This release includes more than 29 bug fixes and 34 feature additions and enhancements.&nbsp; Among these are some improvements to Active Record and transactional database interaction, the introduction of a constants file, improvements to the Zip library, a Compatibility Helper, new features to the File Helper, the removal of closing PHP tags from the framework files, and many other goodies.&nbsp; Checkout the <a href="http://codeigniter.com/user_guide/changelog.html">Change log</a> for the full details!</p>

<p>Paired with this release is the introduction of Tags in the Subversion server for version snapshots.&nbsp; <abbr title="Command Line Interface">CLI</abbr> geeks, starting with version 1.6.1, you can checkout/export full release versions directly from Subversion.&nbsp; Details can be found on the <a href="http://codeigniter.com/downloads/">downloads page</a>.&nbsp; As always, check the <a href="http://codeigniter.com/user_guide/installation/upgrading.html">simple upgrade instructions</a> if you are running a previous version of CodeIgniter.&nbsp; We are also now <a href="http://twitter.com/CodeIgniter">on Twitter</a>.
</p>      ]]></content>
    </entry>

    <entry>
      <title>EllisLab Hiring, Two Positions Available</title>
      <link rel="alternate" type="text/html" href="http://codeigniter.com/news/ellislab_hiring_two_positions_available/" />
      <id>tag:codeigniter.com,2008:news/15.4316</id>
      <published>2008-03-19T22:36:00Z</published>
      <updated>2008-03-19T22:38:01Z</updated>
      <author>
            <name>Derek Jones</name>
            <uri>http://derekderekderek.com/</uri>      </author>

      <content type="html"><![CDATA[
        <p>We&#8217;re pleased to announce two openings at EllisLab. </p>

<p>The first is for <a href="http://ellislab.com/company/jobs/#code_mechanic">Code Mechanic</a>, a new development team position:</p>

<blockquote><p>The Code Mechanic will be responsible for escalated support issues and bug investigation, and will be actively engaged with the community of third party developers.&nbsp; The Code Mechanic will become responsible for maintaining the current code base for ExpressionEngine and all of its First Party Add-Ons. The Code Mechanic will also be required to help keep the User Guide and Add-on documentation up to date.</p></blockquote><p> </p>

<p>Code Mechanic is a full time salaried position with benefits. </p>

<p>The second opening is for the <a href="http://ellislab.com/company/jobs/#senior_technical_support_specialist">Senior Technical Support Specialist</a> position:</p>

<blockquote><p>The Senior Technical Support Specialist (STSS) is the link between the support staff, the development team, and customer service. The STSS is responsible for ensuring that all support requests are resolved in a timely and expedient manner, and that no issues are missed or left unresolved. This includes properly categorizing issues, following up on open issues, and escalating issues to the development team or customer service as necessary. The STSS will also help manage support related materials (such as the Knowledge Base and wiki), and help identify and create ways to improve our support and customer interactions.</p></blockquote>

<p>The STSS is a part-time position. </p>

<p>Full job descriptions and qualifications are available on the EllisLab <a href="http://ellislab.com/company/jobs/">Jobs page</a>. </p>

<p>To apply email . Your email will include a formal resume, examples of previous work, and be a showcase of your use of email as a primary communication tool. </p>

<p>&nbsp;</p>

<p>&nbsp;</p>      ]]></content>
    </entry>


</feed>