HI, just one problem i am facing, once i login 'you are in! and proceed to the members page, i keep getting 'You must be logged in! ' instead of 'welcome message'
thank you very much for your great tutorials ,, and i like when u make mistakes in the(only in the tutorials ) so we learn from them and how to avoid them. Greetings
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\login.php:1) in C:\xampp\htdocs\login.php on line 3
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\login.php:1) in C:\xampp\htdocs\login.php on line 3
Is there a way to make the username part work for both upper and lower case, for example if my username were robert if you entered Robert it would work as well?
I have typed the code and sent me back 2 warnings :
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\login\member.php:67) in C:\xampp\htdocs\login\member.php on line 69
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\login\member.php:67) in C:\xampp\htdocs\login\member.php on line 69
Why does it display "1" when it should display my username..I have nothing telling the script to gather an integer..I took out the echo statement getting how many users were in the database..what am I doing wrong?
Only issue I'm having a problem with is that when I first entered my name into the db, it was entered as 'James' (with a capital letter), when I returned and entered 'james', it comes back with "Incorrect password!".
Is there a code to stop the database from recognising the difference between upper and lower cases for usernames?
@TheRissk13 cheers man, this was the only bugger i had, but all is good now thanks to that wee tip! This guy is really helpful though, I mean before I was just using the book php & mysql for dummies :P this guy know's what he's talking about. But yeah once again cheers! Appreciate the help!
To everyone who's having issues with the "Undefined Index" issue, in the 'member.php' page, where you see "if ($_SESSION ['username'])" just remove the ['username'] part. So line 5 should look like this:
I have a problem. I have a member page with a link back to login.php, and when I click that it says "Please enter a username and a password" instead of what I wanted it to say. What is the problem??
@19JakeB91 I had this same problem after extensive research and headache I found out that, you must set a password for your phpMyAdmin. Once you have done that in every line of in the mysql_connect function you need to put your password into the parameters, in the 3rd set of quotation marks. Example: $connect = mysql_connect("localhost","root","ENTER YOUR PASSWORD HERE");
hi. great video. Can you also put up a tutorial on how to manage different user groups and then give specific page access rights to the users based on the logged in user.
Everything works except I still get a blank where the username should be displayed (on member.php). I have double checked $_SESSION['username']=$dbusername; but still nothing. Ive triple checked the members page code as well, and it matches 100%. Anyone know what else could be causing this? Any help would be greatly appreciated!
I have one problem on firefox. If I destroy the session and then go to member.php I get an error which I believe comes from the IF sentence saying "Notice: Undefined index: username in *member.php* on line 8" can I actually check the session while it's not existing?
if i put the sesstion start on the top of my page code, the user name and logout appers on the top of my website... so how can i move the username and logout text to another place??When i make a div and put in css margin-top:100px; the whole page goes 100px down??
Hi, I followed closely this tutorial but I can't seem to get "session_start" to work. It always display this warning message:
Warning: session_start() [function.session-start]: open(/var/chroot/home/content/28/8192128/tmp/sess_60fin04a25i4i76lb2ls3s8i91, O_RDWR) failed: No such file or directory (2) in /home/content/28/8192128/html/user/login.php on line 3
Hi, I followed closely this tutorial but I can't seem to get "session_start" to work. It always display this warning message:
Warning: session_start() [function.session-start]: open(/var/chroot/home/content/28/8192128/tmp/sess_60fin04a25i4i76lb2ls3s8i91, O_RDWR) failed: No such file or directory (2) in /home/content/28/8192128/html/user/login.php on line 3
Help me please, ive done something wrong. In the wrong password message and the Youre in message it says 1 in the end and when i click on the Click link it says Welcome, 1 instead of my name. Whats wrong? Send me a message if ou want to see the code, i couldnt write it, too many charaters
if this helps anyone. when he does $_SESSION['username']==$dsusername;, use this insead. $_SESSION['username']=$dbusername;. using the == only works in if/else statements
Hello ! great tutorial ! but I have a little problem with the session_start(); it returns me tis error Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php:12) in /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php on line 14 any idea ?
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php:12) in /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php on line 14 why this happens ?
unfortunately this isnt very secure, 'cause to see all the content you just have to declare a $_SESSION['username']. in "the real world" you would need to check the content of S_SESSION['username'] against the db every single time (one time per page). i would create 3 sessions, 1) $username 2) hashed($password) 3) salted($username . $password). look up what "salt" and "hash" (md5, SHA etc.) means. you have to forbid access to a user, when he/she just creates sessions. sorry for my english ;)
Ok everything is good except that when I log in how do I hide login.html because It shows the login dialog again and when I go to login.php manually it says the enter username and pass error
How do I make it show you are logged in or something when they manually go there?
thanks for the tutorial!! i had many problems while doing this but i finaly made it :D now over to "change password" tutorial... hope that will be easier xD
i solved it :)) i was trying to access localhost/proiect/login.php first. The point is you must put localhost/proiect/index.php . Log in , and it should work.
I learnt alot but wat if the login form is on the index page the concatenation wud show an error til the person actually login. so wat can i do so that error wud not show or the error would not actually be an error?hope u get wat im asking
I've followed your tutorial from step1 to this final stage. Thanks, it works perfect just like I wanted it. But I seem to have a little problem: I don't know how to direct the php script to my webpage when the visitor successfully log in.Please any one with you useful information should kindly post it here.Thanks
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\Myworks\login.php:10) in C:\xampp\htdocs\Myworks\login.php on line 11
oka everyone wh gets those notices IT IS NO ERRORS but the sure look ugly on the page to get rid of them ad this error_reporting(0); to the start of your code it will stop them fgrom showing up
Stuck. I have check my code again and again. Can't seem to find the error I'm getting. After I click the "click here" I get an error on the member.php page:
Notice: Undefined index: username in ******member.php on line 5
Welcome, ! < Username doesn't show either. Any ideas?
PHP is case sensitive. The name attributes of your form elements are Name, Email, and Message. Consequently, you should be using $_POST['Name'], $_POST['Email'], and $_POST['Message'].
"Undefined index" means the variable you are trying to use doesn't exist. $_POST['Name'] and $_POST['name'] are completely different variables. They may look the same to you, but not to PHP.
I am having problems I typed the code in properly. and I can log on but when i click the link to enter the member page, it says please log in... it seams as tho echo $_SESSION['username']; works in login.php but not for member.php
I have spent a long time on this if anyone can help that would be great
@killerboduk999 No problem. I've done the same error the other way around many times when I've been writing JavaScript code. I've for example typed something like this:
2:00 I'm so proud of myself. ^^ I actually spotted the double equality signs and typed only one myself (and it worked). At 3:45, when my suspicion was confirmed to be correct, I was like "Yes!" :-)
Don't get me wrong, though. Your tutorials are GREAT! I knew very little about PHP before I started watching them, and ... I don't know what to say. You're simply awesome!!!
Just wondering, is it possible to automatically redirect the user to a members page when they put in the correct details, instead of showing the "You're in..." message?
Just wondering about security, how would I be able to code it so that when I login that I cannot access the same page from a different browser, without logging in on that? thanks
great tutorial, it has been a great help...in a futur update could you code an automatique redirection from login.php to members.php instead of placing a link inside the login.php ....Thanks !
So every time someone will type in their wrong user name it gives you the error message on a different page. How will you be able to make the error message appear on the bottom or top of the log in form?
@RS777able Not that advanced :-) in the form tags, just replace action="login.php" with action="", and move everything from login.php to the bottom of the index page.
That's what I usually do from the start, to avoid the information being passed around so much, especially when working with passwords that contain clear text. You should ALWAYS encrypt passwords with MD5 or similar.
HI, just one problem i am facing, once i login 'you are in! and proceed to the members page, i keep getting 'You must be logged in! ' instead of 'welcome message'
what could be causing this to happen?
angiezacc73 2 days ago
thank you very much for your great tutorials ,, and i like when u make mistakes in the(only in the tutorials ) so we learn from them and how to avoid them. Greetings
MistoKurdish 6 days ago in playlist Register & Login
This has been flagged as spam show
i have problem please help
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\login.php:1) in C:\xampp\htdocs\login.php on line 3
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\login.php:1) in C:\xampp\htdocs\login.php on line 3
you're in!
sultanaquat 6 days ago
i updated the php and now its ~~OK
sultanaquat 6 days ago
Comment removed
sultanaquat 6 days ago
if anyone is having issues with including html the session_start(); must be before the html tags!
MacintoshBourne 1 week ago
If you had any of the problems above, don't forget to call the session_start(); functon in the beginning of the login page!
supersoma2 1 week ago in playlist Mais vídeos de phpacademy
Is there a way to make the username part work for both upper and lower case, for example if my username were robert if you entered Robert it would work as well?
JulianaExpressAir 1 week ago in playlist Register & Login
I have typed the code and sent me back 2 warnings :
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\xampp\htdocs\login\member.php:67) in C:\xampp\htdocs\login\member.php on line 69
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\login\member.php:67) in C:\xampp\htdocs\login\member.php on line 69
alejjandrolali 3 weeks ago
me 2
sultanaquat 6 days ago
Why does it display "1" when it should display my username..I have nothing telling the script to gather an integer..I took out the echo statement getting how many users were in the database..what am I doing wrong?
geeno123 3 weeks ago
This has been flagged as spam show
finaly i made it work... great turorial
now can you make tutorial how can i seperate login for users and members restrictions or do you know anygood that work?
btw howcome you dont have that error everyone talks about... how do we turn it off?
BerimbauSenzala 3 weeks ago
Comment removed
BerimbauSenzala 3 weeks ago
nice verry nice
lenoj02 3 weeks ago
Dear when I reach to the $_SESSION['username']==$dbusername;
It gives an undefined error in preview.. like
"NOTE: Undefined index: username in C\xampp etc..
kindly solve my problem...please
deegneetee 1 month ago
when i type in the wrong password, it says that the user doesn't exist... why?
sciman001 1 month ago in playlist Register & Login
so how do we allow users to register
techgeek1993 1 month ago
can i download the code from anywhere?
stephensansatymail 1 month ago
@stephensansatymail It is good practise to write your own code. Gets you to digest what is happening and to think about the flow of the program.
nigelzaroo 1 month ago
Amazing videos by the way, I'm subscribing to you!
dikiedido50 1 month ago
If you don't practice regularly, PHP can be easily forgotten. But this dude is really awesome
LEilllLEi 1 month ago
This has been flagged as spam show
Thanks for the great vids Alex, works a treat!
Only issue I'm having a problem with is that when I first entered my name into the db, it was entered as 'James' (with a capital letter), when I returned and entered 'james', it comes back with "Incorrect password!".
Is there a code to stop the database from recognising the difference between upper and lower cases for usernames?
Cheers
James (obviously)
jimbow84 1 month ago
Comment removed
jimbow84 1 month ago
Comment removed
jimbow84 1 month ago
3:47
i was happy coz my username displayed on the screen and he's not LOL
iShieldBoy 1 month ago
hey ive tried everything to get the username to come up on members page someone plz help
jgile2 1 month ago
This worked for me to fix the "Undefined index" issue in member.php is to change
if ($_SESSION['username'])
to
if (isset($_SESSION['username']))
TheRissk13 1 month ago in playlist Favorite videos 19
@TheRissk13 cheers man, this was the only bugger i had, but all is good now thanks to that wee tip! This guy is really helpful though, I mean before I was just using the book php & mysql for dummies :P this guy know's what he's talking about. But yeah once again cheers! Appreciate the help!
charliejoethomson 1 month ago
@TheRissk13 Thanks.
PktMma 1 month ago
@TheRissk13 If only I'd have read the comments 3 fruggin hours ago.... WTF...over!
Crazzilla 3 weeks ago 3
To everyone who's having issues with the "Undefined Index" issue, in the 'member.php' page, where you see "if ($_SESSION ['username'])" just remove the ['username'] part. So line 5 should look like this:
if ($_SESSION)
SeanMBGE 1 month ago
I get this notice on member page when looking back when logged out. Notice: Undefined index: username in C:\xampp\htdocs\member.php on line 5 :( HELP
rainbowcrak 2 months ago
@rainbowcrak I have the same problem :(
JokerAndNL 2 months ago
very helpful..tnx :)
kjce1991 2 months ago
I am also getting the Undefined index message
Other than that it is working
Also on the member.php do I need to put all text html and all in the echo statement
Thanks
starfire1 2 months ago
I have a problem. I have a member page with a link back to login.php, and when I click that it says "Please enter a username and a password" instead of what I wanted it to say. What is the problem??
Robinfromnorway 2 months ago
After 10 minutes of missing that you wrote "logout" at the end. I finally found that was the problems. I am so stoopid.
RedofYellow 2 months ago
hope someone answers this:
I didn't get why did he check in the if statement if the username and password match ??
If they already fetched from the database that mean they are exist !
mjoraid 2 months ago
HELP!! after logging out and going back to member.php, i have this error:
Notice: Undefined index: username in C:\xampp\htdocs\login\member.php on line 4
What could be wrong?
DarlingBryan 2 months ago
@DarlingBryan tried everything and I'm still getting it
AbhishekPratapa 2 months ago
@AbhishekPratapa there's a tutorial on how to remove the errors but i cant understand alex didnt have the error
DarlingBryan 2 months ago
@DarlingBryan Same, have you found a solution?
rainbowcrak 2 months ago
I keep getting this message :/ "Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent."
Grimwaterfall 2 months ago
kj;h
Grimwaterfall 2 months ago
THIS LAST CODE
4. if ($_SESSION['firstname'])
it gives me an error
Notice: Undefined index: firstname in C:\xampp\htdocs\123\member.php on line 4
MyStada 2 months ago
@MyStada me too man and it's kind of annoying on there
AbhishekPratapa 2 months ago
@AbhishekPratapa fot that i use now
error_reporting(E_ALL ^ E_NOTICE);
;-)
MyStada 2 months ago
This has been flagged as spam show
@19JakeB91 I had this same problem after extensive research and headache I found out that, you must set a password for your phpMyAdmin. Once you have done that in every line of in the mysql_connect function you need to put your password into the parameters, in the 3rd set of quotation marks. Example: $connect = mysql_connect("localhost","root","ENTER YOUR PASSWORD HERE");
j7512 2 months ago
Comment removed
cristianiiacob 2 months ago
How do i make it so that when the user logs in, instead of saying "Welcom, Alex!" in a PHP page it says it somewhere in my current HTML page?
ChrisPBacon2010 3 months ago
hi. great video. Can you also put up a tutorial on how to manage different user groups and then give specific page access rights to the users based on the logged in user.
marwaha1234 3 months ago
where is the register page? ..that's the complicated bit for me..
geeno123 3 months ago
Once i have logged in and logged out and have typed in member.php in the browser...it does say I must be logged in however i still get this error
Undefined index: username in member.php....WHAT DO I DO?
Naeem237 3 months ago in playlist Naeem237's favorites
This has been flagged as spam show
Everything works except I still get a blank where the username should be displayed (on member.php). I have double checked $_SESSION['username']=$dbusername; but still nothing. Ive triple checked the members page code as well, and it matches 100%. Anyone know what else could be causing this? Any help would be greatly appreciated!
McRobottz 3 months ago in playlist php
I still get Notice: Undefined index: username in and I have set the $_SESSION[''username] = $dbusername;
also did
$_SESSION[''username] = $username;
Ideas?
philykearney 3 months ago 3
@philykearney $_SESSION['username']=$dbusername;
YouLiamTube 3 months ago
@philykearney
$_SESSION[''username] = $dbusername;
should be this exactly
$_SESSION['username'] = $dbusername;
zrowlandjones 3 months ago
I have one problem on firefox. If I destroy the session and then go to member.php I get an error which I believe comes from the IF sentence saying "Notice: Undefined index: username in *member.php* on line 8" can I actually check the session while it's not existing?
ighnaz 3 months ago
@ighnaz Same, have you found solution?
rainbowcrak 2 months ago
@rainbowcrak yep I've fixed it but I don't really remember it anymore, if you post me the code I can take a look
ighnaz 2 months ago
Thank you so musch! You are so good! I´ve learned so musch during your videos!
jkpgurra 3 months ago
You are in! Click here to enter the member page.1
It gives me the above message with a number 1 at the end. Why?
Thanks
MegaTony1965 3 months ago in playlist More videos from phpacademy
@MegaTony1965 You still have the line " echo $numrows; " that was removed in Part 2 at 4:58 :-)
LilmixPixelmaid 3 months ago
thank you very much, great tutorial keep up the good work!!!
willz1200 3 months ago
this really anoying error is coming up can you help me??
Notice: Undefined index: username in C:\xampp\htdocs\phptests\member.php on line 5
you must be logged in
PellyTravispell 3 months ago
@PellyTravispell
If you have a username and password make sure to include that...
Mega1hacker 3 months ago
First of all excellent tutorial.
I followed step by step and reach the same results using the wampserver.
now when I went up these files to the web / page did not recognize the session.
there is some configuration that has to do with the browser for the session Acknowledge me?
anwch12 3 months ago
You can use this code
diod1997 3 months ago
gr8 tutorial bro!
angeldominguez1 3 months ago
Ok take a look everyone at afflicto,dreamvoid,com :) I followed this tutorial. I stayed up all night. looks pretty cool IMHO =D
dreamvoidTV 4 months ago
If you are having the Notice: Undefined index
I got a simpler solution.... instead of
$_SESSION['username']==$dbusername;
use
$_SESSION['username']=$dbusername;
That should work
himes19 4 months ago 13
@himes19 COOL THANKS DUDE
dannvongola 3 months ago
thanks men!! It's really a great help. :D
darknightprince18 4 months ago
This has been flagged as spam show
IF you want to get redirect to index.php do:
echo "Incorrect password!". header( 'refresh: 3; index.php' );
die("Please enter username and a password". header( 'refresh: 3; index.php' ));
die("That user doesn't exist" . header( 'refresh: 3; index.php' ));
You are welcome =)
ShaneNL69 4 months ago
Comment removed
ShaneNL69 4 months ago
i followed everything youve done and type and i get this error message
log in successful
click here to enter member page>
Notice: Undefined index: username in C:\xampp\htdocs\login.php on line 35
manasume 4 months ago
@manasume
In your login.php:
Instead of
$_SESSION['username']==$dbusername;
do
$_SESSION['username']=$username;
ShaneNL69 4 months ago
@manasume I have the same problem, help please
System32Design 4 months ago
I want to get directed to the member.php page imediately when I click the login button.....Why should I use "Click" here to enter member page??
Jangain 4 months ago
Comment removed
ShaneNL69 4 months ago
@Jangain
echo "You're logged in! You'll be redirected to members page";
$_SESSION['username']==$dbusername;
header( 'refresh: 3; member.php' );
// 3 are the seconds to redirect you =)
ShaneNL69 4 months ago
can somebody message me a code that redirects me to the index.php if i'm nit logged in?
mehdolino1999 5 months ago
@mehdolino1999
after the session_destroy();, you put header('location: index.php')
ruthwijma 4 months ago
@ruthwijma
thanks
mehdolino1999 4 months ago
Is this secure? The code doesn't seem solid :S
threeclock 5 months ago
WHO CAN HELP ME?
if i put the sesstion start on the top of my page code, the user name and logout appers on the top of my website... so how can i move the username and logout text to another place??When i make a div and put in css margin-top:100px; the whole page goes 100px down??
thx:(
fakhaterz 5 months ago
Comment removed
fakhaterz 5 months ago
Hi, I followed closely this tutorial but I can't seem to get "session_start" to work. It always display this warning message:
Warning: session_start() [function.session-start]: open(/var/chroot/home/content/28/8192128/tmp/sess_60fin04a25i4i76lb2ls3s8i91, O_RDWR) failed: No such file or directory (2) in /home/content/28/8192128/html/user/login.php on line 3
Help, anyone? Thanks.
lyndr29 5 months ago
Hi, I followed closely this tutorial but I can't seem to get "session_start" to work. It always display this warning message:
Warning: session_start() [function.session-start]: open(/var/chroot/home/content/28/8192128/tmp/sess_60fin04a25i4i76lb2ls3s8i91, O_RDWR) failed: No such file or directory (2) in /home/content/28/8192128/html/user/login.php on line 3
Help, anyone? Thanks.
lyndr29 5 months ago
Isn't it better to make your logout page like this?
session_start();
session_unset();
session_destroy();
oNEoJoKeR 5 months ago
can u like have the codes available cant see the entire code properly...
keeezz 5 months ago
Comment removed
keeezz 5 months ago
Help me please, ive done something wrong. In the wrong password message and the Youre in message it says 1 in the end and when i click on the Click link it says Welcome, 1 instead of my name. Whats wrong? Send me a message if ou want to see the code, i couldnt write it, too many charaters
moltixx 5 months ago
Comment removed
moltixx 5 months ago
Comment removed
moltixx 5 months ago
if this helps anyone. when he does $_SESSION['username']==$dsusername;, use this insead. $_SESSION['username']=$dbusername;. using the == only works in if/else statements
thecanyon1993 5 months ago
Hi, I''ve got a problem. I'm running this code during HTML 5 on Adobe Dreamweaver CS5
This is my line of code:
$connect = mysql_connect("localhost", "root", "") or die("Unable to connect!");
mysql_select("phplogin") or die("Couldn't find db (database)");
$query = mysql_query("SELECT * FROM users WHERE username='$username'");
ToadsterRoaster6 6 months ago
This has been flagged as spam show
I got the solution. Instead of if ($_SESSION['username'])
make it:
if (isset($_SESSION['username']))
Enjoy :)
Kevco1808
Also, other solution for this is by adding @ beside the session
if (@$_SESSION['username'])
VigilianceAurelious 6 months ago
@Kevco1808 thanks so much :) :):) :):) :):) :)
capetown0791 6 months ago
I am getting this error
Notice: Undefined index: username in C:\xampp\htdocs\member.php on line 6
you must be logged in.
I have checked the user name is is small letters only in member.php and all other pages but its showing as undefined index don't know why.
can any one help me
muzzy4friends 6 months ago
Comment removed
MegaLuka99 6 months ago
Comment removed
MegaLuka99 6 months ago
Comment removed
MegaLuka99 6 months ago
Please help the session part doesn't work!
monaiz942 6 months ago
up to about 4:34 on the video, when i login onto the member page then go back to the login.php i get this
Notice: Undefined index: username in C:\xampp\htdocs\loginsession\login.php on line 5
Notice: Undefined index: password in C:\xampp\htdocs\loginsession\login.php on line 6
Please enter a username and a password!
jamesz069 6 months ago
To logout instead of session_destroy() you can also use unset($_SESSION['username']);
OCEANbreezeDIA 6 months ago
Hello ! great tutorial ! but I have a little problem with the session_start(); it returns me tis error Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php:12) in /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php on line 14 any idea ?
HorizonEW 6 months ago
@HorizonEW and this
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php:12) in /Applications/XAMPP/xamppfiles/htdocs/xampp/phplogtest2/login.php on line 14 why this happens ?
HorizonEW 6 months ago
Comment removed
Martinsvk11 6 months ago
Thanks! All these login tutorial help me a lot :D
MrPeasant777 6 months ago
unfortunately this isnt very secure, 'cause to see all the content you just have to declare a $_SESSION['username']. in "the real world" you would need to check the content of S_SESSION['username'] against the db every single time (one time per page). i would create 3 sessions, 1) $username 2) hashed($password) 3) salted($username . $password). look up what "salt" and "hash" (md5, SHA etc.) means. you have to forbid access to a user, when he/she just creates sessions. sorry for my english ;)
freddyfamous 6 months ago
This has been flagged as spam show
Thanks alex, My personal thanks in a video for phpacademy!
watch?v=DTSooY8fqpw
SilverMagics 6 months ago
If you had the same "Notice: Undefined index: username in ..." error that drove me bonkers, this is how I dealt with it:
instead of " $_SESSION['username']==$dbusername;"
I used " $_SESSION['username']=$dbusername;"
It works just the same and you don't have to suppress errors.
Tafaer 7 months ago 8
@Tafaer gettt it really works..
thnx
zaris22 6 months ago
This has been flagged as spam show
@Tafaer HEy what about this :
THIS LAST CODE :
4. if ($_SESSION['firstname'])
it gives me an error
Notice: Undefined index: firstname in C:\xampp\htdocs\123\member.php on line 4
MyStada 2 months ago
Good tutorial. Also im not find the register?!?
Gamelaster 7 months ago
i got error on the member(.)php..
it's still showing Welcome !.. what's my error?.. i tried using $_SESSION['username']=$username; it doens't work.. XD
GazzClean 7 months ago
dont die =[
sniper200110 7 months ago 2
This is not working for me!!!! help!!!! when i insert a code nothing appear!
morariuarmand 7 months ago
Ok everything is good except that when I log in how do I hide login.html because It shows the login dialog again and when I go to login.php manually it says the enter username and pass error
How do I make it show you are logged in or something when they manually go there?
Supremekhaoz 7 months ago
if i'm not logged in .. what is the code so that it will redirect me to the index page???
jepipay 7 months ago
8:15 Notice: Undefined index: username in C:\xampp\htdocs\member.php on line 5
You must be logged in!
Can someone correct me please! thanx.
gentlxman 7 months ago
@gentlxman try if (isset($_SESSION['username']))
bossco30 7 months ago
@bossco30 It works Thanx so much !
gentlxman 7 months ago
ha,ha, "i´m gonna want to die"...I usually think that about crossbrowser compatibiliity, not about php.
latintantramaster 7 months ago
instead of "you must be logged in" you could use a header which redirects you to the index.php file
ruthwijma 7 months ago
thanks for the tutorial!! i had many problems while doing this but i finaly made it :D now over to "change password" tutorial... hope that will be easier xD
PartyDoffy 8 months ago
i solved it :)) i was trying to access localhost/proiect/login.php first. The point is you must put localhost/proiect/index.php . Log in , and it should work.
hantataru 8 months ago
Notice: Undefined index: username in C:\xampp\htdocs\proiect\login.php on line 5
Notice: Undefined index: password in C:\xampp\htdocs\proiect\login.php on line 6
Please enter a username and a password
hantataru 8 months ago
@hantataru Had it too. Be sure you watched the whole tutorial before you ask anything. It helps ;)
Mo0nUh 8 months ago
got stuck on member php
Ifritmaster 8 months ago
could you send me a copy of the codes for all of this because I've done this 5 times and nothing is happening
mrv225 8 months ago
I learnt alot but wat if the login form is on the index page the concatenation wud show an error til the person actually login. so wat can i do so that error wud not show or the error would not actually be an error?hope u get wat im asking
119Kingofkings 8 months ago
thanx man your the best
browny222 8 months ago
I've followed your tutorial from step1 to this final stage. Thanks, it works perfect just like I wanted it. But I seem to have a little problem: I don't know how to direct the php script to my webpage when the visitor successfully log in.Please any one with you useful information should kindly post it here.Thanks
HUSTLERSGAME 8 months ago
I must say unlike the rest, it was clear and straight forward for a complete beginner like me. 2 Thumps UP!
xDELSINx 8 months ago
Comment removed
makoto114 8 months ago
Comment removed
makoto114 8 months ago
i have this ERROR MESSAGE
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\Myworks\login.php:10) in C:\xampp\htdocs\Myworks\login.php on line 11
please HELP...
funface001 8 months ago
success! thx alex
qhiena 8 months ago
oka everyone wh gets those notices IT IS NO ERRORS but the sure look ugly on the page to get rid of them ad this error_reporting(0); to the start of your code it will stop them fgrom showing up
thumbs up so ppl see
pakmand 8 months ago 10
@pakmand Noob. Thanks
MrMobinga 7 months ago
@MrMobinga
what are you doing here?
you need to shut the fuck up and let people share.
THE16THPHANTOM 7 months ago
@THE16THPHANTOM STFU You son of a bitch!!!
MrMobinga 7 months ago
Thanks for your help dude! AWESOME VIDEO!!
i22ac 8 months ago
Stuck. I have check my code again and again. Can't seem to find the error I'm getting. After I click the "click here" I get an error on the member.php page:
Notice: Undefined index: username in ******member.php on line 5
Welcome, ! < Username doesn't show either. Any ideas?
spikey79 9 months ago in playlist PHP PROJECTS: Register & Login
@spikey79 this from elsewhere, might help:
PHP is case sensitive. The name attributes of your form elements are Name, Email, and Message. Consequently, you should be using $_POST['Name'], $_POST['Email'], and $_POST['Message'].
"Undefined index" means the variable you are trying to use doesn't exist. $_POST['Name'] and $_POST['name'] are completely different variables. They may look the same to you, but not to PHP.
arumdevil 8 months ago
U r such a talent teacher for me, i have spent a lot of money to learn php ,but it was worthless..now i learn a lot from u ..keep going
shajijohnrose1 9 months ago in playlist PHP PROJECTS: Register & Login
i get a error on login.php with my connection to my phpmyadmin
MrKoolTutorials 9 months ago
I am having problems I typed the code in properly. and I can log on but when i click the link to enter the member page, it says please log in... it seams as tho echo $_SESSION['username']; works in login.php but not for member.php
I have spent a long time on this if anyone can help that would be great
ZargonRockClimbing 9 months ago
@18kitkats
instead of
echo "correct blabla and the link";
make it:
header("location: member.php");
like if this works!
DavidBChannel 9 months ago 3
my server has session autostart set... causing havoc!
CPTDJB 9 months ago
plssssssss help
this is the error undifined??? $_SESSION['username']==$dbusername;
killerboduk999 9 months ago
@killerboduk999 You have used double equality signs.
Wrong:
$_SESSION['username']==$dbusername;
Correct:
$_SESSION['username']=$dbusername;
SimonAlling 9 months ago
@SimonAlling thanks man i will try it right now
killerboduk999 9 months ago
@killerboduk999 No problem. I've done the same error the other way around many times when I've been writing JavaScript code. I've for example typed something like this:
if (x = y) { randomFunction(); }
(There should be two "=" as it is a comparison.)
SimonAlling 9 months ago
@SimonAlling yeah thats right it must be (x==y)
btw are you still in college??
killerboduk999 9 months ago
@killerboduk999 No, I guess I'm in high school. :P
SimonAlling 9 months ago
@SimonAlling how old are you?
killerboduk999 9 months ago
@killerboduk999 17. Why? :-)
SimonAlling 9 months ago
2:00 I'm so proud of myself. ^^ I actually spotted the double equality signs and typed only one myself (and it worked). At 3:45, when my suspicion was confirmed to be correct, I was like "Yes!" :-)
Don't get me wrong, though. Your tutorials are GREAT! I knew very little about PHP before I started watching them, and ... I don't know what to say. You're simply awesome!!!
SimonAlling 9 months ago 2
Thanks, i've been trying for SOO long to find a good one of these tutorials! i'll be using many more of your videos!
dwat2012 9 months ago
7:25 "Else, I'm gonna want to die" xD
Misklahr 9 months ago 4
Thanks so much for these videos!
Just wondering, is it possible to automatically redirect the user to a members page when they put in the correct details, instead of showing the "You're in..." message?
How would that be done?
18kitkats 9 months ago
Hey thanks for the upload,
Just wondering about security, how would I be able to code it so that when I login that I cannot access the same page from a different browser, without logging in on that? thanks
RitchyBGone 9 months ago
great tutorial, it has been a great help...in a futur update could you code an automatique redirection from login.php to members.php instead of placing a link inside the login.php ....Thanks !
jujudoparis 9 months ago
Comment removed
jujudoparis 9 months ago
great tutorial..thank you phpacademy
amaz4u 9 months ago
midnight - I had the same problem. I used
if (isset($_SESSION['username']))
instead. Seems to work ok now.
cyclograzzer1 10 months ago
I love your tutorials!
So every time someone will type in their wrong user name it gives you the error message on a different page. How will you be able to make the error message appear on the bottom or top of the log in form?
RS777able 10 months ago
@RS777able Not that advanced :-) in the form tags, just replace action="login.php" with action="", and move everything from login.php to the bottom of the index page.
That's what I usually do from the start, to avoid the information being passed around so much, especially when working with passwords that contain clear text. You should ALWAYS encrypt passwords with MD5 or similar.
borge947 10 months ago
Hi Phpacademy :)
Thx for the great Tut! I created my Login with your Video Help.
So how do I insert it in to a CSS Webpage (that I also already created) in Dreamweaver CS5?
TheGODsOPINION 10 months ago
Hello, I get Notice: Undefined index: username in C:\wamp\w ww\Test\login.php on line 29
where I have this $_SESSION['username']==$dbusername;
what am I doing wrong?
huskbarful 10 months ago
@huskbarful $_SESSION['username']==$username;
Not DBUsername, he corrected his mistake half way through the tutorials.
Acceptable76 10 months ago
@huskbarful You should basically just remove whan of the equal signs "=" as it should SET a variable, not COMPARE it :-)
= is SET
== is COMPARE
Alex corrects this two minutes later as well!
borge947 10 months ago
Notice: Undefined index: username on line 11 :S
Bigturkz 10 months ago
@Bigturkz
got the same error message ;)
Tnargav 10 months ago
This has been flagged as spam show
@Tnargav sorted it, replace $_session etc etc with (isset($_SESSION['username'])) after "session_start();
Bigturkz 10 months ago