| |||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | #1 (permalink) |
| NamePros Regular | problem with PHP Login script hey all, I'm having a pretty big problem with a login script that I can't figure out. The login page is here: www.areacodebook.com/login.php Here's the issue: You you try to login to a personal account (first name & last name), the script works perfectly. If it is a valid login, where the names & passwords match up, the person logs in and goes to the control panel just fine. If it is invalid, the person is not able to get in. Here's where it gets strange. If you try to login to a business account, if it is a valid login, then you are logged in just fine - BUT for some reason, you are directed to the personal control panel. (Actually, the business & personal control panel are on the same php script - I'm just using a lot of if/else statements to figure out what type of account the person is using). If it is an INvalid login, the first time it fails. But if you try to login again with the same invalid login info, my script thinks that it is a valid login (and takes you to the personal control panel section of the script). Of course, b/c it's an invalid login AND because it's taking you to the wrong section, when you try to login as a business, one of the tests that I'm running to try to narrow this down - outputting the User ID number - the ID is blank. If this is confusing, maybe the following code will help you. I have copied the code for login.php as well as control.php. Any help would be appreciated. Thanks, David login.php: PHP Code: PHP Code: David
__________________ Smooth Stone Services Affordable Web Hosting Solutions Starting at only $4.95/month, IT Consulting and Technical Support Hunt Sources - Hunting Resources Online Last edited by Rudy; 05-18-2006 at 07:13 AM. |
| |
| | #2 (permalink) |
| NPQ's PA, Slave, and On Call Coder Technical Services | This _may_ work, if not... I blame it on my lack of sleep. May take another look later: login.php PHP Code: PHP Code:
__________________ |
| |
| | #3 (permalink) |
| NamePros Regular | I'm not sure what you did... don't tell me so I can study the code and look at it myself. Thanks so much for the help. It looks like everything is working perfectly now. I really appreciate it. I'll also look into the validating user input. I'm not too familiar with how to do that, so I'll see if I can read up on anything like it on the net and in a couple books I have. - David
__________________ Smooth Stone Services Affordable Web Hosting Solutions Starting at only $4.95/month, IT Consulting and Technical Support Hunt Sources - Hunting Resources Online |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |