Jump to content

lot of errors during admin login page.


mikk809h

Recommended Posts

Hello.

 

im new to the forum, and i started this topic because im having a lot of trouble with my admin-login system..

 

what the finale code should do:

 

when i enter correct information, prints SUCCES (without errors xD)

or else print FAILURE!

 

but when i logged in with correct information i got following errors:

 

 

Succes!Succes!
PHP Error Message

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/a1043884/public_html/admin/class.login.php on line 97

Free Web Hosting
Query Fail!
PHP Error Message

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/a1043884/public_html/admin/class.login.php on line 105

Free Web Hosting

PHP Error Message

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a1043884/public_html/admin/class.login.php on line 113

Free Web Hosting
Errors

Invalid Username/Password

 

the code would be posted on pastebin.

 

 

But please help me!

 

Thanks in Advance

 

-mikk809h

Link to comment
https://forums.phpfreaks.com/topic/274646-lot-of-errors-during-admin-login-page/
Share on other sites

1. "Login" isn't really an object it's a procedure and shouldn't be made into a class.

Creating a User class and creating login method(s) for that class would be a better OOP solution.

 

2. In the call to mysql_query() you are using variable $connection when in fact variable $conn is what holds your mysql link.

1. "Login" isn't really an object it's a procedure and shouldn't be made into a class.

Creating a User class and creating login method(s) for that class would be a better OOP solution.

 

2. In the call to mysql_query() you are using variable $connection when in fact variable $conn is what holds your mysql link.

Not to be crude, but there are so many things wrong with this code that I cannot take the time at the moment to look through it all line by line.

There is only one method that modifies the _errors property, i suggest looking there first and implementing proper error checking logic into your code during development.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.