@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?
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..
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?
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 :-)
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!
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.
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
@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`)
@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.
@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. =)
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!
eoinpahern 1 day ago
hi! i was just womdering why the POST method is redirected to itself!
eoinpahern 1 day ago
Comment removed
143Alizon 3 weeks ago
Comment removed
143Alizon 3 weeks ago
@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?
143Alizon 1 month ago
Comment removed
143Alizon 1 month ago
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!
fresh80able 2 months ago
Thank you very much, really helpful! 5 stars bro!
Wassouf10 2 months ago
nice tutorial and think you
TheLMKG 3 months ago
Love your tutorials but for password storage please stop using md5 or sha hashes
Grumbkow 3 months ago
@Grumbkow why?
KayferProductions 3 months ago
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..
darknote13 4 months ago
Duuuude you are on CRACK! speed-programming eh?
anyway great tutorial! x)
dreamvoidTV 4 months ago
Do i have to put it in xampp?
MrBOBMAN567 5 months ago
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 :)
RabbitFactoryUK 5 months ago
This doesn't validate with W3C :(
blowtar 11 months ago
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.
hAWKgas 1 year ago
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 :-)
michaeltrich 1 year ago
Comment removed
alme1304 1 year ago
This has been flagged as spam show
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 1 year ago
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 1 year ago
@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.
phpclass 1 year ago
Thanks Very good tutorial keep on the good job!!!
karasyiannis 1 year ago
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 1 year ago
@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.
phpclass 1 year ago
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
karasyiannis 1 year ago
could you upload the SQL database so i can import it!!! i can't figure out what is going wrong
karasyiannis 1 year ago
@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 ;
phpclass 1 year ago
@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 1 year ago
@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 1 year ago
@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. =)
phpclass 1 year ago
nice, make more PHP tutorials....like how to design or im searching now how to put an object in php that following your mouse
pekmezisir 1 year ago