I'm certainly not new to programming but I'm a framework n00b, I never needed to dive in until now. Your videos are just what I was looking for, I've had trouble finding a quick way in on how to use it properly. I believe Codeigniter is a good framework to start with, maybe I'll use it forever since the scaffolding stuff which for example Laravel provides seems nice at first sight, but I think you first have to do it yourself manually to actually understand what you're doing and give you control over it.
This video is far too old for 4.4.1. I was able to get this to work with CI 4.4.1. It took some doing and some splitting up of some lines and update the required functions in the three filter files. But because I work in subfolders, the code keeps trying to look into my localhost root rather than my project folder, but that should be easy to fix. I just hope there aren't other unforeseen issues as I have not tried logging in, registering, etc. I am taking baby steps with this, but so far, I like it! I edited this post because I don't give up easy with the issues I faced. I tackled them and conquered. It feels good because it really did NOT take but 15-20 minutes to fix. Not as tough as debugging regular PHP error message jargon!
Great tutorial! I have been using CI3 for more than 5 years and I'm starting now to transfer my codes to CI4. One question, what is the difference of setting up the variables in .env and setting them up in app/Config/App.php?
Hi, it's an old question but anyways... I guess .env file overrides variables in the app/Config/App.php file like it did in the app/Config/Database.php. The one of the benefits of it that; you can set the static vars in this config files and set the changable vars in the .env file. So you can configure vars easily. Alex talks about it in; ruclips.net/video/yqiTtDPbfCU/видео.html&pbjreload=101
Hi Alex, i see to create form you use standard input fields (HTML) but in codeignitor documentation have different input field form_input([$data = ''[, $value = ''[, $extra = ''[, $type = 'text']]]]) is it safe to use standard html input ? if so it easy. same time some says if i use standard html input use esc to text box so javascript injection will strop. can you kindly tell me best way to implement form inputs with security (simplest way is good) thank you.
Use any way you like. The validation of the fields will be done in the backend. So no need to worry about injection. Codeigniter will escape your input values when using validation and query builder. The esc($string) can be used in both cases. And with form_input() and with html
its very hard to find tutotial about CI4 .... and thx god dat u r exist! i wanna ask u question. how to get a total row in a table? if in mysql select count(*) from table_name where gender='male'; how do i get a total result of 'male' ???? thx
@@AlexLancer i try and its not working. i used a query in a controller $model = new UserModel(); $data['xdata'] = $model->where('gender', 'Female'); $data['xdata'] = $model->findAll(); i use that and i find all data that gender are Female. how to get count on that? i used countAll() still showing the error. thx before
hey Alex, whenever you create any project you change the directory path from httpd.conf file. can't we skip public from url using htaccess redirect ????
Hey Sonal, "public folder is meant to be the “web root” of your site, and your web server would be configured to point to it." - from codeigniter docs. So to answer your question, in theory you could, but it is more convenient to configure your server to point into public folder.
kind off. I have never used it before. from what I see though in the documentation you must use "redirect()->back()->withInput() " to be able to use old() helper. Would it work without redirect ? I think the idea here is that lets say you have a form under home/index but you want to validate post form under home/validation so when you need to go back to the home/index (ex. if no validation) and still keep the inputs you would use this method. just brainstorming. tell me if you find other use-case.
Sometimes if my users log in, another person's details will be displayed to them but go off after they refresh, please how can I solve this... I used your script.
@@AlexLancer I built the project on localhost and it works perfectly but on launching it to live server it gave me nightmares for 1 day but I have solved the problem
@@afobata5079 That's why I ask. What was the problem? Because you say that this tutorial does not work on live server. So describe please what was the issue to avoid misleading others or to let know what to be aware of. Maybe it is something that I should consider in my next tuts. Thank you in advance.
@@AlexLancer i cannot see the debug bar in the bottom, i use macosx catalina with VScode (or Netbeans) and the apache server of mac. The browser is firefox, do you have an idea why i cannot see it?
@@FilippoBerardo 2 things. When you start your project duplicate env file and name it .env Then uncomment CI_ENVIRONMENT and set it to 'development' . Also uncomment and set base url inside your .env file And you should be fine.
Thanks god that you exist really we need a mentor like to show us how codeigniter 4 is going on ! Keep going bro!
@Tomy Hawks thanks for the support.
Thank you for making simple yet comprehendable tutorials. It really helped me.
I'm certainly not new to programming but I'm a framework n00b, I never needed to dive in until now. Your videos are just what I was looking for, I've had trouble finding a quick way in on how to use it properly. I believe Codeigniter is a good framework to start with, maybe I'll use it forever since the scaffolding stuff which for example Laravel provides seems nice at first sight, but I think you first have to do it yourself manually to actually understand what you're doing and give you control over it.
Nice approach, niekvlessert. And yes, CI is very good.
This video is far too old for 4.4.1. I was able to get this to work with CI 4.4.1. It took some doing and some splitting up of some lines and update the required functions in the three filter files. But because I work in subfolders, the code keeps trying to look into my localhost root rather than my project folder, but that should be easy to fix. I just hope there aren't other unforeseen issues as I have not tried logging in, registering, etc. I am taking baby steps with this, but so far, I like it! I edited this post because I don't give up easy with the issues I faced. I tackled them and conquered. It feels good because it really did NOT take but 15-20 minutes to fix. Not as tough as debugging regular PHP error message jargon!
having an issue of not redirect to login page, shows the users at localhost,why is this?
by renaming env into .env i got issue on powershell: Closed without sending a request; it was probably just an unused speculative preconnection
Thanks a lot. I had been looking for a good tutorial for Codeigniter 4. This will help.
Glad it helped! You are welcome.
Great tutorial! I have been using CI3 for more than 5 years and I'm starting now to transfer my codes to CI4. One question, what is the difference of setting up the variables in .env and setting them up in app/Config/App.php?
Hi, it's an old question but anyways... I guess .env file overrides variables in the app/Config/App.php file like it did in the app/Config/Database.php. The one of the benefits of it that; you can set the static vars in this config files and set the changable vars in the .env file. So you can configure vars easily.
Alex talks about it in; ruclips.net/video/yqiTtDPbfCU/видео.html&pbjreload=101
Hi. I have got stuck in ajax request in codeigniter 4. Error " POST myurl 500 ( internal sever error)
Please Can you help me .
hi can you please share what addons you have added in your visual studio code? would be great help.
Muchas gracias todo super bien, saludos desde Cuba teacher
alex what software are you using is your os an ios or ms or something else i do not recognize
You are the man. best tutorial best sample code
thank you so much, sir. I have faced this form submit redirect issue past 2 weeks. now i got the solution
do you have this project with you jey?
this is compatibil with codeigniter 3?
the last part i got 404 - File not found but i try the same code with this $routes->match(['get','post'],'register', 'Users::register');
hey!! Why you didnt't use .htaccess instead of change xampp config file every time
please share more info
Hello Alex! I have the codelgniter 3 version... This project works in this versión too?
Bro, i think is not working... cause ci4 is very different of ci3
Hi Alex,
i see to create form you use standard input fields (HTML)
but in codeignitor documentation have different input field
form_input([$data = ''[, $value = ''[, $extra = ''[, $type = 'text']]]])
is it safe to use standard html input ? if so it easy.
same time some says if i use standard html input use esc to text box so javascript injection will strop.
can you kindly tell me best way to implement form inputs with security (simplest way is good)
thank you.
Use any way you like. The validation of the fields will be done in the backend. So no need to worry about injection. Codeigniter will escape your input values when using validation and query builder.
The esc($string) can be used in both cases. And with form_input() and with html
@@AlexLancer Thank you. I have more problem to come. will get another one hour training soon. thank you
@@JeewakaKarunaratne sure. whatever you need. You already know how it works :)
its very hard to find tutotial about CI4 .... and thx god dat u r exist!
i wanna ask u question. how to get a total row in a table? if in mysql select count(*) from table_name where gender='male';
how do i get a total result of 'male' ????
thx
Hey, thanks for yuor good words.
Try using query builder.
$db = db_connect();
$builder = $db->table('table_name');
$result = $builder->where(['gender' => 'male'])->countAllResults();
@@AlexLancer i try and its not working.
i used a query in a controller
$model = new UserModel();
$data['xdata'] = $model->where('gender', 'Female');
$data['xdata'] = $model->findAll();
i use that and i find all data that gender are Female. how to get count on that? i used countAll() still showing the error.
thx before
hey Alex, whenever you create any project you change the directory path from httpd.conf file. can't we skip public from url using htaccess redirect ????
Hey Sonal,
"public folder is meant to be the “web root” of your site, and your web server would be configured to point to it." - from codeigniter docs.
So to answer your question, in theory you could, but it is more convenient to configure your server to point into public folder.
Dear Alex,
can you upload full project to github or any other place you prefer? thank you.
Jeewaka check the description
@@AlexLancer thank you so much Alex
Better voice, thank you!
thanks for the video my friend.
its the same to make in AWS?
How about forgot password?
It would be good if in the future you can make a small CMS using version 4. Nice video, nice job.
Does old() do the same as set_value()?
kind off. I have never used it before. from what I see though in the documentation you must use "redirect()->back()->withInput() " to be able to use old() helper. Would it work without redirect ?
I think the idea here is that lets say you have a form under home/index but you want to validate post form under home/validation so when you need to go back to the home/index (ex. if no validation) and still keep the inputs you would use this method. just brainstorming. tell me if you find other use-case.
Sometimes if my users log in, another person's details will be displayed to them but go off after they refresh, please how can I solve this... I used your script.
please help
vera level thala neenga
My friend, I don't get what you try to say.
That is my mother tongue Tamil,that means Ur awesome and U doing a fantastic job.
@@alexpandiyan3632 google translate recognized it. But the translation was not very helpful. Thank you a lot!
Actually that is local word
Hi Alex I have one doubt,
how to link with another page in codeignetor 4(how to use Anchor tag)
Good job, excelent video
Help us with password resetting with email sending
Afo, this series is complete there will be no other video on this subject. But soon I will publish new series with user roles
have you make a csrf CI4 tutorial? i need it :D
Great work, keep doing bro ...
Thanks man!
Surprised you are using xampp instead of the built in development server. Good video.
Will use spark also later
Check this on live server, isn't working
What is the problem exactly?
@@AlexLancer I built the project on localhost and it works perfectly but on launching it to live server it gave me nightmares for 1 day but I have solved the problem
@@afobata5079 That's why I ask. What was the problem? Because you say that this tutorial does not work on live server. So describe please what was the issue to avoid misleading others or to let know what to be aware of. Maybe it is something that I should consider in my next tuts. Thank you in advance.
@@AlexLancer Is now perfectly working
Thanks a lot
thank you! very much!
You're welcome!
@@AlexLancer i cannot see the debug bar in the bottom, i use macosx catalina with VScode (or Netbeans) and the apache server of mac. The browser is firefox, do you have an idea why i cannot see it?
@@FilippoBerardo 2 things. When you start your project duplicate env file and name it .env
Then uncomment CI_ENVIRONMENT and set it to 'development' .
Also uncomment and set base url inside your .env file
And you should be fine.
Excellent bro! I have subscribed to you. How to manage user roles? Please make a video. I want admin and seller roles on the different dashboards.
Thanks for this .....
thank you sir
Most welcome, Mukmim.
thanks
Good
nice bro
Thanks
wow