<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>CodeIgniter Tutorial</title>
	<atom:link href="http://www.gotphp.com/author/admin/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gotphp.com</link>
	<description>Practical Coding Examples and Advice For PHP Developers</description>
	<lastBuildDate>Tue, 06 Sep 2011 01:01:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>What&#8217;s Your Biggest Frustration with Building Software Apps Using CodeIgniter?</title>
		<link>http://www.gotphp.com/biggest-frustration-building-software-apps-codeigniter/54661/</link>
		<comments>http://www.gotphp.com/biggest-frustration-building-software-apps-codeigniter/54661/#comments</comments>
		<pubDate>Tue, 06 Sep 2011 01:01:02 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>

		<guid isPermaLink="false">http://www.gotphp.com/?p=661</guid>
		<description><![CDATA[I&#8217;ve been working with CodeIgniter for many years and I&#8217;ve used it to build several production level apps for my clients and for myself. In general, I find it a great framework. However that was not always the case, especially when just starting out. What I&#8217;d like to do is start putting together some practical<a class="moretag" href="http://www.gotphp.com/biggest-frustration-building-software-apps-codeigniter/54661/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working with CodeIgniter for many years and I&#8217;ve used it to build several production level apps for my clients and for myself.</p>
<p>In general, I find it a great framework. However that was not always the case, especially when just starting out.</p>
<p>What I&#8217;d like to do is start putting together some practical and some real in-depth CodeIgniter tutorials for you to help shorten your learning curve&#8230;but I need your help.</p>
<p>So, please take this 3 minute survey and tell me what frustrates you the most about building web apps using CodeIgniter.</p>
<p><a href="http://www.surveymonkey.com/s/9T3BLWZ" target="_blank">http://www.surveymonkey.com/s/9T3BLWZ</a></p>
<p>Thanks in advance!</p>
<p><em>PS. I&#8217;ll enter everyone who fills out the 3 minute survey into a drawing to win a $100 Apple Gift Card.</em></p>
<p>Michael</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/biggest-frustration-building-software-apps-codeigniter/54661/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Docs</title>
		<link>http://www.gotphp.com/docs/</link>
		<comments>http://www.gotphp.com/docs/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 03:38:43 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<guid isPermaLink="false">http://www.gotphp.com/?page_id=653</guid>
		<description><![CDATA[PHP Docs Language Reference Function Reference CodeIgniter Docs CodeIgniter User Guide]]></description>
			<content:encoded><![CDATA[<h3 id="section-1">PHP Docs</h3>
<ul>
<li><a href="http://www.php.net/manual/en/langref.php" target="_blank">Language Reference</a>
<li><a href="http://www.php.net/manual/en/funcref.php" target="_blank">Function Reference</a>
</ul>
<h3 id="section-2">CodeIgniter Docs</h3>
<ul>
<li><a href="http://codeigniter.com/user_guide/" target="_blank">CodeIgniter User Guide</a>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/docs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Top CodeIgniter Tutorials for New CodeIgniter Developers</title>
		<link>http://www.gotphp.com/top-codeigniter-tutorials-for-new-codeigniter-developers/54511/</link>
		<comments>http://www.gotphp.com/top-codeigniter-tutorials-for-new-codeigniter-developers/54511/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 04:00:17 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[CodeIgniter Developers]]></category>
		<category><![CDATA[codeigniter tutorial]]></category>

		<guid isPermaLink="false">http://www.gotphp.com/?p=511</guid>
		<description><![CDATA[One of my clients runs a very large offshore application development business. I manage two teams of developers building some really cool internal apps that &#8220;processify&#8221; manual tasks; and we use CodeIgniter to help expedite the development process. Occasionally a new developer will join our team with little to no experience with the CodeIgniter framework.<a class="moretag" href="http://www.gotphp.com/top-codeigniter-tutorials-for-new-codeigniter-developers/54511/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>One of my clients runs a very large offshore application development business. I manage two teams of developers building some really cool internal apps that &#8220;processify&#8221; manual tasks; and we use CodeIgniter to help expedite the development process. Occasionally a new developer will join our team with little to no experience with the CodeIgniter framework. Here&#8217;s a collection of the top CodeIgniter Tutorials that I have them go through to bring them up to speed fast.</p>
<h2 id="section-1">CodeIgniter &#8211; Getting Started</h2>
<ul>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-basics/" target="_blank">Everything You Need to Get Started With CodeIgniter</a></li>
<li><a href="http://net.tutsplus.com/articles/news/easy-development-with-codeigniter" target="_blank">Easy Development With CodeIgniter</a></li>
</ul>
<h2 id="section-2">Become a CodeIgniter Pro in 15 Days!</h2>
<ul>
<li><a href="http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-1/" target="_blank">Day 1: Getting Started With the Framework</a></li>
<li><a href="http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-2" target="_blank">Day 2: Database Selecting Methods</a></li>
<li><a href="http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-3/" target="_blank">Day 3: Sending Emails</a></li>
<li><a href="http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-4-newsletter-signup/" target="_blank">Day 4: Newsletter Signup</a></li>
<li><a href="http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-5-crud/" target="_blank">Day 5: CRUD</a></li>
<li><a href="http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-6-login" target="_blank">Day 6: Login</a></li>
<li><a href="http://net.tutsplus.com/articles/news/codeigniter-from-scratch-day-7-pagination/" target="_blank">Day 7: Pagination</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-day-8-ajax/" target="_blank">Day 8: AJAX</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-file-uploading-and-image-manipulation/" target="_blank">Day 9: File Uploading and Image Manipulation</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-the-calendar-library/" target="_blank">Day 10: The Calendar Library</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-file-operations/" target="_blank">Day 11: File and Directory Operations</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-shopping-cart/" target="_blank">Day 12: Shopping Cart</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-extending-the-framework/" target="_blank">Day 13: Extending the Framework</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-security/" target="_blank">Day 14: Security</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/codeigniter-from-scratch-profiling-benchmarking-hooks/" target="_blank">Day 15: Profiling, Benchmarking &amp; Hooks</a></li>
</ul>
<h2 id="section-3">Other Sample CodeIgniter Tutorials Worth Reviewing</h2>
<ul>
<li><a href="http://net.tutsplus.com/tutorials/php/building-an-rss-2-0-feed-with-codeigniter/" target="_blank">Build an RSS 2.0 Feed with CodeIgniter</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/working-with-restful-services-in-codeigniter-2/" target="_blank">Working with RESTful Services in CodeIgniter</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/basecamp-style-subdomains-with-codeigniter/" target="_blank">Basecamp Style Subdomains With CodeIgniter</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/creating-a-file-hosting-site-with-codeigniter/" target="_blank">Creating a File Hosting Site with CodeIgniter</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/how-to-build-a-shopping-cart-using-codeigniter-and-jquery/" target="_blank">How to Build a Shopping Cart using CodeIgniter and jQuery</a></li>
<li><a href="http://net.tutsplus.com/tutorials/php/how-to-update-your-twitter-status-with-codeigniter/" target="_blank">How to Update your Twitter Status with CodeIgniter</a></li>
</ul>
<p><strong>All of these CodeIgniter Tutorials are provided for free by <a href="http://tutsplus.com/amember/go.php?r=46623&amp;i=b4" target="_blank">NetTuts.com</a>. Share your favorite CodeIgniter Tutorials in the comments below.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/top-codeigniter-tutorials-for-new-codeigniter-developers/54511/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>My Top Places to Find The Best PHP Jobs Online</title>
		<link>http://www.gotphp.com/my-top-places-to-find-the-best-php-jobs-online/54457/</link>
		<comments>http://www.gotphp.com/my-top-places-to-find-the-best-php-jobs-online/54457/#comments</comments>
		<pubDate>Sat, 16 Oct 2010 17:36:07 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[PHP Jobs]]></category>
		<category><![CDATA[local php jobs]]></category>
		<category><![CDATA[php developer jobs]]></category>
		<category><![CDATA[php job board]]></category>
		<category><![CDATA[php jobs]]></category>
		<category><![CDATA[remote php jobs]]></category>

		<guid isPermaLink="false">http://www.gotphp.com/?p=457</guid>
		<description><![CDATA[At some point in your php development career, you will have to go out and find a new job. Thankfully there are a lot of php developer jobs out there for you to choose from, however the best php jobs are spread across just a few key php job boards. These are my top 4<a class="moretag" href="http://www.gotphp.com/my-top-places-to-find-the-best-php-jobs-online/54457/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>At some point in your php development career, you will have to go out and find a new job. Thankfully there are a lot of php developer jobs out there for you to choose from, however the best php jobs are spread across just a few key php job boards.</p>
<p><strong>These are my top 4 places to find the best php jobs online…</strong></p>
<h2 id="section-1">#1 &#8211; 37signals Job board</h2>
<p><a href="http://gotphp.com/go/37signals" target="_blank"><img class="alignleft size-full wp-image-461" title="37signals Job Board" src="http://www.gotphp.com/wp-content/gotphp-uploads/37signals.jpg" alt="" width="200" height="150" /></a></p>
<p>The 37singals job board has a sub-section for programming jobs and you can easily filter that down to jobs in php. <strong>The cost to post a php job here is very high so most recruiters don&#8217;t use it.</strong> This is good for you because the companies that do use it are serious about looking for the best php developers directly.</p>
<p>Searching for PHP resulted in only 30 matches with several locations listed as &#8220;Anywhere&#8221;, which is great for <strong>php developers who like to work remotely</strong>!</p>
<p><em>Note &#8212; This is where I found one of my best clients that I have been consulting with for over a year now. They are based out of North Carolina and I am in Louisville, Kentucky.</em></p>
<p>RSS Feed: <a href="http://jobs.37signals.com/categories/2/jobs.rss" target="_blank">http://jobs.37signals.com/categories/2/jobs.rss</a></p>
<h2 id="section-2">#2 &#8212; SimplyHired &#8211; Job Search Made Simple (I agree)</h2>
<p><a href="http://gotphp.com/go/simplyhired" target="_blank"><img class="alignleft size-full wp-image-460" title="SimplyHired - Job Search Simple Easy" src="http://www.gotphp.com/wp-content/gotphp-uploads/simplyhired.jpg" alt="" width="200" height="150" /></a></p>
<p>The SimplyHired job board is probably the number one aggregated job board online today. Their searching, sorting, &amp; location filters are hard to be beat for sure, <strong>however the results are not always as they appear</strong>.</p>
<p>A simple search for PHP returns over 17,000 listings with includes many health related jobs like &#8220;CLINICAL INSTRUCTOR &#8211; PHP/IOP&#8221; so you have to filter that crap out.</p>
<p><strong>Be warned though that most of the listings on this site are created by recruiters and head hunters, not the real companies looking for php developers directly.</strong> This means that the recruiters will pre-screen you before connecting you with the real company which is not always in your best interest. I&#8217;d much rather talk to the hiring manager than work through a proxy head hunter that has never coded a day in their life!</p>
<p>RSS Feed: <a href="http://www.simplyhired.com/a/job-feed/rss/q-php/l-louisville,+ky/mi-50" target="_blank">http://www.simplyhired.com/a/job-feed/rss/q-php/l-louisville,+ky/mi-50</a> (Louisville for local to me, replace with your city for local to you.)</p>
<h2 id="section-3">#3 &#8212; Startuply &#8211; Startup Companies, Startup Jobs</h2>
<p><a href="http://gotphp.com/go/startuply" target="_blank"><img class="alignleft size-full wp-image-459" title="Startuply" src="http://www.gotphp.com/wp-content/gotphp-uploads/startuply.jpg" alt="" width="200" height="150" /></a></p>
<p>Pros &#8211; The concept here is excellent, if you are looking to join a startup. <strong>However the pay is often on par with startup income, which is zero.</strong> A lot of listings want you to work for little to no pay. Get in that sweat equity early!</p>
<p>One of the good things about this site is that the listings are mostly from the companies that are looking for php developers and not recruiters. However I find that <strong>most of their php job listings are often stale and outdated</strong>. They don&#8217;t do a real good job at expiring old listings so your search results are often much less than stated.</p>
<p>Also, most jobs are on-site and in major tech cities so if you don&#8217;t live nearby, then you probably won&#8217;t be landing any of those jobs anytime soon.</p>
<p>RSS Feed: <a href="http://www.startuply.com/Rss/Search.aspx?s=php" target="_blank">http://www.startuply.com/Rss/Search.aspx?s=php</a></p>
<h2 id="section-4">#4 &#8212; Craigslist &#8211; Local, Local, Local</h2>
<p><a href="http://gotphp.com/go/craigslist" target="_blank"><img class="alignleft size-full wp-image-458" title="Craigslist" src="http://www.gotphp.com/wp-content/gotphp-uploads/craigslist.jpg" alt="" width="200" height="150" /></a><strong>Craigslist is GREAT for finding local php jobs.</strong> Simply drill down to your city and head over to the jobs section. Search for PHP and you should find several local jobs &#8220;usually&#8221; listed by the actual companies looking for php developers, but not always. So be sure to review each listing thoroughly.</p>
<p>RSS Feed: <a href="http://louisville.craigslist.org/search/jjj?query=php&amp;format=rss" target="_blank">http://louisville.craigslist.org/search/jjj?query=php&amp;format=rss</a> (Louisville for local to me, replace with your city for local to you.)</p>
<p><br clear="all" /></p>
<p>I know there are a lot of other php job boards our there and probably many more places to find php developer jobs online, so please <strong>share your favorite php job board with everyone in your comments below</strong>. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/my-top-places-to-find-the-best-php-jobs-online/54457/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Tip &#8211; How To Switch Between Two Databases</title>
		<link>http://www.gotphp.com/codeigniter-tip-how-to-switch-between-two-databases/54442/</link>
		<comments>http://www.gotphp.com/codeigniter-tip-how-to-switch-between-two-databases/54442/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 18:05:15 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[codeigniter multiple databases]]></category>
		<category><![CDATA[database]]></category>

		<guid isPermaLink="false">http://www.gotphp.com/?p=442</guid>
		<description><![CDATA[Most development starts locally (meaning local to the developer). This &#8220;usually&#8221; means that your database is local as well. However once your application is online and live, you now have two databases to keep up with for future development and most importantly ongoing testing. Here&#8217;s a little tip on how to manage both database settings<a class="moretag" href="http://www.gotphp.com/codeigniter-tip-how-to-switch-between-two-databases/54442/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>Most development starts locally (meaning local to the developer). This &#8220;usually&#8221; means that your database is local as well. However once your application is online and live, you now have two databases to keep up with for future development and most importantly ongoing testing.</p>
<p>Here&#8217;s a little tip on how to manage both database settings from your local sandbox and easily switch between the two databases.</p>
<p><strong>Simply add two database config blocks in your database.php config file and use the $active_group variable to switch between the two databases.</strong></p>
<pre class="brush:php">$active_group = "default";
$active_record = TRUE;

$db['default']['hostname'] = "localhost";
$db['default']['username'] = "root";
$db['default']['password'] = "";
$db['default']['database'] = "pm5_client";
$db['default']['dbdriver'] = "mysql";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

$db['coaching']['hostname'] = "db.domain.com";
$db['coaching']['username'] = "xxx";
$db['coaching']['password'] = "xxx";
$db['coaching']['database'] = "xxx";
$db['coaching']['dbdriver'] = "mysql";
$db['coaching']['dbprefix'] = "";
$db['coaching']['pconnect'] = TRUE;
$db['coaching']['db_debug'] = TRUE;
$db['coaching']['cache_on'] = FALSE;
$db['coaching']['cachedir'] = "";
$db['coaching']['char_set'] = "utf8";
$db['coaching']['dbcollat'] = "utf8_general_ci";</pre>
<p><strong>In the example above, if I want to <span style="text-decoration: underline;">connect to my local database</span> I use:</strong></p>
<pre class="brush:php">$active_group = "default";</pre>
<p><strong>And if I want to <span style="text-decoration: underline;">connect to my remote (production) database</span>, I use:</strong></p>
<pre class="brush:php">$active_group = "coaching";</pre>
<p><strong>That&#8217;s it. Enjoy!</strong></p>
<p><script type="text/javascript" src="http://forms.aweber.com/form/32/159230832.js"></script></p>
<p><strong>If you found this article useful, please share your comments below.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/codeigniter-tip-how-to-switch-between-two-databases/54442/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter File Upload And Email Example</title>
		<link>http://www.gotphp.com/codeigniter-file-upload-and-email-example/54438/</link>
		<comments>http://www.gotphp.com/codeigniter-file-upload-and-email-example/54438/#comments</comments>
		<pubDate>Sat, 18 Sep 2010 04:18:58 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Email Library]]></category>
		<category><![CDATA[File Uploading Library]]></category>
		<category><![CDATA[Form Helper]]></category>
		<category><![CDATA[Form Validation Library]]></category>

		<guid isPermaLink="false">http://www.gotphp.com/?p=438</guid>
		<description><![CDATA[One of the benefits of using CodeIgniter is how it allows you to simplify tasks that used to be fairly complicated to code on their own. Why reinvent the wheel when you don&#8217;t have to. In this example, I&#8217;ll use the following CodeIgniter Libraries &#38; Helpers to display a file upload form that sends the<a class="moretag" href="http://www.gotphp.com/codeigniter-file-upload-and-email-example/54438/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>One of the benefits of using CodeIgniter is how it allows you to simplify tasks that used to be fairly complicated to code on their own. Why reinvent the wheel when you don&#8217;t have to.</p>
<p>In this example, I&#8217;ll use the following CodeIgniter Libraries &amp; Helpers to display a file upload form that sends the uploaded file to a user via email.</p>
<ul>
<li>File Uploading Library</li>
<li>Email Library</li>
<li>Form Validation Library</li>
<li>Form Helper</li>
</ul>
<h2 id="section-1">Step 1: Load all the libraries &amp; helpers in your controller.</h2>
<pre class="brush:php">// Load upload library &amp; set config preferences
$config = array(
	'upload_path' 	=&gt; '/tmp',
	'allowed_types' =&gt; 'gif|jpg|png'
);
$this-&gt;load-&gt;library('upload', $config);

// Load email library &amp; set config preferences
$config = array(
	'protocol' =&gt; 'mail'
);
$this-&gt;load-&gt;library('email', $config);

// Load form validation library
$this-&gt;load-&gt;library('form_validation');

// Load form helper
$this-&gt;load-&gt;helper('form');</pre>
<h2 id="section-2">Step 2: Combine form validation, file uploading, &amp; email libraries together seamlessly.</h2>
<pre class="brush:php">// Set form validation rules
$this-&gt;form_validation-&gt;set_rules('contact', 	'Contact', 	'trim|required|xss_clean');
$this-&gt;form_validation-&gt;set_rules('email', 		'Email', 	'trim|required|valid_email|xss_clean');
$this-&gt;form_validation-&gt;set_rules('userfile', 	'File', 	'trim');
$this-&gt;form_validation-&gt;set_error_delimiters('<span class="error">', '</span>
');

// Run form validation
if ($this-&gt;form_validation-&gt;run() === FALSE) {		

// Form validation failed based on validation rules set above

// Show form
$this-&gt;_tpl('uploadexample');

} else {

// Form validation success

// Use PHP's internal $_FILES superglobal to test for valid
if ($_FILES["userfile"]["name"]) {

	// Do the file upload
	$this-&gt;upload-&gt;do_upload();

	// Get upload errors
	$errors = $this-&gt;upload-&gt;display_errors();

	// There was an error uploading the files. Since this is
	// just an example, die.
	if ($errors) {
		die($errors);
	}

	// Get upload data assuming no errors
	$upload_data = $this-&gt;upload-&gt;data();

}

// Set email data from the form submission
$email    = set_value('email');
$contact  = set_value('contact');

// Set the email subject
$subject  = 'Form Submission';

// Set the email message
$message  = "From: $contact &lt;$email&gt;\n";
$message .= "Datetime: ".date("Y/m/d h:m:s A")."\n\n";
$message .= "-------------------------------\n\n";
$message .= "contact : ".set_value('contact') ."\n";
$message .= "email : ".set_value('email') ."\n";
$message .= "-------------------------------\n\n";

// Add file data to the message if it is set
if ($upload_data) {
	$message .= "file name : ".$upload_data['file_name'] ."\n";
	$message .= "file type : ".$upload_data['file_type'] ."\n";
}

// Configure the email message
$to = ""; ## DEFINE ME
$cc = "";
$bcc = "";
$this-&gt;email-&gt;to($to);
$this-&gt;email-&gt;cc($cc);
$this-&gt;email-&gt;bcc($bcc);
$this-&gt;email-&gt;from($email);
$this-&gt;email-&gt;reply_to($email, $contact);
$this-&gt;email-&gt;subject($subject);
$this-&gt;email-&gt;message($message);

// Attach the uploaded file if it is set
if ($upload_data) {
	$this-&gt;email-&gt;attach($upload_data["full_path"]);
}

// Send the email
$this-&gt;email-&gt;send();		

// Show the internal email debugger if you experience errors.
echo $this-&gt;email-&gt;print_debugger();

// Redirect on success
//redirect('uploadexample/thankyou', 'location');</pre>
<h2 id="section-3">Step 3: Lastly, use the form helper in your template to easily render your file upload form.</h2>
<pre class="brush:php">&lt; ?=form_open_multipart('uploadexample')?&gt;

&lt;table cellpadding="2"&gt;
&lt;tr&gt;
	&lt;td&gt;Contact Name:&lt;/td&gt;
	&lt;td&gt;
		&lt;?php
		$data = array
			(
				'name'        =&gt; 'contact',
				'id'          =&gt; 'contact',
				'value'       =&gt; (set_value('contact')) ? set_value('contact') : $contact,
				'maxlength'   =&gt; '255',
				'size'        =&gt; '25',
		    );
		echo form_error('contact');
		echo form_input($data);
		?&gt;
	&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
	&lt;td&gt;Email:&lt;/td&gt;
	&lt;td&gt;
		&lt;?php
		$data = array
			(
				'name'        =&gt; 'email',
				'id'          =&gt; 'email',
				'value'       =&gt; (set_value('email')) ? set_value('email') : $email,
				'maxlength'   =&gt; '255',
				'size'        =&gt; '50',
		    );
		echo form_error('email');
		echo form_input($data);
		?&gt;
	&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
	&lt;td&gt;Upload Image:&lt;/td&gt;
	&lt;td&gt;
		&lt;?php
		$data = array
			(
				'type'        =&gt; 'file',
				'name'        =&gt; 'userfile',
				'id'          =&gt; 'userfile',
				'value'       =&gt; (set_value('userfile')) ? set_value('userfile') : $userfile,
				'size'        =&gt; '50',
		    );
		echo form_error('userfile');
		echo form_input($data);
		?&gt;
		&lt;br /&gt;
		Supported files: .gif. jpg. png
	&lt;/td&gt;
&lt;/tr&gt;

&lt;tr&gt;
	&lt;td colspan="2"&gt;&lt; ?=form_submit('submit', 'Submit')?&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;

&lt; ?=form_close()?&gt;</pre>
<p><strong>Download the files and test it out.</strong></p>
<p><script src="http://forms.aweber.com/form/32/159230832.js" type="text/javascript"></script></p>
<p><strong>If you found this article useful, please share your comments below.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/codeigniter-file-upload-and-email-example/54438/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Short URL Redirect Example</title>
		<link>http://www.gotphp.com/codeigniter-short-url-redirect-example/54427/</link>
		<comments>http://www.gotphp.com/codeigniter-short-url-redirect-example/54427/#comments</comments>
		<pubDate>Sat, 11 Sep 2010 14:36:09 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
				<category><![CDATA[Articles]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[CodeIgniter Redirect]]></category>
		<category><![CDATA[CodeIgniter URL]]></category>
		<category><![CDATA[Redirect]]></category>
		<category><![CDATA[Short Redirect]]></category>
		<category><![CDATA[Short URL]]></category>

		<guid isPermaLink="false">http://www.gotphp.com/?p=427</guid>
		<description><![CDATA[By now everyone is probably familiar with URL shorting services. I would venture to say that you are exposed to short URLs at least several times a day, especially if you are an avid Twitter user. There are a lot of companies providing these services and URL shorting apps for your own domain are becoming<a class="moretag" href="http://www.gotphp.com/codeigniter-short-url-redirect-example/54427/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>By now everyone is probably familiar with URL shorting services. I would venture to say that you are exposed to short URLs at least several times a day, especially if you are an avid Twitter user. There are a lot of companies providing these services and URL shorting apps for your own domain are becoming more and more common.</p>
<p>The gotcha here is that if you use 3rd-party URL shorting services, you are basically giving up control of each URL you add to a system outside of your own. <strong>This means that if a service goes out of business or suffers from an outage, consider all of your links dead. If you are doing SEO, that could mean a lot of lost traffic!</strong></p>
<p>For this site, I am in the process of writing my own URL shorting service in CodeIgniter. However if you have seen any of my recent Twitter links or newsletter links you may have already noticed that I am using a custom URL shorting service: gotphp.com/go/X</p>
<p>The PHP script I am using temporarily is provided by <a href="http://yourls.org/" target="_blank">http://yourls.org/</a>, which is OK at best for a free script. (It get&#8217;s the job done for now.)</p>
<h3 id="section-1">So, back to the CodeIgniter Short URL Redirect Example.</h3>
<p>CodeIgniter has support for custom URL routing rules. This is great as it allows us to instantly configure any number of short URL options without doing a lot of coding. Yeah!</p>
<p>Here&#8217;s how easy it is to pull this off in CodeIgniter.</p>
<h2 id="section-2">Step 1 &#8211; Configure your routes.php file.</h2>
<pre class="brush:php">
// --------------------------------------------------------------------
// Create a short URL
//
// This URL: http://www.example.php/go/1
//
// Will translate to: http://www.example.php/redirectexample/short/foo/$1
// --------------------------------------------------------------------
$route["go/(:any)"] = "redirectexample/short/foo/$1";</pre>
<p>Here&#8217;s how this breaks down.</p>
<ul>
<li>The controller file we are calling is <em>&#8220;/apps/controllers/redirectexample.php&#8221;</em>.</li>
<li>The method in that controller that will be executed is named <em>&#8220;short&#8221;</em>.</li>
<li>The variable that will be available in that method will be <em>&#8220;$foo&#8221;</em>.</li>
<li>The value of the variable will be anything in the URL after the string <em>&#8220;go/X&#8221;</em>.</li>
</ul>
<h2 id="section-3">Step 2 &#8211; Create the controller and method to handle the short URL service.</h2>
<pre class="brush:php">
class Redirectexample extends MY_Controller {

	// --------------------------------------------------------------------

	/**
	 *	The constructor
	 */
	function __construct()
	{
		parent::__construct();
	}

	// --------------------------------------------------------------------

	/**
	 *	The default method for this controller
	 */
	function index()
	{
		// Nothing here yet.
	}

	// --------------------------------------------------------------------

	/**
	 *	A method for handling short URL's defined in the routes.php config file
	 */
	function short()
	{
		// Use the custom debugger to show the value of $foo for this example
		$this-&gt;debugger-&gt;display($this-&gt;uri_data["foo"]);
	}

	// --------------------------------------------------------------------

}</pre>
<p><strong>And that does it! Extremely simple in my opinion.</strong></p>
<p><em>I&#8217;ll add this example to my CI build later today. If you have subscribed to this blog, you&#8217;ll get an email with a download link to the updated build when it is ready.</em></p>
<p><script type="text/javascript" src="http://forms.aweber.com/form/32/159230832.js"></script></p>
<p><strong>If you found this article useful, please share your comments below.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/codeigniter-short-url-redirect-example/54427/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Got Questions? Get Advice.</title>
		<link>http://www.gotphp.com/got-questions-get-advice/</link>
		<comments>http://www.gotphp.com/got-questions-get-advice/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 20:05:13 +0000</pubDate>
		<dc:creator>Michael</dc:creator>
		
		<guid isPermaLink="false">http://www.gotphp.com/</guid>
		<description><![CDATA[Hello there and welcome to the &#8220;Got Questions? Get Advice.&#8221; section of gotphp.com. I&#8217;ve been building web apps for over 10 years now and I enjoy helping others solve problems. Use the contact form below to ask me any application design or CodeIgniter related questions and I&#8217;ll do my best to give you straight forward<a class="moretag" href="http://www.gotphp.com/got-questions-get-advice/">&#160;&#160;Full Article&#8230;</a>
]]></description>
			<content:encoded><![CDATA[<p>Hello there and welcome to the &#8220;Got Questions? Get Advice.&#8221; section of gotphp.com.</p>
<p>I&#8217;ve been building web apps for over 10 years now and I enjoy helping others solve problems.</p>
<p>Use the contact form below to ask me any application design or CodeIgniter related questions and I&#8217;ll do my best to give you straight forward answers and advice from my past experiences.</p>
<p>Please note that good questions will be turned into blog posts.</p>
<p>I look forward to hearing from you!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gotphp.com/got-questions-get-advice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

