Timeline for Login and registration pages for a PHP and PDO e-commerce project
Current License: CC BY-SA 3.0
11 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 4, 2016 at 11:59 | comment | added | podliy16 | no. as I said if you want only secure login and registration from framework -- use library for this. Frameworks are for something bigger, and there's not so much sense to use only a part from framework. Furthermore not always framework allow it, so you can have problem with it. | |
Oct 4, 2016 at 11:47 | comment | added | learning progrmming |
okay than you are telling we can use codeignitor for login , register & plain php code for creating products, orders , categories , is this okay that we are using different concepts in single project ?
|
|
Oct 4, 2016 at 11:43 | comment | added | podliy16 | @learningprogrmming of course you can, you can write your plain business models for example. Or any other module, where it makes sense. But if you want to use framework only for secure login/signup -- better use a library for login/signup. | |
Oct 4, 2016 at 11:34 | comment | added | learning progrmming |
@podliy16 we are doing live - e-commerce project, if we use say codeignitor to achieve login/signup module, for uploading products , orders can we use plain php code or we must use codeignitor framework only ? as both login/sign up customers are related to products & categories ?
|
|
Oct 4, 2016 at 10:29 | comment | added | podliy16 | @learningprogrmming depends on your goal. If this's simple test for job applying, or something like this -- no. But if you're gonna to use this in production, in really application which you will support -- yes, you should use framework, or at least libraries for specific goals, like DB connect, View rendering, maybe ORM,etc It's a topic for holy war, but in my opinion you should write in pure PHP, only when you're a ninja of php, when you can do on your own AT LEAST so good as framework developers. Or when you're a newbie and trying to learn php better, but not in the real app in this case | |
Oct 4, 2016 at 10:18 | comment | added | topher | @podliy16 you should add this as an answer. | |
Oct 4, 2016 at 10:18 | comment | added | podliy16 | Also I think you should wrap your database connection in singleton pattern. It'll prevent you from creating multiple connection in one request. Singleton quite easy to implement and database connection the best candidate for this pattern. About security -- many depends on your DemoLib class, how exactly you're doing SQL queries, which sanitize you're using. At this moment I see possible CSRF attack, because you're not using any token protection on auth. You can check owasp.org/index.php/Top_10_2013-Top_10 every point from Owasp top 10, usually it's enough. | |
Oct 4, 2016 at 10:18 | comment | added | learning progrmming |
do you suggest to use any frameworks for this instead of plain php code ?
|
|
Oct 4, 2016 at 10:12 | comment | added | podliy16 |
About code quality -- you messed up your representation layer and logic. You should try to implement some View system or take anyone already implemented. For example your account.php should be like: you're getting all needed data, then do something like $view = new View('account.php.html', ['name' => $user->name]); and that's all. You shouldn't have HTML markup and PHP logic in 1 file. Also, with this point you should use some layout, which contain basic HTML for all pages. For example you want to add new css style to your application. You need to change all files now, and this is very bad
|
|
Oct 4, 2016 at 9:09 | comment | added | learning progrmming |
Thanks for your review, i will try that, what you say about code quality, security, performance ?
|
|
Oct 4, 2016 at 8:57 | history | answered | podliy16 | CC BY-SA 3.0 |