 |
BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
 | This is the forum to discuss the Wrox book Professional CodeIgniter by Thomas Myer; ISBN: 9780470282458 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

July 16th, 2009, 10:56 PM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by blackhorse66
in the sample codes claudias, in the root, index.php.
Find error_reporting, change it to
error_reporting(E_ALL & ~E_NOTICE)
I think that will make the Notice message disappeared from the Claudias sample codes.
But for your own real life programming, programming for error_reporting(E_ALL) will be better practice.
|
Thanks for the reply but unfortunately that did not work for me. I still just get redirected back to my login page. There's a couple more adjustments to my code that I'm going to try but if anyone has any advice, please chime in. Thanks!
|
|

July 17th, 2009, 10:44 AM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
|
|
You are not using the original log in code, right? after you change the error reporting, use the original log in code, I think the error will go away.
|
|

July 17th, 2009, 03:20 PM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by blackhorse66
You are not using the original log in code, right? after you change the error reporting, use the original log in code, I think the error will go away.
|
Even with the original login code I just get redirected back to my login page. I do appreciate the response. I'm still trying to figure this out.
|
|

July 17th, 2009, 04:13 PM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Alright! I got it working by using the built in CI session library rather than native PHP $_SESSION. This thread over at the Codeigniter forums helped tremendously.
However another issue has come up. If I visit one of my admin pages directly, by typing in the URL, for example http://www.mydomain.com/admin/dashboard, it does not redirect to the login page but just shows the page as normal. Not too good for security and defeats the purpose of logging in. Any ideas on why this is happening? Do I need to alter my if statement in my Controller(s):
Code:
if ($this->session->userdata('userid') < 1) {
redirect('welcome/verify', 'refresh');
}
Any advice is appreciated. Thanks...
|
|

July 17th, 2009, 08:52 PM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Session Support enabled
In your php.ini is session support disabled?
|
|

July 17th, 2009, 10:16 PM
|
|
Authorized User
|
|
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
|
|
By the way, I think the CI's own session code will save the session value as a cookie. so in product web site, you cannot use CI's own session class for the password, or userid etc.
Maybe the author can give the authenticate answer. Everyone else here may be the "students" of the book, the expert may not come to this forum. :)
|
|

July 19th, 2009, 08:23 PM
|
|
Registered User
|
|
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by blackhorse66
By the way, I think the CI's own session code will save the session value as a cookie. so in product web site, you cannot use CI's own session class for the password, or userid etc.
Maybe the author can give the authenticate answer. Everyone else here may be the "students" of the book, the expert may not come to this forum. :)
|
Yeah I think CI session class will work for me for the site I'll be building based on the knowledge I've gained through the book. It will not be an ecommerce site so I only need authentication for the admin backend.
I'm hoping I can get the good word from Mr. Myer himself  !
|
|

August 12th, 2009, 05:30 AM
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
http://www.mydomain.com/welcome/verify
the first time I time wrong username and password, the notification didn't show out, anyone found this bug?
Last edited by shiroamada; August 13th, 2009 at 05:04 AM..
|
|

August 13th, 2009, 05:04 AM
|
|
Registered User
|
|
Join Date: Jan 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by shiroamada
|
I found out how to resolve this problem, after set the flashdata, it must be refresh. Else the second time u type it wrong then it will displayed
$this->session->set_flashdata('error', 'Sorry, your username or password is incorrect!');
redirect('welcome/admin', 'refresh');
|
|
 |