Added: 2 years ago
From: phpclass
Views: 24,517
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (37)

Sign In or Sign Up now to post a comment!
  • im trying to post data to my php class from my html page but when i call isset() on the post it returns false! damn it!

  • hi! i was just womdering why the POST method is redirected to itself!

  • Comment removed

  • Comment removed

  • @phpclass I am a beginner in php and I wanted to learn the codes that you used in your login tutorial, do you also have tutorials about those codes that you have put into your login tutorial?

  • Comment removed

  • Great Tutorial!

    What about cookies? Most PHP login systems use cookies or PHPSESSIONIDs that are added to URLs.

    How do you handle the logout functionality? Would it be enough to unset the Session vars for ID,username and password?

    Thanks a lot!

  • Thank you very much, really helpful! 5 stars bro!

  • nice tutorial and think you

  • Love your tutorials but for password storage please stop using md5 or sha hashes

  • @Grumbkow why?

  • nice job... n thnx a lot

    hey ..sir.. would u like to upload a tutorial abt comment box n search engine..i found a lot of video here abt that .. but ur video n code r nice n clear..

    thank u..

  • Duuuude you are on CRACK! speed-programming eh?

    anyway great tutorial! x)

  • Do i have to put it in xampp?

  • Hi, I get the following error and I can't for the life of me figure out what the issue is:

    Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given

    Obviously there is a problem with the query as it is return false, If I echo out the query and copy it in to PHPMyAdmin SQL it returns the one row so there isn't a problem in building the query, and I have no issues connecting to the database. Do you have any suggestions as to what my problem might be?

    Oh and great tut :)

  • This doesn't validate with W3C :(

  • Hi the tutorial is just great! I use both the register and login system. I want to ask how I can fetch data into members page like the user's username so it looks like something like 'Welcome, [username]!'. I've tried with "$data = SELECT * FROM users" and then adding $data['username'] also with other methods with mysql_fetch_assoc but without succes. Just nothing show - empty fields. I'm completely new in PHP. At the moment I am learning just C++ at shool. I'll be glad if you can help me.

  • Good tutorial, but a bit confusing. You called methods functions, the business logic is mixed in with the action controllers. and it would be much better to put the password validation etc in a separate class to cut down on repeating data. You'd probably wanna throw exceptions instead of making your own home brew error messages too :-)

  • Comment removed

  • Hi, let's say I do not want to restrict users to use letters/numbers only passwords (which I find really annoying as a user myself)... I wonder if replacing the preg_replace with mysql_real_escape_string would introduce any security flow in the login system?

    And thank you very much for this instructive video! The way you write the code looks really professional - keep going!

  • @zholud Yes you can use the mysql_real_escape_string function to escape special characters and it won't cause a direct security hole as far as I know. However, there are some limitations. If your allowing special characters you have to use addslashes() to escape the '%' if your doing a wildcard sql query. Second, mysql escape function is not 100% safe and there could be a breach in your statement.

  • Thanks Very good tutorial keep on the good job!!!

  • when i register a username and password with the registration tutorial files the login will not find them and says invalid username/password. any solution??

  • @karasyiannis There are only two things that could be causing the problem in your class.login.php file:

    1. Incorrect table name. Remember my table name is called 'users'. Make sure you apply the correct name in the sql statement in the verifyDatabase() function.

    2. Mismatched or Invalid table field names. Inside verifyDatabase() I asked for the ID field value from my users table. If you named your id field USERID then that could be a problem.

  • I have a database named users and a table named users where in the table I put ID,username,password. with the registration php i can insert users but when i try to log in its the problem. messase incorrect username/password

  • could you upload the SQL database so i can import it!!! i can't figure out what is going wrong

  • @karasyiannis Here is the sql code for creating the users table.

    CREATE TABLE IF NOT EXISTS `users` ( `ID` int(75) NOT NULL AUTO_INCREMENT, `username` varchar(45) NOT NULL, `password` varchar(50) NOT NULL, PRIMARY KEY (`ID`)

    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

  • @karasyiannis I think a possibility is that you set your password table field to a very low length. Since the password field is given an md5 encrypted value, it will be a very long value. You need to set the password varchar length to a large number so that the password value can fit.

  • @phpclass to be exact its 32 chars, that's how long md5's are. ;)

    btw excellent tutorial, currently using this in my school project, the teacher has no idea whats going on, so she have me 100% :)

  • @Cezarijus Hahaha yes it is. Since I didn't have the code in front of me to see the exact solution of his problem, I had the password field be 50 just in case. But thank you for pointing it out. =)

  • nice, make more PHP tutorials....like how to design or im searching now how to put an object in php that following your mouse

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more