I've successfully created an account (I can see it in my database), when I log in it just redirects me to the login page, the redirect function to the member.php does not happen. I can access the page if I type it in the address bar. Can you advise me on this issue?
1.Change every Mysql_ to MySqli_ 2.Add $con line as shown below $query=mysqli_query($con,"SELECT * FROM login WHERE username='".$user."' AND password='".$pass."'"); Thanks mate for code
Hello sir i'm getting this error plz solve it help me!! Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at C:xampphtdocsluckylogin.php:15) in C:xampphtdocsluckylogin.php on line 37
Best code so far but I'm having problems with the login.php not taking me to the member.php, the session(); code in the login.php is coming up as an error for me. Any ideas?
hi sooraj mohan, please help me to fix with my problems. I've used exactly the same source code and database like you did, but in browser when i entered the value and click login or register button, there is no any action happening . it only shows the form. Can you please tell me what's wrong
hi i saw ur video but it can not be work …it cant show any error …i will submit the login page means it cant print account sucessfully created…it cant show any error…wt can i do….
In login.php, there is an error. if($user == $dbusername && $pass == $dbpassword) {
$_SESSION['sess_user']=$user;
/* Redirect browser */ header("Location: member.php"); } Warning: Cannot modify header information – headers already sent by (output started at C:AppServwwwloginlogin.php:19) in C:AppServwwwloginlogin.php on line 45
Hi Sooraj Mohan thanks for great video. However im pretty new on php , and im bit confused how does the page (register.php) knows when to give different outputs when user enters or not enters details in fields.
For example user does not enters the username
I was looking at the code :
$sql="INSERT INTO login(username,password) VALUES('$user','$pass')"; // insert user name and password to database
Hello there and thanks for this great tutorial ! im getting these erros 1:Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:wampwwwregister.php 2:Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given
48 responses to “User Registration Form, Login, Logout – PHP Tutorial”
I've successfully created an account (I can see it in my database), when I log in it just redirects me to the login page, the redirect function to the member.php does not happen. I can access the page if I type it in the address bar. Can you advise me on this issue?
Thank u Sir…
Thanks brother. You are a life saver.
Totally helped out with my assignment. Many thanks
Thanks so much!
The video is meaningfull for our!!!
Thank you
Thanks, it was v. helpful…
Thank you very much!
thanks broooooooo!
Thanks Man
Thanks 🙂
thank you so much for this tutorial. this tutorial clear my all concept about it. thanks again.
it helped to me a lot !!!
im so thankful with you !!!! 😀 😀 😀
thnks a lot 🙂
How can encrypt my password before saving and to db and be able to login with the unencrypted password
Thanks! After many tutorial this worked for me.
1.Change every Mysql_ to MySqli_
2.Add $con line as shown below
$query=mysqli_query($con,"SELECT * FROM login WHERE username='".$user."' AND password='".$pass."'");
Thanks mate for code
Thank you
thanx buddy for codes !!!
such an easy to understand tutorial, thank you!
hi I am trying to login using username and password, but its not redirecting page where I want, can you please help me on this.
Thanks
Thank you very much
500 Internal Server Error?
Hello sir i'm getting this error plz solve it help me!!
Warning: session_start() [function.session-start]: Cannot send session cookie – headers already sent by (output started at C:xampphtdocsluckylogin.php:15) in C:xampphtdocsluckylogin.php on line 37
THANK YOUU!!!!!!
As simple as it is. Well done
I fixed the login form, but once i login it does not redirect me.
thank you very much! It's mean a lot for me 😀
Best code so far but I'm having problems with the login.php not taking me to the member.php, the session(); code in the login.php is coming up as an error for me. Any ideas?
first one that works 🙂 Great!
hi sooraj mohan, please help me to fix with my problems. I've used exactly the same source code and database like you did, but in browser when i entered the value and click login or register button, there is no any action happening . it only shows the form. Can you please tell me what's wrong
thanks 🙂
This code works fine…..thanks for your help
hi i saw ur video but it can not be work …it cant show any error …i will submit the login page means it cant print account sucessfully created…it cant show any error…wt can i do….
Thank you sir! You ended my 12 hour nightmare.
Thanks for tutorial. Its all right. but does not show the "username" in the member page after welcome word. please help me.
thanks man nice video it worked for me…thanks again
In login.php, there is an error.
if($user == $dbusername && $pass == $dbpassword)
{
$_SESSION['sess_user']=$user;
/* Redirect browser */
header("Location: member.php");
}
Warning: Cannot modify header information – headers already sent by (output started at C:AppServwwwloginlogin.php:19) in C:AppServwwwloginlogin.php on line 45
@sooraj mohan thank you so much ^^ you answered my prayer .. Thank you 🙂
I've successfully created an account (I can see it in my database), however when I log in it just redirects me to the login page again.
If I manually direct myself to the member.php page it works fine, however if I try to login it never redirects me.
I'm sure it's something simple and I'm just missing it.
Hi Sooraj Mohan thanks for great video.
However im pretty new on php , and im bit confused how does the page (register.php) knows when to give different outputs when user enters or not enters details in fields.
For example user does not enters the username
I was looking at the code :
$sql="INSERT INTO login(username,password) VALUES('$user','$pass')"; // insert user name and password to database
$result = mysqli_query($con,$sql);
if($result){
echo "Account Successfully Created";
}
else{
echo "Failure!";
}
}
else{
echo "That username already exists! Please try again with another.";
}
}
else{
echo "All fields are required!";
}
}
And as I im wondering where in the code does it give different conditions for the different echos
Thank you in advance
thankyou this worked for me 2
Hello there and thanks for this great tutorial ! im getting these erros
1:Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in C:wampwwwregister.php
2:Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given
Any help will be appreciated
nice tut
sir. there is an error please help me. mysql_num_rows() expects parameter 1 to be resource, boolean given in
Thank you so much, this was a great video.
I can't find the downloads in the link.
thnx man it worked for me