Continuing on from Day 3, we'll expand our little application into a simple newsletter signup form. This will allow us to taker a closer look at both the email and the form_validation classes. Learn it all in this 30 minute screencast.
Catch Up
Day 4
- Follow us on Twitter, or subscribe to the Nettuts+ RSS Feed for more daily web development tuts and articles.
Related Posts
Check out some more great tutorials and articles that you might like
Plus Members
Source Files, Bonus Tutorials and
More for $9 a month for all TUTS+
sites in one subscription.











User Comments
( ADD YOURS )Joseph Wilson August 12th
I spent most of yesterday refreshing my browser…waiting for the next installment in the series! *blushes*
Thanks, Jeffrey, for continuing the series. (And no, I haven’t watched this video yet.
)
( )Shane August 12th
Me too – thanks for continuing the series Jeffrey!
( )Jeffrey Way August 12th
Thanks, guys!
Joseph Wilson August 12th
Okay…just finished it! “Fully awesome!”
( )Mohsen August 12th
Watching the tut…
( )thanks
ibura August 12th
thank you jeff, i am building my knowledge base only from you.
( )Johan August 12th
Nice! Just one little thing:
Did’nt you say in the first video that you would walk the “readers” thru writing an CMS? We are already in video 4 of 10 and it’s still very basic stuff going on (only fetching from database). To me the email-class seems like it should be coming a little further down the line…
The quality is very good though, and I hope you’ll continue with the series.
( )Jeffrey Way August 12th
I can’t begin teaching how to build a CMS until I’ve taught the basics.
( )Jeffrey Way August 12th
Keep in mind that this series is for beginners who have no experience working with the MVC pattern. It takes time…
Shane August 12th
That email label’s for attribute references the name input incorrectly. Sorry to be a pedant!
Good stuff Jeffrey!
( )Jeffrey Way August 12th
The label references the id of the input.
( )Shane August 12th
Yeah – I know what the ‘for’ attribute is um… for
Your second label’s ‘for’ attribute associates it with the first input (the name input.)
The second label’s for attribute should have a value of email.
Jeffrey Way August 12th
Oh, hehe. I guess that ruins the entire tutorial then.
Shane August 12th
I’m sure we can let you off, just this once
(And I did apologise
)
Yoosuf August 12th
gonna watch, should be a nice one as usual
( )Drazen Mokic August 12th
Well done Jeffrey!
Just a little thing, you did not xss_clean the input fields ‘name’ and ‘email’, maybe you are using global xss cleaning? I think especially beginners should learn to use this every time they work with user input.
Apart from that, thanks for the tutorial, great work!!!
( )Jeffrey Way August 12th
Did I not mention turing on global xss cleaning in the video? I thought I did. If not, we’ll go over that in Day 5.
( )Chad Hietala August 12th
Keep them coming Jeffery! All of these screencasts allows me to get a better grasp of the MVC pattern.
( )asdoaw August 12th
Jeffrey why dont you just press cmd+tab instead of using this silly window explorer
( )Jeffrey Way August 12th
Because I don’t.
( )Lee August 13th
Its much more Swoooooshy to do it like that, don’t you agree?
Great tut Jeff, look forward to the rest!
Chris August 12th
Yes! Chicken enchiladas and CodeIgniter. It’s a great day! Thanks Jeffrey!
( )jlapitan August 12th
thanks jeff, i just started from Day1.. hehe.. i would like to teach this on my class also, im using your video tutorials about “jquery for absolute beginners” for my class now..
is there a way i can download your complete video tutorials about jquery?
Thanks!
( )Jeffrey Way August 12th
Go to iTunes and search for “Nettuts.” They should come up for download.
( )Zac August 12th
I think updating a database should be included in the next tut. These are great videos! Thank you!.
( )DaViDz August 12th
Awesome, thanks from Spain
( )David Rojas August 12th
Another David from Spain here
( )Carlos August 15th
+1 from Madrid, Spain.
Jon Piehl August 12th
Question 1:
Is there a difference between the config you created (system_root) and the url helper (base_url)? If so, can you please explain.
Question 2:
I’m new to MVC so I was wondering why the $name_data array is set in the view instead of the controller and then passed to the view. The real question is when should variables be set in the controller and when should they be set in the view?
Thanks. These tuts are amazing!
( )Kevin August 12th
If you would write a big website, how do you keep things organized? Do you use subfolders for your views/controllers?
( )Drazen Mokic August 12th
Yes, if you have i.e. a site with an admin backend then you should use subfolders.
f.e.
-views
( )-welcome.php
-register.php
–admin
—index.php
—module1.php
—module2.php
harton August 12th
How to you call controllers in subfolders?
thx.
Drazen Mokic August 12th
Controllers are called over the URL…
domain.com/subfolder/controller …
Santiago Dimattía August 12th
@harton
Simply use:
$this->load->view(’folder/file’);
Note that you can only use one subfolder. If you use 2 or more, it will fail.
Santiago Dimattía August 12th
Ups, i think i’m tired.
Ignore my previous comment!
Lee August 13th
I follow the convention of putting all my views in a folder named after the controller, so:
BLOG
-Index
-Comments
– Etc
ADMIN
– Index
– Users
And call them like:
$this->load->view(’blog/index’);
Just my method, but keeps things nice and organised!
( )George August 12th
Hey guys, I am just waiting for the tutorial to load and I am going to watch it later, great series by the way.
( )Can I ask if you would consider offering us a download link to the video file as well?
David Rojas August 12th
You can download all nettuts videos in iTunes (search NETTUTS), or from blip.tv (in 2 qualities). This video is here: http://nettuts.blip.tv/file/2466799/
( )harton August 12th
Hi Jeff,
great tut.
One questions though:
Can you also use “return;” at a method in case you want to abort its action?
Considering your next tut:
It would be cool if you can show a tut that passes variables from the view into the controller up to the model and back.
thanks for your great work
( )cheers
harton
Greg McAusland August 12th
Loving this series, keep em coming!
( )Vasili August 12th
Though I don’t use CI (or any framework for that matter), I still enjoy watching these screencasts. I thought it was funny at first when you were typing the rules and didn’t have them as strings. I was thinking to myself that PHP would parse them as constants, which it did.
However, my favorite part has got to be the jQuery reference. This is why I love your videos, Jeffrey. They are always funny even if you don’t mean to make them.
( )Brian Temecula August 12th
CI evangelism at its finest.
( )Chris Brown August 12th
Another great tutorial in this series. I’ve really been taking away a lot from each video and even read ‘CodeIgniter for Rapid PHP Application Development’ in 3 days after following the first tutorial.
This is definitely one of the best video tutorial series to date from Nettuts…maybe even going to be better than the jQuery series. Thanks for the knowledge share!
( )Cecily August 12th
I was following along just fine until about 22 minutes in. In the tutorial when you pressed the Submit button to send the empty form, the page reloaded with error messages displaying. When I tried it on my setup, I got a 404 not found error. I’m not exactly sure why, as the send function is included in my email.php controller file. Do you know what might be causing this error?
( )Cecily August 12th
Never mind – I figured it out. It had to do with the configuration of my base_url, although I don’t know why it worked fine in episode 3 but not episode 4.
( )Jeffrey Way August 13th
My guess is that you forgot to rename the base_url within the config file to day4 (instead of day3)??
Johnathan August 13th
Hey Jeff, was wondering if you could maybe keep the names of each video the same like Codeigniter: Day x or w/e I have to keep changing them so they get added to my smart playlist in iTunes. Would make it look a whole lot more organised.
( )But apart from that they’re great.
Thanks
kamal August 13th
Hi Jeffrey Way,
Thank you for this tuto.
I search a tutorial of MVC symfony framworks,
Can you post a tutorial about this MVC
Thanks again
( )Domino August 13th
For anyone trying to make the download files work, the following needs to be changed:
1. Go to the routes.php in the application>config folder. Change the default controller from ’site’ to ‘email’.
Mr. Way, the index function in your ’site’ controller is missing a semi-colon and the closing curly brace.
( )Danijel August 13th
Just watched it. It’s great.
Wondering when Part 5 is out?
( )Jeffrey Way August 13th
Around next Tuesday.
( )Danijel August 13th
Can’t wait
Soner Gönül August 13th
That’s great! Thanks
( )Arnold August 13th
Thanks! Jeffrey…I think this is better than Day 3..because you’ve taught lots of good stuff right there…
In day 5…
how about we use some more sessions ?or use some javascript library like jQuery
I cant wait really for day 5..
( )yay!
Jim August 13th
Nice one. I might be jumping the gun here, but it would be cool to see a tutorial or two on using some of the third-party libraries (http://codeigniter.com/wiki/Libraries):
- IgnitedRecord for ORM
- Tank Auth for Authentication
- Modular Extensions for HMVC
Something along those lines. I’d also really like to see a tutorial for creating an admin area, but I understand you need to teach the fundamentals first. Either way, keep the CI tuts coming!
( )MEM August 13th
Those are very nice tutorials.
CodeIgniter should know about this and put a big link here. Very nice stuff. I’m absolutely new on frameworks, I have played a little with OOP so those tutorials feets like a charm.
I will however, not follow a path of lets use nice features BUT, lets learn more about basic features. Once we have the basic, we can move on on more complicated stuff.
For example: Build a menu, a pagination, working with joins… this kind of stuff, it’s the basic, but will allow us to properly develop.
Regards,
( )MEM
jeanv August 14th
great ! Thanks ! Keep on Jeffrey you’re doing a good job !
( )rosnovski August 14th
Jeff,
Nice screencast. I am glad you still are doing this. I wanted to know if you would be doing one with jquery used to do ajax and all the fun stuff you taught us with the jquery screencasts? anyways love all the screencasts so far and here’s to more good stuff. Keep it up sir!
( )benoa August 15th
Sweet! Thank you JW :^)
( )Bjørn endre August 15th
Great screencasts, Jeff! I didn’t know about CI before you started with these tutorials. I’m definitely going to use the framework in my current and future web projects.
A couple of things though; Could you provide a list with planned screencasts, like what topics and when you are going to cover them? And also, could you please bump secure login (with salts and sha1, user levels, the whole pack) up on that list?
I’m really looking forward to the next screencast, keep ‘em coming!
( )Javed Gardezi August 15th
Great series please continue on..
( )can not wait for next one… JW
Ronny-André Bendiksen August 16th
Jeffrey, is there a reason on why you’re not using shorthand PHP on the form_open() ?
( )timo.huber August 16th
thanks again.
( )i’ve learned a lot
Khalil August 18th
Dear Jeffrey Way,
I am learning from your posts these are very good for new students like me… Please share a post for Login Form with Validation on CI Framework.
( )Gonzalo August 18th
Thanks for the tutorial, Jeff. Any chance you share with us your Dreamweaver Coloring Scheme? It’s a dark one with brown tones… you used it here: http://net.tutsplus.com/videos/screencasts/easy-development-with-codeigniter/
It’s an XML file (Colors.xml) in Documents and Settings\<user\Application Data\Adobe\Dreamweaver CS4\en_US\Configuration\CodeColoring
Thanks in advance
( )Zach August 19th
Jeffrey,
Loving these videos. Constantly refreshing my iTunes podcasts window in the middle of the week to check for updates to the series.
Please please please keep up the good work.
Thanks so much.
( )bluepicaso August 24th
hello people i want to thank Jeffry Way, elliot and the tuts plus team for there screencasts here…..
I was a newbie to CI and this week I will be launching my first ever project(a travel site) totally based on codeigniter…
I’m just loving it… Thanx people…
follow me on twitter http://www.twitter.com/bluepicaso
( )Kevin August 26th
Hey jeffrey,
The last 3 tutorials were great. But this one doesn’t seem to work for me
It just shows the loading animation, even though the whole thing has finished loading. I’ve tried it in several different browsers.
Can you put up a download link of the video? It just doesn’t seem to work for me.
Anyways, the last 3 were great. Thanks alot. Keep up the good work!
( )Vaidotas August 26th
Where is day 5?
Cann’t wait
( )Jeffrey Way August 26th
Definitely Thursday, or Friday!
( )Guillermo Carrion August 28th
Great! Can’t wait!
Ryan August 28th
Can’t wait for day 5!!!
( )Ben August 28th
Dude your killing me whens the next one!!
Waiting…..
Loving them obviously!!!
( )Alvin Crespo August 30th
Purely amazing. I did not know that code igniter comes with such a powerful form validation class. This is awesome, thank you so much for taking the time to explain this to us. I feel like I have a good grasp on this framework now, with all that you have taught us in just 4 screencasts. The 5th one is next, cant wait!
( )patience September 1st
Video won’t play. Been trying for 2 days now.
( )Jeffrey Way September 2nd
How strange. I just added a link below the video where you can watch it directly at Blip.tv.
( )Wilson September 3rd
Thanks from Brazil!
( )I’m learning so much!
I love you man!
Chaky September 5th
Thanks for Hong Kong
( )I loving you….you re the bst
Isabela September 11th
The day 3 and 4 of this series had a very good timing in my project.Thanks Jeff.You’re doing a great job
( )Howard September 17th
Is there a “best practice” for multiple page forms?
For example, the user goes to page and enters some registration information. Based on the choices made in the form, the user is sent to a second page to fill out more information.
Do you hold the user data in session variables? Or to you update the database after every page?
Thanks!
( )Rich Webster September 18th
First, thank you for the series… quite good. I did have one problem with it, and maybe it was my fault. But for other newbies:
this->email->set_newline(’\r\n’); gave me problems.
it put a newline in the middle of the header, after sending. I think this is because the sending server (qmail, masquerading as sendmail) prepended some header info, then the newline appeared, then the rest of the header info supplied by the Email class appeared… The newline caused part of the header to appear in the body, including the multipart stuff, causing the html to not render, the mime info and some of the header info to look wonky, and me to tear out what little hair I have left. Removing the newline code restored my sanity.
So is my mail server weird? Did you ever figure out why the line needs to be there (since it seemed to solve MY problems to take it out)? Has anyone else had a similar experience?
The one thing I’ve done a bit different than this tutorial is: I was loading a pre-designed HTML page as the message, using read_file(), with the intent of creating a system that sends a series of emails to anyone who signs up, starting with the first and continuing monthly for a year… rather than your system that sends a just-saved message on demand. But that shouldn’t have affected the headers.
( )Gregory October 15th
Hi Jeff,
I noticed when you referenced the stylesheet it was for that single view, is it possible to reference a css file for all your views?
Thanks!
( )Maxx90 October 22nd
And third, and probably most importantly, simplifying the benefit formula as part of a larger Social Security reform. ,
( )anzahen October 27th
http://nettuts.blip.tv/file/2466799?filename=NETTUTS-CodeIgniterFromScratchDay4184.flv
( )where the video?
problem loading page
The server at nettuts.blip.tv is taking too long to respond.
t0m3k November 18th
Hi.
I’m getting strange issue:
Fatal error: Call to undefined function form_open() in C:\Program Files\WebServ\httpd\codeigniter\application\views\newsletter.php on line 15
Somebody knows what’s the problem?
( )I downloaded files from this page and I’m getting the same error.