I’m trying to start learning php and doing login and keep login. Although I’m not sure how to set a “variable” after you login to let the server no the system no you are login. I’m trying to google this but coming up with some things that looks kind of like greek. Not sure if it’s the way I’m searching this by
Is there a tutorial or video for this anyone know of that I can look at?
What you’re looking for are session variables. They’re stored when you start a PHP session and are accessible to the whole application as long as the session is live. You can set pretty much anything you want to a session variable, for example a users name so you could have “Welcome username” at the top of every page.
Specifically you want to set a boolean of say is_logged_in, then each page that required a user to be logged in would check if that variable was set and if not redirect them away.
There is a good starter explanation here: http://php.about.com/od/advancedphp/ss/php_sessions_2.htm
and a good overall PHP beginners tutorial here: http://net.tutsplus.com/tutorials/php/30-php-best-practices-for-beginners/
Sorry, you also asked how to set them, while that is answered in the one tutorial I gave you it’s really quite simple. After your user successfully passes your login procedure you just need to set the variable.