Login logout system with session in php for beginners
Вставка
- Опубліковано 5 лют 2025
- "Hey guys if this video helps you then please subscribe my channel to support me.Thanks :)" *
In this video i will show you how to make login and logout system with session in php.Without login user can not acces the other page of your website excluding login page.If user try to acces other page by direct link then he should be redirected to login page.
if user loged in then user can acces all the page of website.
After logout session was destroyed and user have to login again to acces all the page.
i hope you like this video.
Please Subscribe my channel and like,share this video.
Thank you.
#php #loginlogout #session
* "Hey guys if this video helps you then please please dont forget to subscribe my channel that will inspire me to make such more videos for you. Thanks guys for watching my video :)" *
Thnks bro... its useful
the video helps me but but but but i won't subscribe i'm not satisfy i want hardcore video codings also you got a reward 1 DISLIKE
Bhai video Hindi rakna chahiye
@@VinodGupta-dj8my ha bhai age k video hindi mehi ayege
@@mukeshchaudhary1688 Bhai plz muj yah video Hindi me chahiye acha bataya ha tum ne but English me samj nai raha ha
Thank you sir jo hamse class me nahi samjha wo aapne samjha diya wo bhi 5 min me
🤗🤗
This was just what I needed. Just finished my first user authenticated website thanks to you. Your explanation was very clear and it all makes sense. It's amazing how so much functionality can be jammed into so little code. Thank you.
thank u sooo much. i hv been struggling last two days.
point to point explanation. Very informative.
Glad it was helpful!
Thanks so much bro....very helpfulll your video
Thanks bro very helpful video in such a short time
This is what I am looking for. Thankyou so much Sir..
Shukriya Mukesh bhai, gotta say. You made an excellent tutorial, all I need to do is connect this to a database.
With database is also posted... watch that video also 😊
concept of session is well defined here Tnx
Thank you for the video.
Thank you so much brother it really helped me 🙏🙏🙏
Thank you so much, love your content!
Thank you very mutch for being simple and streight
Thanks for appreciation 😊
Watch my latest video.. Which is improved version of this
Nice vídeo. Simple anda Clean. Great!
julio vitorino thanks :)
Well explained! keep the videos coming!
Thanks
Thank you for posting this video.
Welcome 😊
Awesome, best login php tutorial on yt.
Thanks 😊 watch my second video of login system with database.
bhai bhut badiya ,, your teaching to programming is much good ..bro, i wish ,.. you try maintain to upload continusly with these types of videos and for this video thanks bro.....
Welcome bro 😊
Watch my latest video
tysm alot mukesh brother , this video stood really helpful for me as well as my partner...............i just needed the second page codes ...............because it is not totally available on the video...................it is only till 25th line............i need the below codes also..............tysm brother
Thanks man, please watch carefully I showed all the code in this video.. If you looking for welcome page code then watch at 3.15 minute you will get it.😊
Mukesh Chaudhary there u go brother✨tysm for ur valuable time for me May God bless uhh brother, stay happie and keeping helping
@@rajkumargaikwad5706 thank you so much 😊😊
Good tutorial Bro... Keep it up.
Thanks
i subscribed... I am expecting more cool videos, so simple and just what i needed..because i just learned php and ajax.. really need session tutorials
Thanks and sure i will do that.. 😊
Thank you so much. I was looking for something like this. You are seriously a big help.
Your welcome :)
Thank you so much for this video!! It really helped me with an assignment I have been struggling with.
Welcome 😊...stay tuned and subscribe.
thank you soo much..your video is what i exactly wanteddd..thank u again
Welcome :) keep supporting by subscribing my channel.
Thanks very much. This really, Really, REALLY helped me!
Welcome, 😊
Keep supporting my channel :)
same here. brilliant video
@@jacobtodd275 thank you :)
I see what U did there
Can i hire your service, i need to pay as your student, i have a project, can we chat on wataapp
Great method
Thanks 😊
Description box mai. Code bhi dalaa karo bahot help ho jayegi...
Ok 👍
thanks! my saviour! new subsriber here
Thanks
you are awesome thank you!
Wonderful. this is nice simple tutorial.... but please show using the database
Thanks 😊
registration page be bnao plz saath mai oska table be show ho and vo session ki value get kare to login ho other wise na ho
Thank you so much! This is exactly what I needed :)
Lloyd F welcome :) please subscribe my channel... !
Nice bro🤟🤟🤟
Thanks 😊
Thanks sir for the awesome tutorial! It really helpful :D
Welcome :) please subscribe my channel to support me 😊
Hey Mukesh !! you had really done a excellent work!! Keep it up and thanks for this great help!! I will be more thankful to you if you can provide the source code, so that We can try it ourself!!
Sorry but i don't have code now.. I formated my PC so..
@@mukeshchaudhary1688 yeah i can understand that.. Actually everything is okay but i just need the code for welcome.php file.. As i was basically learning about sessions
U have taken static values...when I tried using values from db...it is not displaying anything...actually session is not starting...it would b very helpful for me to know how to login with dynamic values
Checkout my latest video ☺
@@mukeshchaudhary1688 ok
Thanks brother
Welcome :)
nice video! thanks a lot
Brilliant teaching
Thanks
In logout.php why we need redirection in if else statement? Cant we just unset the session with if statement and after if redirect.
After unset session also we need to redirect for login without redirecting how it comes to know what to do after unset.
In logout script... Redirection is defined twice on line 8 (in if statement) and line 12 (in else statement). If we unset the session with only if statement and close it then pass on the redirect without else statement.
Great video. Very good. I have a question. Can I put several usernames and passwords into the session? For using for more than one user?
You need database for that.. For more clarification watch my second video of login.
Good. Thank you so much bro
awesome sir please carry onnnnnnnnnnnnnnn
debasish chatterjee thank you 😊 and plz subscribe my channel and like this video.
This is what I am looking for. Thank you!!!
but, AFTER you've logged out, what happens if the user clicks the browser BACK button?
We destroyed session so it checked session again if not set then it will redirect user to login page
Can you teach, integrating two web application on a webserver? Where user logins into one webapp gets logged into other application as well
Sorry bro i don't know about this.
So basically you mean there is two types of web, the first one is for the login menu, and then the next is for the web ?
Superb video. I tried applying your code in GoDaddy's cPanel and found some issues with the code. How can I make your Php Sessions code work in cPanel?
Vry hlpful
Thank you 😊
Perfect example.❤️
What is difference b/w login& welcome page.??
if login successful then it will redirect you to welcome page.. Without login you can't access any page rather then login.
While username and password is correct we redditecf them to welcome page but why a session variable is set there?
We are setting session in welcome page in case of session is not set. Check if conditions carefully. Session is set in else part.
@@mukeshchaudhary1688 if they are incorrect we can just pop a msg it's incorrect know why session variable needs to be set?
We are setting it in case of correct and redirecting to the same page and if incorrect then showing pop up and redirecting to login page. Please check code.
@@mukeshchaudhary1688 thank you
@@rithikasasitharan5398 welcome 🤗
nice one 😊😊😊
Thanks
Hi nice sir. But can you please help me out for time session of expire in 5 min ??
Thanks
Ohhhh mukesh 😂😂 sapna kesi hai she is with you or in nalasupara 🤣🤣
Dw.. she is with me in my sapna 😂😂
It doesn't work on me..why???
Incorrect username
Hello Mukesh, I want to know how to host a website globally from own computer.
Hi Mukesh, How can i allow a 2nd person to login? And without a database?
You need to use database and registration page. Without database it is not feasible way to do it. But you can do it with session variables by storing user data in it.
How to show a html page after successful login.. Pls help
Thank you
Pge Ko run krne pr output kis taraf niklte h
Output hamesha client side dikhta he... Uska processing server side hota he.
@@mukeshchaudhary1688 me esa bol ri hu bro localhost me run nhi ho rha Mene new strt kiya h to muje pta ni h bro to localhost likhne pr nhi aa rha
@@Theaaruh xampp control panel me Apache server and mysql server start kiya?
Haa kiya h
Then file save kha ki he?
Thanx sir
when i type right credentials, it always appear wrong username or password. where was the error?
Do you following same procedure shown in this video?
@@mukeshchaudhary1688 yes sir but it always appear wrong credentials
@@kerbyangelopatungan2021 then check the if conditions once again.. Maybe you missed some conditions or misplaced if block... Check and reply.
@@mukeshchaudhary1688 i already check it one by one but its always the same
@@kerbyangelo4055 then mail me all of your code file.. I will check it
Can you show same login using phpmyadmin database
How to log in with multi user(user have a role like staff supervisor or admin)
For that you have to use database
thanks for this video session
Thank you :)
nicely explained
bingi venkatesh thank you
sir can i ask? how to connect this log in system to the bootsrap?
That's only designing part which is client side... You can use as per your requirement... Php remain same
how to use sessions for multiple login and if we want to show the particular page to the particular login.
Same doubt if you know this pls help me because it's depends on marks for me
okay then first explain whats your exact requirements..what kind of multiple login and for what?
Basically Iam a student it's on my project I want a session how it work
@@kalingirisridhar that's okay but where you want to use session? For a particular task or just for project features that you used session
@@mukeshchaudhary1688 it's just for project
Thank you so much!
Directly session cookies use are too risky.. use token as cookies..
when i open the login.php only a code is visible...
shreshth kant make sure your Apache server is running
ok thanks i will check
Ok
Can you provide the link for the above code!! It will be really helpful
Sorry, I don't have this code now.
@@mukeshchaudhary1688 Okk no problem fam!
*JUST A GREAT VIDEO BOSS!*
Thanks Man 😊
such like above I create a logout, it makes out of current page and redirect to index.php page but by clicking back button, reopen the logged page. How can I resolve it
even though i insert wrong username and pass, it still logged in? help
Is that one time logged in correct and then without doing logout you tried to insert wrong username?
@@mukeshchaudhary1688 no
@@anomolisagag2270 welcome 😊
very helpful video
Thank you :)
Hello ,
Thats Very Helpful Video But In Where Can I Get The Code !?
No source available. You can type all the code from this video.
Bro, please help me with this: I want to login with matching username and password from database table and display only selected data from the other tables using PHP. If you have enough time to. Thank you in anticipation.
Sure.. I will post this tutorial soon 👍
If you please bro, kindly add along with file upload.
Thanks a lot.
@@TECLOVENIA I already uploaded a video regarding file uploading in php. Please watch that video
@@mukeshchaudhary1688 Thanks a lot bro 👍
@@TECLOVENIA ua-cam.com/video/IO6djibkpFo/v-deo.html watch this video 👍
❤❤
sir my alert message does not display?
Please check out code again. You may have syntax error or wrong code flow.
Good vedio but I want same several users
Watch my latest video 😊
it is using MYSQL database?
No, but you can use it.
how to create pdf upload image upload after login as admin please help
thankd
excellent bro but how to set user name & password
If you creating real web application then you have to set username and password in database table then you have to fetch username and password from database and store to the variables
simply super
Sita Ramanjaneyulu thank you 😊
CSS ka code link bhej dijiye sir plz
Hello sir I want help to create a project in php
What kind of help you need?
i wanna to become a web developer how can you help me?
If you want to become professional web developer then i suggest you to get training of php from any good institute or company.
The only problem is the user just need to enter yourdomain.com/welcome.php then he can skip the authentication
Watch my new video all problem solved.
@@mukeshchaudhary1688 can you send me link of your new video
After "to" there is 1st form of verb
u can user the header() function instead
Yes we can also use that both works fine.
bro are you on discord or slack?
English se accha hindi hi bol lete hesitate ho rahe the bhai and thanks
Yea
Is this venerable to hacks?
I need this code for project so if you sent me it will be helpful to me
When i run your code i get this error.
Which error?
$uname="admin"; $pwd="admin"; session_startO; if(isset($_SESSION[ 'uname' ])) { echo "
Welcome " .$ SESSION[ 'uname' ]."
"; echo "product
"; echo "
< input type=button value=logout name=logout>"; ) else( if ($_POSTrunamel==$uname && $_POST[ 'pwd' ]=$pwd) ( $_SESSION[ 'uname' ]=$uname; echo "
@@coolairsolution3552 all errors are solved.. Check your email inbox. 😊😊
Thank you so much for this. New the code is working. It really helped me.
@@coolairsolution3552 welcome 😊. If you want login with database then watch my latest video.
where is source code bro.
It's accidentally deleted... i don't have copy of this... You can write your own.. By watching this video i explained and showed everything in it... I hope it's helps you bro...