Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Professional CodeIgniter ISBN: 978-0-470-28245-8
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old July 16th, 2009, 10:56 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by blackhorse66 View Post
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!
Reply With Quote
  #12 (permalink)  
Old July 17th, 2009, 10:44 AM
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

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.
Reply With Quote
  #13 (permalink)  
Old July 17th, 2009, 03:20 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by blackhorse66 View 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.
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.
Reply With Quote
  #14 (permalink)  
Old July 17th, 2009, 04:13 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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...
Reply With Quote
  #15 (permalink)  
Old July 17th, 2009, 08:52 PM
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

Session Support enabled

In your php.ini is session support disabled?
Reply With Quote
  #16 (permalink)  
Old July 17th, 2009, 10:16 PM
Authorized User
Points: 133, Level: 2
Points: 133, Level: 2 Points: 133, Level: 2 Points: 133, Level: 2
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2009
Posts: 26
Thanks: 0
Thanked 1 Time in 1 Post
Default

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. :)
Reply With Quote
  #17 (permalink)  
Old July 19th, 2009, 08:23 PM
Registered User
 
Join Date: Jul 2009
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by blackhorse66 View 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. :)
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 !
Reply With Quote
  #18 (permalink)  
Old August 12th, 2009, 05:30 AM
Registered User
 
Join Date: Jan 2004
Location: Tawau, Sbh, Malaysia.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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..
Reply With Quote
  #19 (permalink)  
Old August 13th, 2009, 05:04 AM
Registered User
 
Join Date: Jan 2004
Location: Tawau, Sbh, Malaysia.
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by shiroamada View Post
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?


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');
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dashboard Example with different users mruschetti BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 7 February 9th, 2008 05:18 PM
Dashboard example mruschetti BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 1 January 5th, 2008 02:41 PM
Login logic problem Gizmo_Gadgethead BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 September 1st, 2006 06:32 PM
Dashboard reporting tool luxx Excel VBA 0 January 2nd, 2004 12:26 PM
Mixing Data access logic and business logic polrtex BOOK: Professional Jakarta Struts 0 December 15th, 2003 07:19 PM



All times are GMT -4. The time now is 07:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.