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
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.

Link to comment
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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.