-
winfreak posted...
Oh my god... It costs too much :((
-
winfreak posted...
Hmm... Edit Plus is not that good, I would like an lightweight editor with code complitons and things that your does... Is there anything outside?
-
winfreak posted...
Hello there :)!
This is just a cool tutorial, but I have one question: What editor do you use for PHP?
-
tom posted...
me too i d'ont understand...
-
steve posted...
Hi shawn, when is the new tutorial coming? I'm really excited of the next one. Thanks for the Great Tuts. I hope there's more to come
-
steve posted...
Hi Shawn, can you give some teaser on what's coming?
-
seb posted...
hi Shawn, I followed everything until I changed the controller name and got this
Fatal error: Class 'Controller' not found in C:\xampp\htdocs\code\application\controllers\main.php on line 2
I can t access the index file anymore.
the syntax is good, the URI are good. what is it?
-
obet posted...
very very nice tutorial... thank you very much for this... I followed all of 'em and even while following it I used different field names because I already had those... it was still working... hope there will be more... thanks a lot... great tutorial
-
kors posted...
$this->session->set_userdata('userEmail', $user->userEmail);
$this->session->set_userdata('userId', $user->userId);
$this->session->set_userdata('userType', $user->userType);
in this case i have a error message ...
??????????????????????????
maybe like this ?
$this->session->set_userdata('userEmail', $user[0]->userEmail);
$this->session->set_userdata('userId', $user[0]->userId);
$this->session->set_userdata('userType', $user[0]->userType);
-
koen posted...
Hi,
I think I've double checked everything, but my when I open login_form, the fields and submit button are not displayed. I get an html page with the fieldset, legend and labels, but no input fields nor a submit button. All the form commands are not parsed. What could this be? Please help me, I'm eager to learn.
Cheers, Koen
-
jonathan hill posted...
shawn,
it is already included in the autoload array but still won't work. see below:
$autoload['libraries'] = array('database', 'session', 'form_validation');
the other autoloaded libraries above work fine. the only thing i can think of is that i have changed the name of the system folder for security purposes and changed it in the index.php file accordingly, although i suspect this probably has nothing to do with it.
any ideas?
thanks
jonathan
-
jonathan hill posted...
shawn,
great tutorial thanks.
i have a reoccuring issue with codeigniter. i'm starting to really like it for it's simplicity and other things but i just can't get the sessions to work in any way at all. i always get the 'Trying to get property of non-object' error message. no matter what i try, whenever i initiate a session i am getting this. i have tried the codeigniter documention and various forums and i'm still getting the same message. any ideas as to why this may be?
thanks
jonathan
-
joe posted...
Hey shawn,
Thanks for the tutorials. I did have a question...
Why does it appear as if you validate the user twice and make two calls to the database?
Couldn't you have simply skipped the 'login' function in the users model and instead set your session data when you ran the form validation (or vice versa, skipped the authentication at form validation and just run the login() function)?
-
joe posted...
Cool... I was just making sure I wasn't missing something.
Thanks a lot for the tutorials. Top notch... especially for someone like me who is attempting to simultaneously develop both his codeigniter and jquery skills. :-)
-
hexal16 posted...
I have similat problem. If i enter email that is in the DB, but wrong password, it would log me in, but it should show the error email/password combination incorrect...
-
asif posted...
So far your codeIgniter video tutorials are the best on web.
Please keep going.
-
alex posted...
tx, for the tutorial can't wait for part 4
-
abaam posted...
I really like your video tutorials, very helpful and informative. thank you for sharing :-)
i want to like you a great web developer ;-). i wish more video tut to come :-) from you.
-
Zumry posted...
Tnx alot .......
-
Xavier posted...
Hi, Shawn -
What's the name of the editor used in the video?
Thanks!
-
Xavier posted...
Hi, Shawn -
Thanks for your response!
I have one more question. Let's assume a form has been submitted to your server and has been validated via $this->form_validation->set_rules(). And let's assume that you now want to access one of the form's variables in the controller. It appears that there are two ways to do this:
1) set_value( $form_variable )
2) $this->post->( $form_variable )
Which one would you choose, and under what conditions would one be preferred over the other?
Thanks in advance.
Warm Regards,
Xavier
-
Tony Dew posted...
No, thank you! Good to hear that there may be more tutorials in the future.
Coincidentally, my wife is going to give birth soon to, but we're still a few months out. ;)
-
Tony Dew posted...
I have learned so much from watching your tutorial vids. Thank you so much. You do a great job of explaining the "how and why's" and present info at a perfect pace for me.
Please keep the screencasts coming!
As a thanks I went to donate to your caffeine fund, but $3 just didn't seem enough. Yet at the PayPal page, I can't find a way to increase the donation amount. Instead of handing PayPal a bunch of transaction fees for a number of donations, is there a way to give a single larger amount?
-
Tom posted...
I just want to say thank you for the awesome tutorials. I'm hoping you will post alot more ;)
-
Steven Richardson posted...
Hi Shawn,
I have followed your screencast up to this point and now I am stumped. I get a blank white screen when I load the user model into the contruct. If i comment out the code it shows the form. I have tried to use error_reporting(E_ALL) to throw an error but can't seem to do so. Any ideas what could be causeing the issue?
Would really love to continue your tutorials.
Many thanks
Steven
-
Shawn McCool posted...
try:
ini_set('display_errors', 'on');
-
Shawn McCool posted...
Really, that .htaccess should be:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
ErrorDocument 404 index.php
-
Shawn McCool posted...
I recorded a new one, then got sick. I'm hoping to get the editing done and get it uploaded this week! Thanks for the feedback.
-
Shawn McCool posted...
Correct, my suggestion is to have an employer purchase it for you. There are other alternative editors. I've heard good things about Eclipse with Aptana (Probably close to the same as Zend Studio) and I know that Komodo Edit is free.
EditPlus is a pretty decent editor, too. It's more lightweight and very affordable. If you end up going with EditPlus I have a really nice light on dark color scheme that I used for years if you'd like it.
-
Shawn McCool posted...
@winfreak
Zend Studio 5.5
I’ve since upgraded to Zend Studio 7 with mixed results.
-
Shawn McCool posted...
@jonathan
In application/config/autoload.php be sure to include 'session' in your libraries autoload array.
-
Shawn McCool posted...
@joe
I'm not happy with some bits of the functionality as they stand. I've tried to make the code functional at the end of each screencast so it's gotten to be a little messy. It's not terrible, but it'll be cleaned up in the next screencast where we really tighten everything that we've done.
Your suggestion is a good way to handle this. I'm not completely satisfied with the way CodeIgniter handles form validation at all. The inability to return an object from the validation method "run()" is one thing.. But, I don't like how CodeIgniter doesn't offer a clean way to reuse forms in multiple places across a site. Currently, if you want to have the same form in two places you need to duplicate all of the form_validation->set_rules() calls, etc.
-
Shawn McCool posted...
@abaam
Thank you for the kind words. If you have any criticisms or suggestions about the screencasts I'd like to hear them.
-
Shawn McCool posted...
@Xavier
Zend Studio. PHPed is just as good, better in some ways.
-
Shawn McCool posted...
@Xavier
I wouldn't use set_value except for in a form since it's part of the form_helper.
You could get around using set_value in the controller by using the ternary operator.
$value = $this->input->post('variable') ? $this->input->post('variable') : 'default value';
This would check to see if the post variable is set, if so.. set the $value variable to the contents of the post variable. Otherwise, set the $value to 'default value'.
-
Shawn McCool posted...
@Tony
Thank you so much for your donation. I really appreciate it. I'm working hard to finish up some projects for clients right now trying to build a nest egg as my wife is a few weeks away from giving birth. Once I wrap a few things up I'm hoping to contribute more to this site.
-
Shawn McCool posted...
@Tom
Great, I'm glad that you're finding them useful. I'm aiming to publish a new one this upcoming weekend.
-
Shawn McCool posted...
@Max
The quickest way to resolve this is to echo the query after the get();
$this->db->get('users');
echo $this->db->last_query();
die();
-
Shawn McCool posted...
@Maurice
In your application/config/autoload.php file add user_model into the model array.
-
Shawn McCool posted...
@Maran
Have you made sure that your form is using POST and not GET?
-
Shawn McCool posted...
@Kris
Great idea. I'll start zipping these kinds of files up in the root folder of the project.
-
Shawn McCool posted...
@Koen
Try to go into your config.php file and enable "rewrite short tags"
-
Shawn McCool posted...
@Jason
Either add the user_model to the config/autoload.php or add
$this->load->model('user_model');
to your controller's constructor. I suggest the former.
-
Shawn McCool posted...
@Dex
Frankly, it all comes down to the WordPress plugins. I'm currently running 20 some odd plugins that automate a number of things for me. I can definitely see myself migrating to something like Expression Engine 2 at some point... But, honestly.. I'm running my own consulting company and my clients always take priority over this site. It's all I can do to try to keep new content on this site and to make small improvements to it over time. I think that if I was using something besides WordPress the site would suffer in quality, at least at this point. Once I get some more time to really take it all in the direction I want then things will be better, but I'd rather focus on content than platform. Content can be migrated, but a platform without content is useless.
-
Shawn McCool posted...
@Dan
Thanks for your input on the md5() call.
Regarding the documentation: http://www.phpdoc.org/
-
Shawn McCool posted...
@Carlos
Thank you for your feedback and your compliments. Please do not hesitate to let me know if you feel that any aspects of web development with jQuery, PHP, or CodeIgniter should be covered here. I'm very interested in getting to know what challenges programmers of various experience levels are facing and in exploring solutions to the challenges.
-
Shawn McCool posted...
@Carlos
I'm glad to hear the topics in which you're interested. It so happens that many of these will be covered in the next couple screencasts in this series. Once we get basic front-end auth interactions running and complete we'll be creating a CRUD to manage users.
I'll find a way to include WYSIWYG integration once that's complete. Maybe we'll have a profile management page or something.
Thanks for the reply, though. I'm glad to have some feedback on direction so that I'm not creating videos that nobody cares to see.
-
Shawn McCool posted...
@seb
I assume that you're using CI 2. Try CI_Controller.
-
Sergio posted...
Great tuts man (Y)!!
-
Paul posted...
Hey Shawn,
Excellent tutorials, given me a lot to go on. Any news when the next in the series will be?
-
Mitch posted...
Thanks for the tut. Here are the bugs i found in the source code:
1.
in main.php;
function _check_login
line should be $user = $this->user_model->GetUsers(array('user_email' => $userEmail, 'user_pass' => md5($this->input->post('userPassword'))));
names were userEmail and userPassword, which doesn't match up with what is in user_model->GetUsers.
2.
same with
function login() under if($this->form_validation->run()) ;
should be;
if($this->user_model->Login(array('user_email' => $this->input->post('userEmail'), 'user_pass' => $this->input->post('userPassword'))))
3.
'false' is typo'd as 'flase' a few times.
-
Max posted...
hmm ok i have a problem with md5 function... it's ok. thanks for your help.
-
Max posted...
Thanks for this tips Shawn.
The query is OK when i die() and I test echo in my database. GetUsers seems to be OK.
But, if I delete "die();" and I try Login() i have alway "false" return and last_query equals : "SELECT * FROM (`candidate`) WHERE `mail` = 'xx' AND `password` = 'xx'SELECT * FROM (`candidate`) WHERE `mail` = 'xx' AND `password` = 'xx'false" He seems to concatain 2 request. My Login() looks like your sample copy/past.
-
Max posted...
Hi,
Thanks for these awesome tutorials.
But ! I have a problem.
When I GetUsers() I have all my users.
When I GetUsers(array('password'=>md5($this->input->post('password')))) I have my user wich has this password.
When I GetUsers(array('mail'=>$this->input->post('mail'))) I have my User wich has this mail.
Whien I GetUsers(array('password'=>md5($this->input->post('password')),'mail'=>$this->input->post('mail')) I have 0 user.
What can I do ?
My GetUsers() method looks like your sample.
-
Maurice posted...
Hi Shawn
Downloaded your source files for this tutorial, and attempted to duplicate your results.
Received this error message: Fatal error: Call to undefined method User_Model::login() in D:\xampp\htdocs\codeigniter\system\application\controllers\main.php on line 19
When line 19 is commented out, app runs just fine.
This is the line:
if($this->user_model->Login(array('userEmail' => $this->input->post('userEmail'), 'userPassword' => $this->input->post('userPassword'))))
Any theories?
Thanks, Maurice
-
Maran posted...
Shawn, Great Videos... Thank you very much. I'm getting an error "The URI you submitted has disallowed characters.", after i submit with the emaiId and password. Note: This user info is not created in the DB. My URL looks like "http://localhost/part3/main/login".
Appreciate some help here.
Thanks, Maran
-
Maran posted...
@Cameron,
http://codeigniter.com/forums/viewthread/48911/ this thread is not available. How did you solve the .htacess problem. I'm running into the same problem.
Appreciate your help.
Thanks, Maran
-
KRD posted...
Shawn,
Thanks for posting the code. I think the HD video is excellent, I don't find it hard to read at all and it is great to see the full screen width in the video. I'm looking forward to the next video...I feel like I'm really catching on to Code Igniter thanks to your tutorials.
Cheers
Kris
-
KRD posted...
Shawn,
Along with the code you should also post a text file with the SQL queries to set up the database. It's not a big deal for this series since there are only a few uncomplicated tables but you may want to add that to your to do list for posting new screencasts.
Cheers
Kris
-
KRD posted...
Good man.
-Kris
-
Jose posted...
hello, there was a problem regarding the user_model, when you login, even if the username was wrong but the password was correct, it would logged me in
-
Jeffrey posted...
great stuff, cannot weight for the next tut. Thanks
-
Jason posted...
Thanks. Forgot that I had to actually initiate the user_model. I missed that part at 14:12. Doh!
-
Jason posted...
Shawn,
I have successfully listed the users table as you suggested in the Part 2 screencast.
http://60dayflip.com/main/listing/
Thanks for the help!
Now I'm having a problem when I successfully log in.
http://60dayflip.com/main/login/
UN:guest@hotmail.com
PW:guest
Any clue why I'm getting an undefined property? I've used your code verbatim.
"Message: Undefined property: Main::$user_model"
-
Jabga posted...
Wow a long and tasty tutorial.
It was the best codeigniter tutorial I ever seen. Thank you Shamn
-
Horizone posted...
Really good tutorials!
Helped me out a lot with my project!
Looking forward to some more helpful tutorials in the future...
Many thanks......
-
Gavin posted...
Brys - I had same problem as I'd forgot to set $config['rewrite_short_tags'] = TRUE;
-
Fred posted...
having a bit of a prob with the login page where after clicking on 'login' it doesnt seem to go the correct URL and returns an error msg.
I think I've the file settings right, but would appreciate if someone can spot something here. Cheers/
web pg error msg:
===============
Object not found!
The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
27/10/2010 00:17:33
Apache/2.2.14 (Win32) DAV/2 mod_ssl/2.2.14 OpenSSL/0.9.8l mod_autoindex_color PHP/5.3.1 mod_apreq2-20090110/2.7.1 mod_perl/2.0.4 Perl/v5.10.1
URL before clicking on 'login': http://localhost/ci/index.php/main/login
URL after clicking on 'login': http://localhost/ci/main/login
in config.php:
===============
$config['base_url'] = "http://localhost/ci/";
$config['index_page'] = "";
in view_login_form.php:
======================
.htaccess:
===============
RewriteEngine on
RewriteCond $1 !^(index\.php|img|css|js|video_files|robots\.txt|favicon\.ico)
RewriteRule ^(.*)$ /index.php/$1 [L]
-
Foxdith posted...
Except of being unable to rewrite my urls this was a great tutorial. Thank You.
-
Dustin posted...
Awesome tutorials! Keep 'em coming!
-
Dex Barrett posted...
Hey Shawn, since some time ago i've been planning to have a site with screencasts like this; i have one or two videos,actually.
The problem is i would like to have a good CMS to manage my videos. Does this template suits those needs? (i've understood it's Groovy Video) or what do you recommend to manage a screencast site?
-
Dex Barrett posted...
Hey Shaun.
Where are you hosting this site? Would you recommend it to run a screencast site like this? I'm looking for a good hosting.
-
Dan posted...
Yep, md5 function was off, in the controller is specifies to use the md5 around the post value, but the function already uses md5, so take that out of the controller.
By the way, this is for Shawn McCool or anyone who can answer the question, what is the commenting style that you use? Is it your own or formally specified anywhere?
-
Constantin posted...
The php code is ignored. The href looks like this: href="[opening_php_tag] echo base_url();[closing_php_tag]css/style.css".
-
Constantin posted...
Hello, world!
I created a css directory in my root folder and a style.css file in the css dir. I tried to load it with this line: <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" /> but it doesn't load my styles. That since I created the .htaccess file Shawn described in one of his tutorials. Can anybody help me with this?
Thanks.
-
Constantin posted...
Got it, I added |css to the RewriteCond. Thanks anyway! :D
-
Ciprian posted...
please make another tutorial ,i love your tutorials so far.thanks
-
Charlie posted...
Shawn,
For for some reason, the line 7 from the dashboard.php class ( echo "welcome to the dashboard " . $this->session->userdata('userEmail'); ) only outputs "welcome to the dashboard". Is there something I am missing?
ci project: http://www.mediafire.com/?edwtasdhzgadr2r
-
Carlos posted...
Shawn,
Thankyou for your fast reply, that's another sign that you are indeed a Pro.
Well, I'm not a expert php programer but clearly codeigniter is a big help to create complete php apps.
I think that your 3 first tutorials are well in place to start any application.
I have some ideas to other tutorials that can be implemented in almost any website:
- Create/manage some kind of catalog (used in a online store/ portfolio) this can be used to manage users too.
This tutorial would be much useful because the whole CRUD thing involved.
- Based on the tutorial above and Admin interface to administer a website,including WYSIWYG integration.
- The always needed Shopping cart
- Create menus (dymanic) this is based on a lot of request in the codeigniter forums.
- Security and best practices.
- Templating
I have a lot more ideas, but based on your 3 tutorials published so far this could be inplemented in the "Dashboard" you are programing.
Thankyou again for helping us to understand how things are done in the Pro way.
Carlos
-
Carlos posted...
Shawn,
I'm glad I've found your website. Seriusly you have the best tutorials on codeigniter around.
As "Awesome" said you coding style is pro. We are all learning great stuff from you.
Please keep your great work and feed us with more tasty tutorials.
Thankyou!
-
Carlos posted...
I use notepad++ for coding; fast start, supports UTF-8 without BOM, lots of pluggins and can use colors scheme like textmate.
:)
-
Carlos posted...
Hey Shawn, glad to hear a new tutorial is coming!!
Thanks
-
Carlos posted...
Hey Shawn Merry Xmas!!
Any news about your codeigniter tutorials?
-
Cameron posted...
Well...I figured the .htaccess problem out with what I found here: http://codeigniter.com/forums/viewthread/48911/
Now I'm pretty sure for some reason my _check_login function isn't working, because I can't force it to throw an error like you did by commenting out the if statement, and I can't get it to echo the confirmation message when I leave the if statement in there.
I get no errors when I submit the form. Any ideas what could cause this?
-
Cameron posted...
Shawn,
I've really enjoyed these tutorials so far. I'm having a problem with the .htaccess file. I made the adjustments you made (to the config) in this tutorial, but I get a 404 File Not Found error when I type the URL "main/login" to see the login form view.
I set my text editor to view hidden files and there isn't a .htaccess file there. When I created one and typed the information you have in yours on the tut, I get an Internal Server Error.
Any suggestions? I'm using MAMP for my local development environment if that helps.
-
Brys posted...
Hello there Shawn,
I'm trying to do this tutorial but when I coded the forms and refresh my browser, I can't see the email field and password field.. also the login button...
-
Brett posted...
Great Tutorials. I don't think I've seen better on the subject.
-
Awesome posted...
I now know how drug addicts feel. I need more tutorials!!!!
-
Awesome posted...
Dude, you seriously have some of the best tutorials online. Your coding style is pro status. Much respect.
-
Adrian Gould posted...
Charlie, I am experiencing the same issue - the session ID is changing with every page refresh, which means I am not getting any data baseed through...
I did a check by adding:
echo "
";
print_r($this->session);
echo "";
at various points, and found the session ID changing... so, something is a little awry...
Shawn, any pointers as to what may be happening?
Side, note - this tutorial series has been great. I'm refreshing my CI coding after using various platforms and environments, so it been good to get back to basics and relearn.