Follow me on Twitter @ http://twitter.com/tktutorials
Check out my website @ http://www.timkipptutorials.com
In this tutorial we will be building a very simple login form using PHP and MySQL. Please note that this is very basic and I am not applying and security features to this tutorial. I will be covering a more advanced login system in future tutorials.
Source code is located on my website under the “Code Bank” section.
Amazon Auto Links: No products found.
Very Easy,Very Fast,Very Effective,…..Like,Subcribe !
Thank You Very Much !! 😀
please help me to correct this error
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in E:xampphtdocsproject 1login.php on line 16
inValid information…
I had to practically scour the universe to find this gem. I learned a bunch of pointless stuff on the way, thanks so much for this tutorial.
very good teacher can make video php login to admin
Really great tutorial ,clear cut and to the point . Great Job !
It would just reload the page each time i press Submit, any help?
Excellent Tut man! I was stuck with the connection to my DB but this has cleared it up! Keep the vids coming 😀
name of the text editor ?
Great! I’ve been pulling my hair out trying to find the most basic connection possible with least amount of files etc. almost had to go to second page! 🙂
really useful and clear! you saved my ass, cheers mate!!!
Nice
Somebody help me? Wouldn’t let me post my code here so I made a link: http://www.tomshardware.com/answers/id-2830409/connect-html-php-mysql-server.html#16793872
Hi,could you please let me know what is wrong here . When checking it results with this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/rvreau50/public_html/login.php on line 14
Line 14 is this one: if (mysql_num_rows($res) == 1) {
Thank you !
couldn’t have been any better tutorial for a beginner 🙂 thanks a ton , got the perfect video after so many wasted videos .
cant run?
why?
help pls! thanks you. 🙁
< ?php $host = "localhost"; $user ="root"; $pass = ""; $db = "login"; mysql_connect($host, $user, $pass); mysql_select_db($db); if (isset($_POST['username'])) { $username = $_POST['username']; $password = $_POST['password']; $sql = "SELECT * FROM users WHERE username='".$username."' AND passsword='".$password."' LIMIT 1"; $res = mysql_query($sql); if (mysql_num_rows($res) == 1) { echo "you have successfully logged in."; exit(); } else { echo "Invalid login Information. please returnto the previous page."; exit(); } } ?>
PHP & MySQL with MVC Frameworks – Self-Paced
https://twitter.com/WikiOffer/status/820088361062801408
Nice tutorial, thanks.
nice video understandable………………………………
eh bro what does isset mean?
at last! good video tutorial about this topic. thank you very much sir!
thanks you so much, love you
Great job thanx for ur assist
If password and username are correct how i can go to next page
Hi Tim, Love your tutorial, but your official website is NOT user friendly. I can NOT find the “CODE BANK” section anywhere ?
Is this way secure tho?
Hello Sir! I want to create an account for one person by using php. Could you do and post it? Thanks a lot!
Hello! It’s definitely a great tutorial! But I encountered a problem , can anyone help me?
The code I wrote seems to be perfectly fine, but for some reason it wouldn’t connect to db. The issue is that even if I use correct username and password it gives me “Invalid login information. Please return to the previous page.”
In the values of $host, $user, $pass and $db I’m 100% sure. Thanks in advance 🙂
< ?php $host = "localhost"; $user = "root"; $pass = ""; $db = "the allmighty one"; mysql_connect($host, $user, $pass); mysql_select_db($db); if (isset($_POST['username'])) { $username = $_POST['username']; $passwrod = $_POST['password']; $sql = "SELECT * FROM users WHERE username='".$username."' AND password='". $password."' LIMIT 1"; $res = mysql_query($sql); if (mysql_num_rows($res) == 1) { echo "You ahve successfully logged in."; exit(); } else { echo "Invalid login information. Please return to the previous page."; exit(); } } ?>
[11-Oct-2015 04:08:41 Europe/Moscow] PHP Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /home/abumfluc/public_html/login/login.php on line 15
Wha? how do i fix that? what did i do wrong?
could you tell me how to do this with PDO please, I get stuck in this 🙁
Do you know how I can fix this error.. “The requested URL /Assignment 1/login.php was not found on this server.” When I typed in the username and password on the login form. Thanks in advance
Great tutorial but, it’s vulnerable tu a sqli?
Thank you for very informative video…
thank you so much..
ALLAH bless you !..
registration form video?
really helpful