Open Source Tutorials - Open Source Training
Open source training & tutorials from experienced, passionate people
chrome icon firefox icon ie icon opera icon safari icon Sings in these Browsers
A- A A+

By A Web Design

Welcome, Guest
Username Password: Remember me

Check that user logged in or not
(1 viewing) (1) Guest
All your queries regarding
PHP Installation,
Binding Apache-PHP-MySQL,
and tonnes more... will be solved in this forum
  • Page:
  • 1
TOPIC:

Check that user logged in or not

Check that user logged in or not 1 year, 4 months ago #451

  • kuldeep
  • OFFLINE
  • Junior Boarder
  • Posts: 35
  • Karma: 0
How i will check that user is, logged in or not. i want to make it a function and i want to use in each page and after login i want to go in current page(same page. where i was working).

can anybody tell me how can i do that..?

Re: Check that user logged in or not 1 year, 4 months ago #462

  • manav
  • OFFLINE
  • Senior Boarder
  • Posts: 51
  • Karma: 0
For this we can use the session object ($_SESSION). When the user login with his/ her user name and password, usually we check those to ensure for correctness. If that user name and password are valid one then we can store that user name in a session and then we can very that session variable has been set or not in a single files and we can include that file in all pages.

You can also use a header based approach, i.e. have a PHP include file which does necessary checking on user logged in or not. Include this file in other files.
  • Page:
  • 1
Time to create page: 2.78 seconds
OSV Newsletter


Receive HTML?

NOTE: To prevent subscription to the OSV newsletter, uncheck the checkbox above.
Guest Blog for OSV
Free Ebook Download