CodeIgniter is an open-source PHP web development framework created by EllisLab Inc. The framework implements the Model-View-Controller design pattern. It is praised for its performance and the quality of its documentation.
1
vote
0answers
47 views
Implementing internationalization functionality for online English lessons
My website purpose is to sell online English lessons to people in Europe. It is crucial that my site is multilingual.
Overview
I am using HMVC modules to organize my site and my website has four ...
1
vote
1answer
43 views
A localization helper in codeigniter
I created a project to better understand CI3, while developing it I tried to introduce localization elements.
When I tried to localize the view everything messed up. I made a helper to identify if the ...
1
vote
1answer
158 views
Volunteer Signup Page
In a previous code review, it was strongly suggested that I start using PHP Frameworks to improve security for my websites. I tried Laravel and got stuck due to the steep learning curve. Then I tried ...
1
vote
1answer
69 views
CSRF-prevention mechanism for a form
I am using codeigniter framework in PHP. In signup form I have:
Controller:
...
1
vote
1answer
48 views
Validation of uploading images and adding records to the database
I am doing a php project with the codeigniter framework. In my controller, I have a function that does the following.
Uploads an image to the server
Add a row to the database. The data would be ...
3
votes
2answers
688 views
Web dashboard using many REST API requests
I have created REST API in codeigniter. REST sever created in codeigniter 3.0 and REST client created codeigniter 2.x.x.
I have wrote simple code for login. After login client created dashboard page....
2
votes
2answers
98 views
PHP+JS Code Combining
Just wondering if this is okay to do? I have to store some PHP variable values into LocalStorage.
...
5
votes
2answers
8k views
Login system with session using CodeIgniter
I implemented a login system, with session, using CodeIgniter.
If the session doesn't exist, redirect to login page.
Please review, and let me know what can be done to make it better.
view (login.php)...
1
vote
1answer
177 views
Codeigniter calling conditional data retrieval model method from controller
I am wondering if there's a better way to structure my code. I want to keep my controllers thin but at the same time want to keep the model methods flexible. As you can see below, it's almost as if I ...
7
votes
4answers
923 views
Checking 160,000 records in a database for changes
I am checking over 160,000 records in my database every 24 hours to see if there were changes in the incoming data coming from API and my existing data in the database. If there were I am updating ...
3
votes
2answers
63 views
Notification cron
I've built an appointment manager and would like to notify clients 2 hours ahead of time by via email of their scheduled appointment time. I am storing their scheduled time in a MySQL Datetime field.
...
1
vote
1answer
1k views
User model with user roles in Codeigniter PHP/MySQL
I am building an app that currently allows the users to have 3 different roles:
Consumer
Merchant
Admin
I have three tables:
user (Name, email, password etc with a status=0/1)
user_role (The list ...
1
vote
0answers
135 views
Add user and image upload script
This is my Codeigniter Controller and Model for user image and data upload.
I have some questions here:
Is this good way of writing this script?
Can this code be put to production if its need is ...
1
vote
0answers
656 views
Codeigniter form flow for model and controller
I'm working with Codeigniter most of the time (about one and a half year now) and I came across many form validation code flows. Here are my best two selected shots which I created for a client ...
1
vote
0answers
152 views
Login authentication model
I have made my model global so that I can work only a model with several controllers. Is it good or bad practice? And according to this, is my login process secure?
Login check function in Controller:...
1
vote
0answers
516 views
Handling user permissions in Code Igniter
I haven't done much work with Code Igniter, and can't seem to get much of a definitive answer poking around as to what the best solution to this problem is. Before moving forward, I wanted to see if ...
2
votes
2answers
100 views
Identifying a development and production server by http_host
I am using below code to recognize which set up I need to use in Codeigniter:
...
3
votes
0answers
166 views
Building the HTML body view
I created a library class in CodeIgniter that handles building the HTML body view.
This class builds the body, adds content and adds javascript element tags at the end. The body is built by using a ...
1
vote
0answers
820 views
5
votes
1answer
664 views
PHP login script security check
I made an admin login script for my own CMS website that I'm making in Code Igniter 2.2.1 and I'd like to know what are the potential threats or some holes that I might have left open.
This is how it ...
2
votes
0answers
749 views
Upload multiple files in different formats and sizes from one HTML form
I have a html form with some text input fields and three file upload fields. two of them should be images and one should be a file (pdf). My code is working well but I feel this is not the proper OO ...
1
vote
1answer
92 views
Light, custom CMS for a site
I'm working on a light, custom CMS for my site and I am trying to use Ajax calls for most of the server-side interaction. I am still pretty new to web development, so if I am breaking any conventions ...
1
vote
1answer
488 views
Codeigniter ActiveRecord Wrapper Model
Can someone help me refactor this to be more optimized? Performance seems to be very optimal, but I think more can be squeezed from it.
...
6
votes
2answers
662 views
CodeIgniter Model I built
Can I get some pointers, critiques and/or comments on the following model? (p.s. performance seems great... tested all methods up to 10,000 records)
...
1
vote
1answer
106 views
Using one parent model and other extending it in a PHP framework
I have multiple models which all have the same functions in my framework. I decided to create one "parent" model and all of my other models would extend and inherit its functions like this.
My other ...
2
votes
1answer
2k views
CodeIgniter maintain data through Controllers
I have a main menu in my application. It loads depending on the role of the user that I validate from a table in my data base, but I have to recreate this menu every time I call a new controller.
...
3
votes
1answer
154 views
Best practice for generating jQuery dynamical content
I am new user of CodeIgniter and I am trying to build an application that there are lots of jQuery dynamical content.
Below I provide a code that I am using in order to be precise. The code below is ...
5
votes
1answer
2k views
Codeigniter Login Controller
Instead of creating an Admin_Controller or MY_Controller I was going to try and just try out all my controllers on requirements that are needed per controller. I know this may seem like additional ...
1
vote
1answer
2k views
Passing an object to the view in CodeIgniter
I'm trying to use an object and persist it into the data base.
I created a class in the library's folder.
...
1
vote
3answers
878 views
Checkbox Group Function and Usage
In CodeIgniter, I have created function (helper) to populate, store and retrieve checkbox group. I just wonder if I have written code is in proper way and optimized or needs some more finishing?
...
1
vote
0answers
301 views
2
votes
1answer
3k views
Codeigniter view within a view
I'm calling a view into a view. Am I doing correctly, or is this a bad practice?
...
4
votes
1answer
250 views
jQuery click handlers
I'm working with Codeigniter and I have a jQuery file to add some functionalities. But I think I'm doing it in a wrong way.
...
0
votes
2answers
948 views
Codeigniter - in the view or in the controller?
Is this correct? Or am I overloading the responsibilities of the view?
...
3
votes
2answers
4k views
Loading content in page via jQuery
I'm doing a website in CodeIgniter and I'm loading the content page via jQuery, but I don't know if this is a good practice or not. Could I improve it?
jQuery:
...
1
vote
1answer
5k views
Codeigniter Registration Controller
Just wanted to post my registration controller and see what anybody thought about it.
...
1
vote
1answer
476 views
An account activation class
I'm rewriting a god object with long methods into something much more viewable and pretty.
However, I think there is something missing and can be done better. I'm sending examples of one controller ...
2
votes
1answer
2k views
Builder pattern for Codeigniter ActiveRecord queries
I am using Codeigniter and it's ActiveRecord.
I had this idea for a base class that provided a generic getter/setter for doing simple queries on a database. I have a lot of database objects that ...
3
votes
2answers
241 views
Helping to Make My Controller Function DRY
I have the following controller function. What I want to do is make this function do less. Most of this code is just random checks on various things that is also done on most of my other controllers. ...
-1
votes
1answer
419 views
Counting failed login attempts to enforce temporary lockout
I'm reviewing my code and trying to figure out how I can do some simplifying to flatten my code. Whether it be making simpler function out of the segment of code or by removing parts of it and wanted ...
0
votes
1answer
254 views
CodeIgniter model
I'm working on my first large CodeIgniter project (and one of my first MVC projects), and I want to get some feedback on the techniques I've used so far in one of my models:
...
0
votes
1answer
3k views
A good example of codeigniter MVC?
What is the difference between this two way and Which one is best? What do you suggest?
1.
Use of query (db) directly in CI_Controller. as:
...
0
votes
2answers
255 views
Submit function For Login
Trying to see if anyone sees any potential flaws with this submit function. One concern is this line:
...
3
votes
1answer
755 views
Implementing pagination with three modules
I am utilizing CodeIgniter's Pagination class to implement pagination in the project.
In this project, there are 3 modules: Event, Business and Parts. Each Module has the same "view" for pagination. ...
4
votes
2answers
744 views
Am I using MVC Codeigniter correctly?
I'm currently writing Report's system. I have about 20 different users with different access.
Am I doing it correctly? Can I improve my style of writing this code? All my reports based on the same ...
1
vote
1answer
86 views
Getting personal messages function
I'm trying to develop a better function and curious what others would suggest I do to it so that its not so robust and still accomplish what I need.
A couple of things I need to account for is when I ...
2
votes
1answer
2k views
CodeIgniter nav/menu insecurities
I more or less asked the same questions on stackoverflow.com, but maybe this is more for this forum. I have a hard time getting to grips with how to implement a top navigation (common for the whole ...
3
votes
1answer
2k views
Codeigniter active record
I understand that I should use prepared statements to prevent SQL injection. Unfortunately, having read the PHP docs on the matter I am none the wiser. Here is one of my simple active record SQL ...
2
votes
1answer
66 views
Is having preset queries prone for disaster?
Edit Just did some further reading around the website and have come to the conclusion that this method leads to Leaky Abstraction, sorry for wasting peoples time. Time to head back to the drawing ...
1
vote
1answer
84 views
Is this a sensible form iteration pattern for a web form with an unknown number of fields?
I'm designing a small intranet-based time-tracking web app that accepts an unknown number of data "rows" which each consist of 7 form fields. Rows can by dynamically added by the browser.
Can I do ...