thank you very much. i was able to do this successfully. i am a newbie and wannabee programmer. i recommend this to those who are starting to try php and mysql/mysqli. this is build using the current php7 functions.
I think for those people who are basic learner this is the easiest way and personally I like the approach for first time learning. Because he showed in the most easiest way. Best of Luck! Waiting to see more videos from you too!!
i have an error, Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocsdecoyloginserv.php on line 19….. how to fix this?
Hi As per u are video demo i did but iam unable to login page that if i use correct password its giveing username and password invalid can u give solution
dear sir i have a create a problem. that login page . my database name and table name defint but login page show EORRE messages. Username of Password is Invalid. pl. reply soon. pl. check my code
<?php $error=''; //Variable to Store error message; if(isset($_POST['submit'])){ if(empty($_POST['username']) || empty($_POST['password'])){ $error = "Username or Password is Invalid"; } else { //Define $username and $password $user=$_POST['username']; $pass=$_POST['password']; //Establishing Connection with server by passing server_name, user_id and pass as a patameter $conn = mysqli_connect("localhost", "luckyprajapat", ""); //Selecting Database $db = mysqli_select_db($conn, "jaishree"); //sql query to fetch information of registerd user and finds user match. $query = mysqli_query($conn, "SELECT * FROM lokesh WHERE password='$password' AND username='$username'");
$rows = mysqli_num_rows($query); if($rows == 1){ header("Location: shree.php"); // Redirecting to other page } else { $error = "Username of Password is Invalid"; } mysqli_close($conn); // Closing connection } }
thx lot, it work, but it would be nice to have one, wher the user can register himself online, as in a normal Forum Page, can you make a tutorial, or do you did one?
Good day, Everything is done yet, nothing happens, is it really like this? $conn = mysqli_connect("localhost", "root", ""); is my servername correct? or my root? and the blank quotation? it just accepts the input and refreshes the page
Thanks, i finally succeed with my first login form. I really appreciate. But how do i restrict users from hitting direct at /welcome.php becuase this aslo gives the user access to the page.
The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
i have an error, Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocsdecoyloginserv.php on line 19….. how to fix this?
if we have multiple username and password how can we check. here u just stored a single username and password and in query just assigned if (row ==1)..tell me if i have multiple data how i should modify this
Hi, When i type the wrong username or password it say Invalid Username or Password, which is expected. However, I type the correct username and password, it doesn't redirect to welcome.php and refreshes to the same login page instead. What could i have missed?
43 responses to “How to Create A Simple Login Form in PHP & MySQLi Tutorial”
He freezes on a white page when i press submit… what that mean?
This show errror
When i tryna login (username = user , password = pass) i get this error
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /opt/lampp/htdocs/user/loginserv.php on line 19
thank you very much. i was able to do this successfully. i am a newbie and wannabee programmer. i recommend this to those who are starting to try php and mysql/mysqli. this is build using the current php7 functions.
thank you!
He freezes on a white page when i press submit… what that mean?
I think for those people who are basic learner this is the easiest way and personally I like the approach for first time learning. Because he showed in the most easiest way. Best of Luck! Waiting to see more videos from you too!!
man you're awesome!
helped me a lot. thank you.
Thanq sir…
Can you help me i have email and password not user and pass what i need to change
Thank you very, I run my the program successfully! Great job!
i have an error,
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocsdecoyloginserv.php on line 19….. how to fix this?
This is trash!!! Waste of time!!!!
it was very useful thanks
Hi As per u are video demo i did but iam unable to login page that if i use correct password its giveing username and password invalid can u give solution
Is it tutorial video or any music video
dear sir i have a create a problem.
that login page
.
my database name and table name defint but login page show EORRE messages.
Username of Password is Invalid.
pl. reply soon.
pl. check my code
<?php
$error=''; //Variable to Store error message;
if(isset($_POST['submit'])){
if(empty($_POST['username']) || empty($_POST['password'])){
$error = "Username or Password is Invalid";
}
else
{
//Define $username and $password
$user=$_POST['username'];
$pass=$_POST['password'];
//Establishing Connection with server by passing server_name, user_id and pass as a patameter
$conn = mysqli_connect("localhost", "luckyprajapat", "");
//Selecting Database
$db = mysqli_select_db($conn, "jaishree");
//sql query to fetch information of registerd user and finds user match.
$query = mysqli_query($conn, "SELECT * FROM lokesh WHERE password='$password' AND username='$username'");
$rows = mysqli_num_rows($query);
if($rows == 1){
header("Location: shree.php"); // Redirecting to other page
}
else
{
$error = "Username of Password is Invalid";
}
mysqli_close($conn); // Closing connection
}
}
?>
my sql filed
ID
username
password
email
my sql con.
database name jaishree
table name lokesh
if i insert a data in the table mysqli_num_rows() function not working what iam do sir,is there any alternative for this functon
thx lot, it work, but it would be nice to have one, wher the user can register himself online, as in a normal Forum Page, can you make a tutorial, or do you did one?
Thank you!
Great help (Y)
Good day,
Everything is done yet, nothing happens,
is it really like this?
$conn = mysqli_connect("localhost", "root", "");
is my servername correct? or my root? and the blank quotation?
it just accepts the input and refreshes the page
Thanks, i finally succeed with my first login form. I really appreciate. But how do i restrict users from hitting direct at /welcome.php becuase this aslo gives the user access to the page.
I'm loggin with username and pass but i want affich in page welcome.php the first and the last name !
Thank you very very much!
Me sale este error :
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator to inform of the time the error occurred and of anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
alguien sabe que significa
i have an error,
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocsdecoyloginserv.php on line 19….. how to fix this?
hello, i get the code back after running it
Receiving the following error for the loginserv.php, line 19:
Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in
Could you please help?
Thank to this tutorial! You describe every line of the code ^__^
if we have multiple username and password
how can we check. here u just stored a single username and password and in query just assigned if (row ==1)..tell me if i have multiple data how i should modify this
where did he save the php file?
thanks bro keep it up
This is not secure you need to hash the passwords do not use md5 use one of following
Argon2 (requires PHP extension)
Scrypt (requires PHP extension)
Bcrypt
one thing to remember is that all have pros and cons
Thanks
great work
Thanks, your video was exactly what I needed!
perfect
very helpfull video sir. Thanks a lot !!
Hi,
When i type the wrong username or password it say Invalid Username or Password, which is expected. However, I type the correct username and password, it doesn't redirect to welcome.php and refreshes to the same login page instead. What could i have missed?
thanks my friend
hi!
when I try to log me with a user I created, gives this error:
"Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:xampphtdocsRT_SITEloginserv.php on line 19"
Any idea? thank you
I created login page using ur tutorial but i couldnt login with correct values though ,, plz ,any one can help